diff options
author | Eric NOULARD <eric.noulard@gmail.com> | 2012-04-22 17:08:29 (GMT) |
---|---|---|
committer | Eric NOULARD <eric.noulard@gmail.com> | 2012-04-23 18:46:08 (GMT) |
commit | 5b97942cbb915e8eaff0b5b9fee0676296656c93 (patch) | |
tree | 2bef7e23ab8f6aa7903f8cedebd9a9a094e2d6e7 /Docs/bash-completion/ctest | |
parent | 3a503926018fd10ef2120e2c1b98e93afb4fd0c1 (diff) | |
download | CMake-5b97942cbb915e8eaff0b5b9fee0676296656c93.zip CMake-5b97942cbb915e8eaff0b5b9fee0676296656c93.tar.gz CMake-5b97942cbb915e8eaff0b5b9fee0676296656c93.tar.bz2 |
Enhancement of bash completion scripts given by Igor Murzov.
The orginal patch has been reworked in order to follow
CMake source tree layout habit.
Inspired-By: Igor Murzov <e-mail@date.by>
Diffstat (limited to 'Docs/bash-completion/ctest')
-rw-r--r-- | Docs/bash-completion/ctest | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/Docs/bash-completion/ctest b/Docs/bash-completion/ctest new file mode 100644 index 0000000..9707f62 --- /dev/null +++ b/Docs/bash-completion/ctest @@ -0,0 +1,81 @@ +# bash completion for ctest(1) -*- shell-script -*- + +_ctest() +{ + local cur prev words cword + _init_completion -n = || return + + case "$prev" in + -C|--build-config) + COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo + MinSizeRel' -- "$cur" ) ) + return + ;; + -j|--parallel) + COMPREPLY=( $( compgen -W "{1..$(( $(_ncpus)*2 ))}" -- "$cur" ) ) + return + ;; + -O|--output-log|-A|--add-notes|--extra-submit) + _filedir + return + ;; + -L|--label-regex|-LE|--label-exclude|--track|-I|--tests-information|\ + --max-width|--timeout|--stop-time) + # argument required but no completions available + return + ;; + -R|--tests-regex|-E|--exclude-regex) + COMPREPLY=( $( compgen -W '$( ctest -N 2>/dev/null | + grep "^ Test" 2>/dev/null | cut -d: -f 2 )' -- "$cur" ) ) + return + ;; + -D|--dashboard) + if [[ $cur == @(Experimental|Nightly|Continuous)* ]]; then + local model action + action=${cur#@(Experimental|Nightly|Continuous)} + model=${cur%"$action"} + COMPREPLY=( $( compgen -W 'Start Update Configure Build Test + Coverage Submit MemCheck' -P "$model" -- "$action" ) ) + else + COMPREPLY=( $( compgen -W 'Experimental Nightly Continuous' \ + -- "$cur" ) ) + compopt -o nospace + fi + return + ;; + -M|--test-model) + COMPREPLY=( $( compgen -W 'Experimental Nightly Continuous' -- \ + "$cur" ) ) + return + ;; + -T|--test-action) + COMPREPLY=( $( compgen -W 'Start Update Configure Build Test + Coverage Submit MemCheck' -- "$cur" ) ) + return + ;; + -S|--script|-SP|--script-new-process) + # FIXME ? + return + ;; + --interactive-debug-mode) + COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) ) + return + ;; + --help-command) + COMPREPLY=( $( compgen -W '$( ctest --help-command-list 2>/dev/null| + tail -n +2 )' -- "$cur" ) ) + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + [[ $COMPREPLY ]] && return + fi + + _filedir +} && +complete -F _ctest ctest + +# ex: ts=4 sw=4 et filetype=sh |