Merge topic 'bash-completion-updates'

f85f6a5 bash-completion: Fix/improve generator names extraction
351fd63 bash-completion: Add -S,-SP options arguments completion
This commit is contained in:
Brad King 2013-07-31 08:48:40 -04:00 committed by CMake Topic Stage
commit f2db78c120
3 changed files with 8 additions and 6 deletions

View File

@ -100,11 +100,13 @@ _cmake()
return return
;; ;;
-G) -G)
# FIXME: doesn't work properly
local IFS=$'\n' local IFS=$'\n'
local quoted
printf -v quoted %q "$cur"
COMPREPLY=( $( compgen -W '$( cmake --help 2>/dev/null | sed -n \ COMPREPLY=( $( compgen -W '$( cmake --help 2>/dev/null | sed -n \
"/^.*[^ ].*= Generates/{s|^ *\(.*[^ ]\) *= Generates.*$|\1|;s| |\\\\ |g;p}" \ -e "1,/^Generators/d" \
2>/dev/null )' -- "$cur" ) ) -e "/^ *[^ =]/{s|^ *\([^=]*[^ =]\).*$|\1|;s| |\\\\ |g;p}" \
2>/dev/null )' -- "$quoted" ) )
return return
;; ;;
--help-command) --help-command)

View File

@ -8,8 +8,8 @@ _cpack()
case "$prev" in case "$prev" in
-G) -G)
COMPREPLY=( $( compgen -W '$( cpack --help 2>/dev/null | COMPREPLY=( $( compgen -W '$( cpack --help 2>/dev/null |
grep "^ .*= .*" 2> /dev/null | grep -v "^ -" 2>/dev/null | sed -e "1,/^Generators/d" -e "s|^ *\([^ ]*\) .*$|\1|" \
cut -d" " -f 3 )' -- "$cur" ) ) 2>/dev/null )' -- "$cur" ) )
return return
;; ;;
-C) -C)

View File

@ -54,7 +54,7 @@ _ctest()
return return
;; ;;
-S|--script|-SP|--script-new-process) -S|--script|-SP|--script-new-process)
# FIXME ? _filedir '@(cmake|ctest)'
return return
;; ;;
--interactive-debug-mode) --interactive-debug-mode)