summaryrefslogtreecommitdiffstats
path: root/Docs
diff options
context:
space:
mode:
authorEric NOULARD <eric.noulard@gmail.com>2012-01-03 17:12:56 (GMT)
committerEric NOULARD <eric.noulard@gmail.com>2012-01-03 17:12:56 (GMT)
commit4d253d1a9d9ec3b3a1f38cb2a490da998f88482a (patch)
tree2980b805346499f4102e5e1ab49a036aac579951 /Docs
parentdf224727cfcc233fbe36417e48f2e5fee01c73ee (diff)
downloadCMake-4d253d1a9d9ec3b3a1f38cb2a490da998f88482a.zip
CMake-4d253d1a9d9ec3b3a1f38cb2a490da998f88482a.tar.gz
CMake-4d253d1a9d9ec3b3a1f38cb2a490da998f88482a.tar.bz2
Enhance bash completion file for cmake and ctest
- filter out cmake/ctest version line - provide -R as -E completion with ctest
Diffstat (limited to 'Docs')
-rw-r--r--Docs/cmake-completion25
1 files changed, 16 insertions, 9 deletions
diff --git a/Docs/cmake-completion b/Docs/cmake-completion
index 011f3fa..d82d608 100644
--- a/Docs/cmake-completion
+++ b/Docs/cmake-completion
@@ -51,13 +51,20 @@ _cmake()
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0
;;
+ # FIXME: don't know how to handle multi words completion
+ # or more precisely word that contains space in them like "Unix Makefiles"
+ # -G)
+ # local running=$(for x in `cmake --help | grep "^ .*=\ .*" | grep -v "^ -" | cut -d"=" -f 1 | grep -v "^ "`; do echo \"${x}\" ; done )
+ # COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
+ # return 0
+ # ;;
--help-command)
- local running=$(for x in `cmake --help-command-list`; do echo ${x} ; done )
+ local running=$(for x in `cmake --help-command-list | grep -v "cmake version"`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0
;;
--help-module)
- local running=$(for x in `cmake --help-module-list`; do echo ${x} ; done )
+ local running=$(for x in `cmake --help-module-list | grep -v "cmake version"`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0
;;
@@ -67,12 +74,12 @@ _cmake()
return 0
;;
--help-property)
- local running=$(for x in `cmake --help-property-list`; do echo ${x} ; done )
+ local running=$(for x in `cmake --help-property-list | grep -v "cmake version"`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0
;;
--help-variable)
- local running=$(for x in `cmake --help-variable-list`; do echo ${x} ; done )
+ local running=$(for x in `cmake --help-variable-list | grep -v "cmake version"`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0
;;
@@ -128,14 +135,14 @@ _cpack()
esac
#
- # Complete the option (Level 0 - right after cmake)
+ # Complete the option (Level 0 - right after cpack)
#
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
} &&
complete -F _cpack -o default cpack
#
-# cmake command
+# ctest command
#
# have ctest &&
_ctest()
@@ -156,11 +163,11 @@ _ctest()
#
case "${prev}" in
--help-command)
- local running=$(for x in `ctest --help-command-list`; do echo ${x} ; done )
+ local running=$(for x in `ctest --help-command-list | grep -v "ctest version" `; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0
;;
- -R)
+ -R|-E)
local running=$(for x in `ctest -N 2> /dev/null | grep "^ Test" | cut -d: -f 2`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0
@@ -187,4 +194,4 @@ complete -F _ctest -o default ctest
# sh-indent-comment: t
# indent-tabs-mode: nil
# End:
-# ex: ts=4 sw=4 et filetype=sh \ No newline at end of file
+# ex: ts=4 sw=4 et filetype=sh