diff options
author | Brad King <brad.king@kitware.com> | 2013-09-23 17:31:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-09-25 20:16:54 (GMT) |
commit | a8d7141d2b39caa5d98cd85c9c656e2a7ae948e5 (patch) | |
tree | d4aed082dae92143886d4919241e070fee4a0b0f /Docs/bash-completion/cpack | |
parent | 4c4bafdeabe868677a868dba416878c097c416b3 (diff) | |
download | CMake-a8d7141d2b39caa5d98cd85c9c656e2a7ae948e5.zip CMake-a8d7141d2b39caa5d98cd85c9c656e2a7ae948e5.tar.gz CMake-a8d7141d2b39caa5d98cd85c9c656e2a7ae948e5.tar.bz2 |
bash-completion: Future-proof --help-*-list "cXXXX version" filtering
A future version of CMake may not print the "cmake version" line at the
beginning of the --help-*-list output. Filter out the line with 'grep'
instead of 'tail' to tolerate output from versions of CMake with and
without the version line. Match "cmake version", "cpack version", and
"ctest version" in each corresponding completion script.
Diffstat (limited to 'Docs/bash-completion/cpack')
-rw-r--r-- | Docs/bash-completion/cpack | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Docs/bash-completion/cpack b/Docs/bash-completion/cpack index 51638c5..9ab6048 100644 --- a/Docs/bash-completion/cpack +++ b/Docs/bash-completion/cpack @@ -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 |