diff options
Diffstat (limited to 'Docs/bash-completion')
-rw-r--r-- | Docs/bash-completion/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Docs/bash-completion/cmake | 16 | ||||
-rw-r--r-- | Docs/bash-completion/cpack | 10 | ||||
-rw-r--r-- | Docs/bash-completion/ctest | 4 |
4 files changed, 17 insertions, 15 deletions
diff --git a/Docs/bash-completion/CMakeLists.txt b/Docs/bash-completion/CMakeLists.txt index 592b71e93..c0a88999e 100644 --- a/Docs/bash-completion/CMakeLists.txt +++ b/Docs/bash-completion/CMakeLists.txt @@ -5,4 +5,4 @@ # add symlinks to the files in appropriate places # /etc/bash_completion.d/ # DATADIR/completions (may be /usr/share/<package>/completions -install(FILES cmake cpack ctest DESTINATION ${REL_CMAKE_DATA_DIR}/completions) +install(FILES cmake cpack ctest DESTINATION ${CMAKE_DATA_DIR}/completions) diff --git a/Docs/bash-completion/cmake b/Docs/bash-completion/cmake index 59b565ac0..59e02987b 100644 --- a/Docs/bash-completion/cmake +++ b/Docs/bash-completion/cmake @@ -100,21 +100,23 @@ _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) COMPREPLY=( $( compgen -W '$( cmake --help-command-list 2>/dev/null| - tail -n +2 )' -- "$cur" ) ) + grep -v "^cmake version " )' -- "$cur" ) ) return ;; --help-module) COMPREPLY=( $( compgen -W '$( cmake --help-module-list 2>/dev/null| - tail -n +2 )' -- "$cur" ) ) + grep -v "^cmake version " )' -- "$cur" ) ) return ;; --help-policy) @@ -124,12 +126,12 @@ _cmake() ;; --help-property) COMPREPLY=( $( compgen -W '$( cmake --help-property-list \ - 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + 2>/dev/null | grep -v "^cmake version " )' -- "$cur" ) ) return ;; --help-variable) COMPREPLY=( $( compgen -W '$( cmake --help-variable-list \ - 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + 2>/dev/null | grep -v "^cmake version " )' -- "$cur" ) ) return ;; esac diff --git a/Docs/bash-completion/cpack b/Docs/bash-completion/cpack index a0c1f8375..9ab604839 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) @@ -20,7 +20,7 @@ _cpack() -D) [[ $cur == *=* ]] && return # no completion for values COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \ - 2>/dev/null | tail -n +2 )' -S = -- "$cur" ) ) + 2>/dev/null | grep -v "^cpack version " )' -S = -- "$cur" ) ) compopt -o nospace return ;; @@ -38,12 +38,12 @@ _cpack() ;; --help-command) COMPREPLY=( $( compgen -W '$( cpack --help-command-list 2>/dev/null| - tail -n +2 )' -- "$cur" ) ) + grep -v "^cpack version " )' -- "$cur" ) ) return ;; --help-variable) COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \ - 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + 2>/dev/null | grep -v "^cpack version " )' -- "$cur" ) ) return ;; esac diff --git a/Docs/bash-completion/ctest b/Docs/bash-completion/ctest index 9707f6269..25cb99841 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) @@ -63,7 +63,7 @@ _ctest() ;; --help-command) COMPREPLY=( $( compgen -W '$( ctest --help-command-list 2>/dev/null| - tail -n +2 )' -- "$cur" ) ) + grep -v "^ctest version " )' -- "$cur" ) ) return ;; esac |