Merge pull request #1241 from zsh-users/fix_cmake_help_completion
Fix cmake help item completion
This commit is contained in:
commit
e461417f4e
14
src/_cmake
14
src/_cmake
|
|
@ -51,8 +51,6 @@
|
||||||
#
|
#
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
|
|
||||||
local context state line curcontext="$curcontext" cmake_args
|
|
||||||
|
|
||||||
local -a cmake_build_options=(
|
local -a cmake_build_options=(
|
||||||
'-S[Explicitly specify a source directory]:source directory:_path_files -/'
|
'-S[Explicitly specify a source directory]:source directory:_path_files -/'
|
||||||
'-B[Explicitly specify a build directory]:build directory:_path_files -/'
|
'-B[Explicitly specify a build directory]:build directory:_path_files -/'
|
||||||
|
|
@ -235,7 +233,7 @@ _cmake_on_build() {
|
||||||
|
|
||||||
if [[ "$in_build" == false || "$difference" -eq 1 ]] ; then
|
if [[ "$in_build" == false || "$difference" -eq 1 ]] ; then
|
||||||
# either there is no --build or completing the directory after --build
|
# either there is no --build or completing the directory after --build
|
||||||
_arguments -C -s \
|
_arguments -s \
|
||||||
- build_opts \
|
- build_opts \
|
||||||
"$cmake_build_options[@]" \
|
"$cmake_build_options[@]" \
|
||||||
- build_cmds \
|
- build_cmds \
|
||||||
|
|
@ -303,7 +301,7 @@ _cmake_on_install() {
|
||||||
|
|
||||||
if [[ "$in_build" == false || "$difference" -eq 1 ]] ; then
|
if [[ "$in_build" == false || "$difference" -eq 1 ]] ; then
|
||||||
# either there is no --install or completing the directory after --install
|
# either there is no --install or completing the directory after --install
|
||||||
_arguments -C -s \
|
_arguments -s \
|
||||||
- build_opts \
|
- build_opts \
|
||||||
"$cmake_build_options[@]" \
|
"$cmake_build_options[@]" \
|
||||||
- build_cmds \
|
- build_cmds \
|
||||||
|
|
@ -600,18 +598,18 @@ _cmake_commands() {
|
||||||
_describe -t commands 'command' commands
|
_describe -t commands 'command' commands
|
||||||
}
|
}
|
||||||
|
|
||||||
local cmake_suggest_build;cmake_suggest_build=(
|
local -a cmake_suggest_build=(
|
||||||
'--build[build]:build dir:_cmake_suggest_builddirs'
|
'--build[build]:build dir:_cmake_suggest_builddirs'
|
||||||
)
|
)
|
||||||
|
|
||||||
local cmake_suggest_install;cmake_suggest_install=(
|
local -a cmake_suggest_install=(
|
||||||
'--install[install]:install dir:_cmake_suggest_installdirs'
|
'--install[install]:install dir:_cmake_suggest_installdirs'
|
||||||
)
|
)
|
||||||
|
|
||||||
if [[ "$service" = -value-*CMAKE_GENERATOR* ]]; then
|
if [[ "$service" = -value-*CMAKE_GENERATOR* ]]; then
|
||||||
_cmake_generators
|
_cmake_generators
|
||||||
elif [ $CURRENT -eq 2 ] ; then
|
elif [ $CURRENT -eq 2 ] ; then
|
||||||
_arguments -C -s \
|
_arguments -s \
|
||||||
- help \
|
- help \
|
||||||
"$cmake_help_actions[@]" \
|
"$cmake_help_actions[@]" \
|
||||||
- command \
|
- command \
|
||||||
|
|
@ -626,6 +624,8 @@ elif [[ $words[2] == --build ]] ; then
|
||||||
_cmake_on_build
|
_cmake_on_build
|
||||||
elif [[ $words[2] == --install ]] ; then
|
elif [[ $words[2] == --install ]] ; then
|
||||||
_cmake_on_install
|
_cmake_on_install
|
||||||
|
elif [[ $words[2] == --help-* ]] ; then
|
||||||
|
_arguments "$cmake_help_actions[@]"
|
||||||
else
|
else
|
||||||
_arguments "$cmake_build_options[@]"
|
_arguments "$cmake_build_options[@]"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue