Hi,

Please find attached a patch that updates the bash completion of ctest.
It will now be able to complete the -L,-LE options and their long versions.

Regards,
Sylvain
>From 8361c9dae1540c23b5529bfb6bb4de3670ecd88a Mon Sep 17 00:00:00 2001
From: Sylvain Joubert <[email protected]>
Date: Wed, 3 Sep 2014 20:26:17 +0200
Subject: [PATCH] Add bash completion for label options of ctest

---
 Auxiliary/bash-completion/ctest | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Auxiliary/bash-completion/ctest b/Auxiliary/bash-completion/ctest
index 25cb998..327e12c 100644
--- a/Auxiliary/bash-completion/ctest
+++ b/Auxiliary/bash-completion/ctest
@@ -19,8 +19,12 @@ _ctest()
             _filedir
             return
             ;;
-        -L|--label-regex|-LE|--label-exclude|--track|-I|--tests-information|\
-        --max-width|--timeout|--stop-time)
+        -L|--label-regex|-LE|--label-exclude)
+            COMPREPLY=( $( compgen -W '$( ctest --print-labels 2>/dev/null |
+                grep "^  " 2>/dev/null | cut -d" " -f 3 )' -- "$cur" ) )
+            return
+            ;;
+        --track|-I|--tests-information|--max-width|--timeout|--stop-time)
             # argument required but no completions available
             return
             ;;
-- 
2.1.0

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to