From be63667ca5361b5948d6b779f23ce576e5416f69 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Thu, 19 Mar 2026 19:01:53 +0900 Subject: [PATCH 1/3] fix help item completion --- src/_cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_cmake b/src/_cmake index 72ed6eb..9a452b4 100644 --- a/src/_cmake +++ b/src/_cmake @@ -626,6 +626,8 @@ elif [[ $words[2] == --build ]] ; then _cmake_on_build elif [[ $words[2] == --install ]] ; then _cmake_on_install +elif [[ $words[2] == --help-* ]] ; then + _arguments "$cmake_help_actions[@]" else _arguments "$cmake_build_options[@]" fi From bb213908817213939cb959043526a5df7564d28f Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Thu, 19 Mar 2026 19:02:43 +0900 Subject: [PATCH 2/3] fix formatting issue --- src/_cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/_cmake b/src/_cmake index 9a452b4..b01682e 100644 --- a/src/_cmake +++ b/src/_cmake @@ -600,12 +600,12 @@ _cmake_commands() { _describe -t commands 'command' commands } -local cmake_suggest_build;cmake_suggest_build=( - '--build[build]:build dir:_cmake_suggest_builddirs' +local -a cmake_suggest_build=( + '--build[build]:build dir:_cmake_suggest_builddirs' ) -local cmake_suggest_install;cmake_suggest_install=( - '--install[install]:install dir:_cmake_suggest_installdirs' +local -a cmake_suggest_install=( + '--install[install]:install dir:_cmake_suggest_installdirs' ) if [[ "$service" = -value-*CMAKE_GENERATOR* ]]; then From 87378081eee69e80626d6df9214f898d89c82abc Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Thu, 19 Mar 2026 19:04:12 +0900 Subject: [PATCH 3/3] Remove needless variable declarations --- src/_cmake | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/_cmake b/src/_cmake index b01682e..68ec9c1 100644 --- a/src/_cmake +++ b/src/_cmake @@ -51,8 +51,6 @@ # # ------------------------------------------------------------------------- -local context state line curcontext="$curcontext" cmake_args - local -a cmake_build_options=( '-S[Explicitly specify a source directory]:source 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 # either there is no --build or completing the directory after --build - _arguments -C -s \ + _arguments -s \ - build_opts \ "$cmake_build_options[@]" \ - build_cmds \ @@ -303,7 +301,7 @@ _cmake_on_install() { if [[ "$in_build" == false || "$difference" -eq 1 ]] ; then # either there is no --install or completing the directory after --install - _arguments -C -s \ + _arguments -s \ - build_opts \ "$cmake_build_options[@]" \ - build_cmds \ @@ -611,7 +609,7 @@ local -a cmake_suggest_install=( if [[ "$service" = -value-*CMAKE_GENERATOR* ]]; then _cmake_generators elif [ $CURRENT -eq 2 ] ; then - _arguments -C -s \ + _arguments -s \ - help \ "$cmake_help_actions[@]" \ - command \