update 'cache' command completion

This commit is contained in:
Shohei YOSHIDA 2026-06-23 17:44:46 +09:00
parent 555fdbe3bc
commit ecc9750480
No known key found for this signature in database
GPG Key ID: C9A1BB11BB940CF2
1 changed files with 53 additions and 7 deletions

View File

@ -175,39 +175,85 @@ _conan_commands() {
(( $+functions[_conan_cache] )) || (( $+functions[_conan_cache] )) ||
_conan_cache() { _conan_cache() {
local ret=1 local curcontext=$curcontext state state_descr line ret=1
typeset -A opt_args
_arguments -C \ _arguments -C \
'(- *)'{-h,--help}'[show help message and exit]' \ $_conan_common_options[@] \
'1: :(clean path)' \ '1:subcommand:->subcommand' \
'*:: :->args' '*:: :->args' \
&& ret=0
case $state in case $state in
(subcommand)
local -a commands=(
'backup-upload:upload all the source backups present in the cache'
'check-integrity:check the integrity of the local cache for the given references'
'clean:remove non-critical folders from the cache'
'path:show the path to the Conan cache for a given reference'
'ref:show the reference for a given Conan cache folder'
'restore:put the artifacts from an archive into the cache'
'save:get the artifacts from a package list and archive them'
'sign:sign packages with the Package Signing Plugin'
'verify:check the signature of packages with the Package Signing Plugin'
)
_describe -t 'commands' "command" commands && ret=0
;;
(args) (args)
local -a opts=($_conan_common_options[@]) local -a opts=($_conan_common_options[@])
case $words[1] in case $words[1] in
(check-integrity|sign|verify)
opts+=(
'(-f --format)'{-f,--format}'[select the output format]:format:(json)'
'(-l --list)'{-l,--list}'[package list of packages to check integrity for]:list'
\*{-p,--package-query}'[only the packages matching a specific query]:query'
'1:pattern'
)
;;
(clean) (clean)
opts+=( opts+=(
'(-l --list)'{-l,--list}'[package list of packages to clean]:list'
'(-s --source)'{-s,--source}'[clean source folders]' '(-s --source)'{-s,--source}'[clean source folders]'
'(-b --build)'{-b,--build}'[clean build folders]' '(-b --build)'{-b,--build}'[clean build folders]'
'(-d --download)'{-d,--download}'[clean download folders]' '(-d --download)'{-d,--download}'[clean download folders]'
'(-t --temp)'{-t,--temp}'[clean temporary folders]'
'(-bs --backup-sources)'{-bs,--backup-sources}'[clean backup sources]'
\*{-p,--package-query}'[remove only the packages matching a specific query]:query' \*{-p,--package-query}'[remove only the packages matching a specific query]:query'
'1:pattern' '1:pattern'
) )
;; ;;
(path) (path)
opts+=( opts+=(
'--folder[path to show]::type:(export_source source build)' \ '--folder[path to show]::type:(export_source source build metadata)' \
'1:recipe_or_package_reference:_files' '1:recipe_or_package_reference:_files'
) )
;; ;;
(ref)
opts+=(
'1:folder:_files -/'
)
;;
(restore)
opts+=(
'1:path:_files'
)
;;
(save)
opts+=(
'(-f --format)'{-f,--format}'[select the output format]:format:(json)'
'(-l --list)'{-l,--list}'[package list of packages to check integrity for]:list'
'--file[save to this file]:file:_files -g "*.(tgz|txz|tzst)"'
'--no-source[exclude the sources]'
'1:pattern'
)
;;
esac esac
_arguments "$opts[@]" _arguments "$opts[@]" && ret=0
;; ;;
esac esac
return $ret return ret
} }
(( $+functions[_conan_config] )) || (( $+functions[_conan_config] )) ||