summaryrefslogtreecommitdiff
path: root/share/cmake-3.2/completions
diff options
context:
space:
mode:
authorVince Harron <vharron@google.com>2015-06-02 18:37:41 -0700
committerVince Harron <vharron@google.com>2015-06-02 18:37:41 -0700
commit091caafda44f7fe52a94387b2eafcf204ea909d3 (patch)
tree78f18486962eca24c3a8fa7a2002a5d5a0ca459c /share/cmake-3.2/completions
parent1897a4b42df33a98f1c89c929c5ce953f7848df7 (diff)
downloadlinux-x86-studio-master-release.tar.gz
Diffstat (limited to 'share/cmake-3.2/completions')
-rw-r--r--share/cmake-3.2/completions/cmake151
-rw-r--r--share/cmake-3.2/completions/cpack61
-rw-r--r--share/cmake-3.2/completions/ctest85
3 files changed, 297 insertions, 0 deletions
diff --git a/share/cmake-3.2/completions/cmake b/share/cmake-3.2/completions/cmake
new file mode 100644
index 0000000..59e0298
--- /dev/null
+++ b/share/cmake-3.2/completions/cmake
@@ -0,0 +1,151 @@
+# bash completion for cmake(1) -*- shell-script -*-
+
+_cmake()
+{
+ local cur prev words cword split=false
+ _init_completion -n := || return
+
+ # Workaround for options like -DCMAKE_BUILD_TYPE=Release
+ local prefix=
+ if [[ $cur == -D* ]]; then
+ prev=-D
+ prefix=-D
+ cur="${cur#-D}"
+ elif [[ $cur == -U* ]]; then
+ prev=-U
+ prefix=-U
+ cur="${cur#-U}"
+ fi
+
+ case "$prev" in
+ -D)
+ if [[ $cur == *=* ]]; then
+ # complete values for variables
+ local var type value
+ var="${cur%%[:=]*}"
+ value="${cur#*=}"
+
+ if [[ $cur == CMAKE_BUILD_TYPE* ]]; then # most widely used case
+ COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo
+ MinSizeRel' -- "$value" ) )
+ return
+ fi
+
+ if [[ $cur == *:* ]]; then
+ type="${cur#*:}"
+ type="${type%%=*}"
+ else # get type from cache if it's not set explicitly
+ type=$( cmake -LA -N 2>/dev/null | grep "$var:" \
+ 2>/dev/null )
+ type="${type#*:}"
+ type="${type%%=*}"
+ fi
+ case "$type" in
+ FILEPATH)
+ cur="$value"
+ _filedir
+ return
+ ;;
+ PATH)
+ cur="$value"
+ _filedir -d
+ return
+ ;;
+ BOOL)
+ COMPREPLY=( $( compgen -W 'ON OFF TRUE FALSE' -- \
+ "$value" ) )
+ return
+ ;;
+ STRING|INTERNAL)
+ # no completion available
+ return
+ ;;
+ esac
+ elif [[ $cur == *:* ]]; then
+ # complete types
+ local type="${cur#*:}"
+ COMPREPLY=( $( compgen -W 'FILEPATH PATH STRING BOOL INTERNAL'\
+ -S = -- "$type" ) )
+ compopt -o nospace
+ else
+ # complete variable names
+ COMPREPLY=( $( compgen -W '$( cmake -LA -N | tail -n +2 |
+ cut -f1 -d: )' -P "$prefix" -- "$cur" ) )
+ compopt -o nospace
+ fi
+ return
+ ;;
+ -U)
+ COMPREPLY=( $( compgen -W '$( cmake -LA -N | tail -n +2 |
+ cut -f1 -d: )' -P "$prefix" -- "$cur" ) )
+ return
+ ;;
+ esac
+
+ _split_longopt && split=true
+
+ case "$prev" in
+ -C|-P|--graphviz|--system-information)
+ _filedir
+ return
+ ;;
+ --build)
+ _filedir -d
+ return
+ ;;
+ -E)
+ COMPREPLY=( $( compgen -W "$( cmake -E help |& sed -n \
+ '/^ /{s|^ \([^ ]\{1,\}\) .*$|\1|;p}' 2>/dev/null )" \
+ -- "$cur" ) )
+ return
+ ;;
+ -G)
+ local IFS=$'\n'
+ local quoted
+ printf -v quoted %q "$cur"
+ COMPREPLY=( $( compgen -W '$( cmake --help 2>/dev/null | sed -n \
+ -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|
+ grep -v "^cmake version " )' -- "$cur" ) )
+ return
+ ;;
+ --help-module)
+ COMPREPLY=( $( compgen -W '$( cmake --help-module-list 2>/dev/null|
+ grep -v "^cmake version " )' -- "$cur" ) )
+ return
+ ;;
+ --help-policy)
+ COMPREPLY=( $( compgen -W '$( cmake --help-policies 2>/dev/null |
+ grep "^ CMP" 2>/dev/null )' -- "$cur" ) )
+ return
+ ;;
+ --help-property)
+ COMPREPLY=( $( compgen -W '$( cmake --help-property-list \
+ 2>/dev/null | grep -v "^cmake version " )' -- "$cur" ) )
+ return
+ ;;
+ --help-variable)
+ COMPREPLY=( $( compgen -W '$( cmake --help-variable-list \
+ 2>/dev/null | grep -v "^cmake version " )' -- "$cur" ) )
+ return
+ ;;
+ esac
+
+ $split && return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ [[ $COMPREPLY ]] && return
+ fi
+
+ _filedir
+} &&
+complete -F _cmake cmake
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/share/cmake-3.2/completions/cpack b/share/cmake-3.2/completions/cpack
new file mode 100644
index 0000000..9ab6048
--- /dev/null
+++ b/share/cmake-3.2/completions/cpack
@@ -0,0 +1,61 @@
+# bash completion for cpack(1) -*- shell-script -*-
+
+_cpack()
+{
+ local cur prev words cword
+ _init_completion -n = || return
+
+ case "$prev" in
+ -G)
+ COMPREPLY=( $( compgen -W '$( cpack --help 2>/dev/null |
+ sed -e "1,/^Generators/d" -e "s|^ *\([^ ]*\) .*$|\1|" \
+ 2>/dev/null )' -- "$cur" ) )
+ return
+ ;;
+ -C)
+ COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo
+ MinSizeRel' -- "$cur" ) )
+ return
+ ;;
+ -D)
+ [[ $cur == *=* ]] && return # no completion for values
+ COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \
+ 2>/dev/null | grep -v "^cpack version " )' -S = -- "$cur" ) )
+ compopt -o nospace
+ return
+ ;;
+ -P|-R|--vendor)
+ # argument required but no completions available
+ return
+ ;;
+ -B)
+ _filedir -d
+ return
+ ;;
+ --config)
+ _filedir
+ return
+ ;;
+ --help-command)
+ COMPREPLY=( $( compgen -W '$( cpack --help-command-list 2>/dev/null|
+ grep -v "^cpack version " )' -- "$cur" ) )
+ return
+ ;;
+ --help-variable)
+ COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \
+ 2>/dev/null | grep -v "^cpack version " )' -- "$cur" ) )
+ return
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ [[ $COMPREPLY ]] && return
+ fi
+
+ _filedir
+} &&
+complete -F _cpack cpack
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/share/cmake-3.2/completions/ctest b/share/cmake-3.2/completions/ctest
new file mode 100644
index 0000000..327e12c
--- /dev/null
+++ b/share/cmake-3.2/completions/ctest
@@ -0,0 +1,85 @@
+# 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)
+ COMPREPLY=( $( compgen -W '$( ctest --print-labels 2>/dev/null |
+ grep "^ " 2>/dev/null | cut -d" " -f 3 )' -- "$cur" ) )
+ return
+ ;;
+ --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)
+ _filedir '@(cmake|ctest)'
+ return
+ ;;
+ --interactive-debug-mode)
+ COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) )
+ return
+ ;;
+ --help-command)
+ COMPREPLY=( $( compgen -W '$( ctest --help-command-list 2>/dev/null|
+ grep -v "^ctest version " )' -- "$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