diff options
-rw-r--r-- | Docs/bash-completion/cmake | 8 | ||||
-rw-r--r-- | Docs/bash-completion/cpack | 4 | ||||
-rw-r--r-- | Docs/bash-completion/ctest | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/Docs/bash-completion/cmake b/Docs/bash-completion/cmake index 59b565a..5f33c09 100644 --- a/Docs/bash-completion/cmake +++ b/Docs/bash-completion/cmake @@ -100,11 +100,13 @@ _cmake() return ;; -G) - # FIXME: doesn't work properly local IFS=$'\n' + local quoted + printf -v quoted %q "$cur" COMPREPLY=( $( compgen -W '$( cmake --help 2>/dev/null | sed -n \ - "/^.*[^ ].*= Generates/{s|^ *\(.*[^ ]\) *= Generates.*$|\1|;s| |\\\\ |g;p}" \ - 2>/dev/null )' -- "$cur" ) ) + -e "1,/^Generators/d" \ + -e "/^ *[^ =]/{s|^ *\([^=]*[^ =]\).*$|\1|;s| |\\\\ |g;p}" \ + 2>/dev/null )' -- "$quoted" ) ) return ;; --help-command) diff --git a/Docs/bash-completion/cpack b/Docs/bash-completion/cpack index a0c1f83..51638c5 100644 --- a/Docs/bash-completion/cpack +++ b/Docs/bash-completion/cpack @@ -8,8 +8,8 @@ _cpack() case "$prev" in -G) COMPREPLY=( $( compgen -W '$( cpack --help 2>/dev/null | - grep "^ .*= .*" 2> /dev/null | grep -v "^ -" 2>/dev/null | - cut -d" " -f 3 )' -- "$cur" ) ) + sed -e "1,/^Generators/d" -e "s|^ *\([^ ]*\) .*$|\1|" \ + 2>/dev/null )' -- "$cur" ) ) return ;; -C) diff --git a/Docs/bash-completion/ctest b/Docs/bash-completion/ctest index 9707f62..7433d3d 100644 --- a/Docs/bash-completion/ctest +++ b/Docs/bash-completion/ctest @@ -54,7 +54,7 @@ _ctest() return ;; -S|--script|-SP|--script-new-process) - # FIXME ? + _filedir '@(cmake|ctest)' return ;; --interactive-debug-mode) |