Exheredludis/zsh-completion/_cave
Bo Ørsted Andresen 87acce58e7 Add all options for --change-phases-for to zsh completions.
Change-Id: I4767ae461c14d3d10363c8c518da9cbcb8044448
2016-10-04 16:40:50 +02:00

940 lines
49 KiB
Bash

#compdef cave
# vim: set et sw=2 sts=2 ts=2 ft=zsh :
# ZSH completion for `cave`
# Written by Ingmar Vanhassel <ingmar@exherbo.org>
# Updated by Bo Ørsted Andresen <zlin@exherbo.org>
_cave()
{
local -a _cave_arguments _cave_commands
local cmd
_cave_arguments=(
'(-E --environment)'{-E,--environment}'[Environment specification]:environment specification: '
'(--log-level -L)'{--log-level,-L}'[Specify the log level]:log level:((debug\:"Show debug output (noisy)"
d\:"Show debug output (noisy)"
qa\:"Show QA messages and warnings only (default)"
q\:"Show QA messages and warnings only (default)"
warning\:"Show warnings only"
w\:"Show warnings only"
silent\:"Suppress all log messages (UNSAFE)"
s\:"Suppress all log messages (UNSAFE)"))'
'(--colour -c)'{--colour,-c}'[Specify whether to use colour]:When:((auto a yes y no n))'
'(--help -h)'{--help,-h}'[Display help messsage]'
'(-v --version)'{-v,--version}'[Display version information]'
)
_cave_commands=(
'config:Perform post-install configuration on a package'
'contents:Display the contents of a package ID'
'digest:Generates a digest file for a particular package in a particular repository'
"display-resolution:Displays a dependency resolution created using \'cave resolve\'"
'dump-cave-formats-conf:Output a ~/.cave/formats.conf'
'executables:Display executables belonging to an ID'
"execute-resolution:Executes a dependency resolution created using \'cave resolve\'"
'find-candidates:Find a list of candidate packages for a search'
'fix-cache:Fix on-disk caches'
'fix-linkage:Identify packages with broken linkage that can be fixed by rebuilds'
'generate-metadata:Pregenerate metadata for a set of IDs'
"graph-jobs:Creates a Graphviz graph for jobs in a resolution created using \'cave resolve\'"
'has-version:Returns success if there is an installed package matching a particular spec'
'help:Display help information'
'import:Import a package from a directory containing its image'
'info:Display a summary of configuration and package information'
'manage-search-index:Manages a search index for use by cave search'
'match:Determine whether a particular package version has certain properties'
'mirror:Fetches files for a set of IDs'
'owner:Shows package IDs owning a given file'
'perform:Perform an action upon a package'
'print-best-version:Prints the best installed version matching a particular spec'
'print-categories:Prints a list of known categories'
'print-checksum:prints cryptographic checksums'
'print-checksum-algorithms:prints supported cryptographic checksum algorithms'
'print-commands:Prints a list of known cave commands'
'print-dependent-ids:Prints a list of installed IDs that are dependent upon another installed ID'
'print-environment-metadata:Prints environment metadata'
'print-id-actions:Prints ID actions'
'print-id-contents:Prints the contents of a package ID'
'print-id-environment-variable:Prints ID environment variables'
'print-id-executables:Prints a list of executables belonging to an ID'
'print-id-masks:Prints ID masks'
'print-id-metadata:Prints ID metadata'
'print-id-size:Prints the size of files installed by a package, in a parsable format'
'print-ids:Prints a list of known IDs'
'print-owners:Prints a list of package IDs owning a given file'
'print-packages:Prints a list of package names'
'print-repositories:Prints a list of repositories'
'print-repository-formats:Prints a list of available repository formats'
'print-repository-metadata:Prints repository metadata'
'print-set:Prints a list of known sets'
'print-sets:Prints a list of sets'
'print-spec:Prints a dependency specification'
'print-sync-protocols:Prints a list of sync protocols'
'print-unmanaged-files:Prints unmanaged files'
'print-unused-distfiles:Prints all unused distfiles'
'purge:Uninstall unused packages'
'report:Display a summary of potential problems with installed packages'
'resolve:Display how to resolve one or more targets, and possibly then perform that resolution'
"resume:Resume a failed resolution from \'cave resolve\'"
'search:Search for packages with particular characteristics'
'show:Display a summary of a given object'
'size:Prints the size of files installed by a package'
'sync:Sync all or specified repositories'
'sync-protocol-options:Displays options for a given sync protocol'
'uninstall:Uninstall one or more packages'
'update-world:Updates the world set'
"verify:Verify that an installed package\'s files haven\'t changed"
)
for (( i=1; i <= ${CURRENT}; i++ )); do
cmd=${_cave_commands[(r)${words[${i}]}:*]%%:*}
(( ${#cmd} )) && break
done
if (( ${#cmd} )); then
local curcontext="${curcontext%:*:*}:cave-${cmd}:"
while [[ ${words[1]} != ${cmd} ]]; do
(( CURRENT-- ))
shift words
done
_call_function ret _cave_cmd_${cmd}
return ret
else
if [[ ${words[CURRENT-1]} == --* ]]; then
_arguments -s : \
${_cave_arguments}
else
_describe -t commands 'cave command' _cave_commands
_arguments -s : \
${_cave_arguments}
fi
fi
}
(( ${+functions[_cave_cmd_config]} )) ||
_cave_cmd_config()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_contents]} )) ||
_cave_cmd_contents()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_digest]} )) ||
_cave_digest()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
':package depspec:_cave_packages' \
':repository:_cave_repositories' && return 0
}
(( ${+functions[_cave_cmd_display-resolution]} )) ||
_cave_cmd_display-resolution()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'--show-option-descriptions[Whether to display descriptions for package options]:Which:((none new changed all))' \
'--show-descriptions[Whether to display package descriptions]:When:((none new all))' \
'(--explain -X)'{--explain,-X}'[Explain why the resolver made a particular decision]:Spec: ' \
'--unpackaged-repository-params[Specifies the parameters used to construct an unpackaged repository]'
}
(( ${+functions[_cave_cmd_dump-cave-formats-conf]} )) ||
_cave_cmd_dump-cave-formats-conf()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]'
}
(( ${+functions[_cave_cmd_executables]} )) ||
_cave_cmd_executables()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_execute-resolution]} )) ||
_cave_cmd_execute-resolution()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'--pretend[Only carry out the pretend action]' \
'--set[Our target is a set rather than package specs]' \
'--world-specs[Use the specified spec or set name for updating world]' \
'--removed-if-dependent-names[If nothing is left with the specified name, also remove it from world]' \
'(--preserve-world -1 --no-preserve-world +1)'{--preserve-world,-1,--no-preserve-world,+1}'[Do not modify the world set]' \
'(--continue-on-failure -C)'{--continue-on-failure,-C}'[Whether to continue after an error occurs]:When:((never n if-satisfied s if-independent i always a))' \
'--resume-file[Write resume information to the specified file]:file:_files' \
'(--fetch -f --no-fetch +f)'{--fetch,-f,--no-fetch,+f}'[Skip any jobs that are not fetch jobs]' \
'(--fetch-jobs -J)'{--fetch-jobs,-J}'[The number of parallel fetch jobs to launch]' \
'*--skip-phase[Skip the named phases]:Phase:((fetch_extra killold init setup unpack prepare configure compile test test_expensive install strip preinst merge prerm postrm postinst tidyup))' \
'*--abort-at-phase[Abort when a named phase is encountered]:Phase:((fetch_extra killold init setup unpack prepare configure compile test test_expensive install strip preinst merge prerm postrm postinst tidyup))' \
'*--skip-until-phase[Skip every phase until a named phase is encountered]:Phase:((fetch_extra killold init setup unpack prepare configure compile test test_expensive install strip preinst merge prerm postrm postinst tidyup))' \
'*--change-phases-for[Control to which packages these phase options apply]:Which:((all first !first last !last targets !targets))' \
'--display-resolution-program[The program used to display the resolution]:Command: ' \
'--graph-jobs-resolution-program[The program used to graph jobs]:Command: ' \
'--execute-resolution-program[The program used to execute the resolution]:Command: ' \
'--perform-program[The program used to perform actions]:Command: ' \
'--update-world-program[The program used to perform world updates]:Command: ' \
'--graph-program[The program used to create Graphviz graphs]:Command: ' \
'--unpackaged-repository-params[Specifies the parameters used to construct an unpackaged repository]'
}
(( ${+functions[_cave_cmd_generate-metadata]} )) ||
_cave_cmd_generate-metadata()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--matching -m)'{--matching,-m}'[Consider only IDs matching this spec]'
}
_cave_match_arguments=(
'(--help -h)'{--help,-h}'[Display help messsage]'
'(--type -t)'{--type,-t}'[Specify which matching algorithm to use]:Matching:((text t exact x regex r))'
'(--case-sensitive -C --no-case-sensitive +C)'{--case-sensitive,-C,--no-case-sensitive,+C}'[Make matching case sensitive]'
'(--and -& --no-and +&)'{--and,-\&,--no-and,+\&}'[If multiple patterns are specified, require that all patterns match]'
'(--not -! --no-not +!)'{--not,-\!,--no-not,+\!}'[Invert the results of pattern matches]'
'*'{--key,-k}'[Search the named metadata key]'
'(--name -n --no-name +n)'{--name,-n,--no-name,+n}'[Search package names]'
'(--description -d --no-description +d)'{--description,-d,--no-description,+d}'[Search package descriptions]'
'(--enabled-only -e --no-enabled-only +e)'{--enabled-only,-e,--no-enabled-only,+e}'[Only search enabled parts of conditional dependency spec trees]'
)
(( ${+functions[_cave_cmd_find-candidates]} )) ||
_cave_cmd_find-candidates()
{
_arguments -s : \
${_cave_match_arguments[@]} \
'(--all-versions -a --no-all-versions +a)'{--all-versions,-a,--no-all-versions,+a}'[Search in every version of packages]' \
'(--visible -v --no-visible +v)'{--visible,-v,--no-visible,+v}'[Search only in visible (not masked) versions of packages]' \
'--matching[Search only in packages matching the supplied specification]:Spec: ' \
'--index[Use the specified index file]:file:_files'
}
(( ${+functions[_cave_cmd_fix-cache]} )) ||
_cave_cmd_fix-cache()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'*'{--repository,-r}'[Select the repository with the specified name]:repository name:_cave_repositories' \
'(--installable -i --no-installable +i)'{--installable,-i,--no-installable,+i}'[Select all installable repositories]' \
'(--installed -I --no-installed +I)'{--installed,-I,--no-installed,+I}'[Select all installed repositories]'
}
(( ${+functions[_cave_cmd_fix-linkage]} )) ||
_cave_cmd_fix-linkage()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--execute -x --no-execute +x)'{--execute,-x,--no-execute,+x}'[Execute the suggested actions]' \
'*'{--library,-l}'[Only rebuild packages linked against this library, even if it exists]:Library: ' \
'(--exact -e --no-exact +e)'{--exact,-e,--no-exact,+e}'[Rebuild the same package version that is currently installed]'
}
(( ${+functions[_cave_cmd_graph-jobs]} )) ||
_cave_cmd_graph-jobs()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'--graph-jobs-basename[Specify the basename (filename without extension) to be used when creating job graphs]:file:_files' \
'--graph-jobs-format[Specifies the desired output format for the Graphviz graph]:format: ' \
'(--graph-jobs-all-arrows --no-graph-jobs-all-arrows)'{--graph-jobs-all-arrows,--no-graph-jobs-all-arrows}'[Show all arrows]' \
'(--graph-jobs-full-names --no-graph-jobs-full-names)'{--graph-jobs-full-names,--no-graph-jobs-full-names}'[Show full names for graph jobs]' \
'--unpackaged-repository-params[Specifies the parameters used to construct an unpackaged repository]' \
'--display-resolution-program[The program used to display the resolution]:Command: ' \
'--graph-jobs-resolution-program[The program used to graph jobs]:Command: ' \
'--execute-resolution-program[The program used to execute the resolution]:Command: ' \
'--perform-program[The program used to perform actions]:Command: ' \
'--update-world-program[The program used to perform world updates]:Command: ' \
'--graph-program[The program used to create Graphviz graphs]:Command: '
}
(( ${+functions[_cave_cmd_has-version]} )) ||
_cave_cmd_has-version()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_help]} )) ||
_cave_cmd_help()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--all -a)'{--all,-a}'[Print all available commands to standard output]' \
'*::arg:->cave_commands' && return
case ${state} in
(cave_commands)
_describe -t commands 'cave command' _cave_commands
;;
esac
}
(( ${+functions[_cave_cmd_import]} )) ||
_cave_cmd_import()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--execute -x --no-execute +x)'{--execute,-x,--no-execute,+x}'[Execute the suggested actions]' \
'(--location -l)'{--location,-l}'[Specify the directory containing the image to install]' \
'(--install-under -u)'{--install-under,-u}'[Install under the specified directory, rather than /]' \
'(--rewrite-ids-over-to-root -r)'{--rewrite-ids-over-to-root,-r}'[Change any UID or GID over this value to 0]' \
'(--strip -s)'{--strip,-s}'[Specify whether to strip and split objects being installed]:When:((config c always a never n))' \
'(--preserve-work -p)'{--preserve-work,-p}'[Specify whether to avoid carrying out destructive merge actions]:When:((config c always a never n))' \
'(--description -D)'{--description,-D}'[Specify a description for the package]:Description: ' \
'*'{--build-dependency,-B}'[Specify a build dependency]:Package: ' \
'*'{--run-dependency,-R}'[Specify a run dependency]:Package: ' \
'(--preserve-metadata -P --no-preserve-metadata +P)'{--preserve-metadata,-P,--no-preserve-metadata,+P}'[If replacing a package previously installed using this command, copy its description and dependencies]'
}
(( ${+functions[_cave_cmd_info]} )) ||
_cave_cmd_info()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'*::arg:->cave_commands' && return
}
(( ${+functions[_cave_cmd_manage-search-index]} )) ||
_cave_cmd_manage-search-index()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--create -c --no-create +c)'{--create,-c,--no-create,+c}'[Create a new search index. The existing search index is removed if it already exists]:file:_files'
}
(( ${+functions[_cave_cmd_match]} )) ||
_cave_cmd_match()
{
_arguments -s : \
${_cave_match_arguments[@]}
}
(( ${+functions[_cave_cmd_mirror]} )) ||
_cave_cmd_mirror()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--matching -m)'{--matching,-m}'[Consider only IDs matching this spec]'
}
(( ${+functions[_cave_cmd_owner]} )) ||
_cave_cmd_owner()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--type -t)'{--type,-t}'[Which type of match algorithm to use]:match algorithm:((auto\:"If pattern starts with a \/, full; if it contains a \/, partial; otherwise, basename"
a\:"If pattern starts with a \/, full; if it contains a \/, partial; otherwise, basename"
basename\:"Basename match"
b\:"Basename match"
full\:"Full match"
f\:"Full match"
partial\:"Partial match"
p\:"Partial match"))' \
'(--dereference -d --no-dereference +d)'{--dereference,-d,--no-dereference,+d}'[If the pattern is a path that exists and is a symbolic link, dereference it recursively, and then search for the real path]' \
'*'{--matching,-m}'[Show only IDs matching this spec]:package spec: ' \
'*:file:_files'
}
(( ${+functions[_cave_cmd_perform]} )) ||
_cave_cmd_perform()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--if-supported --no-if-supported)'{--if-supported,--no-if-supported}'[If the action is not supported, exit silently with success rather than erroring]' \
'(--hooks --no-hooks)'{--hooks,--no-hooks}'[Also execute the appropriate hooks for the action]' \
'--x-of-y[Specify the value of the X_OF_Y variable that is passed to hooks]:value: ' \
'--no-terminal-titles[Do not change terminal titles]' \
'--managed-output[Specify that our output is being managed by another process]' \
'--output-exclusivity[Specify the exclusivity of our output]:Exclusitivity:((exclusive with-others background))' \
':subcommand:->subcommand' \
'*::options:->options' && ret=0
case ${state} in
(subcommand)
declare -a subcommand
subcommand=(
'config'
'fetch'
'info'
'install'
'pretend'
'pretend-fetch'
'uninstall'
)
_describe -t subcommand command subcommand && ret=0
;;
(options)
declare -a arguments
case ${line[1]} in
config|info)
_arguments -s : \
'*:package depspec:_cave_packages' && ret=0
;;
fetch|pretend-fetch)
_arguments -s : \
'(--exclude-unmirrorable --no-exclude-unmirrorable)'{--exclude-unmirrorable,--no-exclude-unmirrorable}'[Do not include unmirrorable components]' \
'(--fetch-unneeded --no-fetch-unneeded)'{--fetch-unneeded,--no-fetch-unneeded}'[Also fetch components that aren'\''t needed]' \
'(--ignore-unfetched --no-ignore-unfetched)'{--ignore-unfetched,--no-ignore-unfetched}'[Do not fetch any component that has not already been downloaded]' \
'(--ignore-manual-fetch-errors --no-ignore-manual-fetch-errors)'{--ignore-manual-fetch-errors,--no-ignore-manual-fetch-errors}'[Ignore any errors that say that manual fetching is required for a component]' \
'(--regulars-only --no-regulars-only)'{--regulars-only,--no-regulars-only}'[Only fetch regular components]' \
':package depspec:_cave_packages' && ret=0
;;
install|pretend)
_arguments -s : \
'--destination[Repository to which the install should take place]:repository name:_cave_repositories' \
'*--replacing[Spec uniquely identifying the ID to be replaced as part of the install]:package spec: ' \
'*--skip-phase[Skip the named phases]:phase:((fetch_extra killold init setup unpack prepare configure compile test test_expensive install strip preinst merge prerm postrm postinst tidyup))' \
'*--abort-at-phase[Abort when a named phase is encountered]:phase:((fetch_extra killold init setup unpack prepare configure compile test test_expensive install strip preinst merge prerm postrm postinst tidyup))' \
'*--skip-until-phase[Skip every phase until a named phase is encountered]:phase:((fetch_extra killold init setup unpack prepare configure compile test test_expensive install strip preinst merge prerm postrm postinst tidyup))' \
':package depspec:_cave_packages' && ret=0
;;
uninstall)
_arguments -s : \
'*--config-protect[Specify additional items to include in the config protection list]:file:_files' \
':package depspec:_cave_packages' && ret=0
;;
esac
;;
esac
}
(( ${+functions[_cave_cmd_print-best-version]} )) ||
_cave_cmd_print-best-version()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--format -f)'{--format,-f}'[Select the output format]:Format:((full f spec s name n version v name-version V))' \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_print-categories]} )) ||
_cave_cmd_print-categories()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'*--containing[Show only categories containing this package name]:package name: ' \
'*--repository[Show only categories in this repository]:repository name:_cave_repositories'
}
(( ${+functions[_cave_cmd_print-checksum]} )) ||
_cave_cmd_print-checksum()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--file -f --stdin -s --text -t)'{--stdin,-s}'[Calculate the checksum of standard input]' \
'(--file -f --stdin -s --text -t)'{--file,-f}'[Calculate the checksum of the contents of the specified file]' \
'(--file -f --stdin -s --text -t)'{--text,-t}'[Calculate the checksum of the specified text]' \
':checksum algorithm:_cave_algorithms' && return 0
}
(( ${+functions[_cave_cmd_print-checksum-algorithms]} )) ||
_cave_cmd_print-checksum-algorithms()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]'
}
(( ${+functions[_cave_cmd_print-commands]} )) ||
_cave_cmd_print-commands()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--all -a)'{--all,-a}'[Print all available commands]'
}
(( ${+functions[_cave_cmd_print-dependent-ids]} )) ||
_cave_cmd_print-dependent-ids()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--format -f)'{--format,-f}'[Select the output format]:output format: '
}
(( ${+functions[_cave_cmd_print-environment-metadata]} )) ||
_cave_cmd_print-environment-metadata()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'*--raw-name[Show only keys with this raw name]:raw name: ' \
'*--human-name[Show only keys with this human name]:human name: ' \
'--format[Select the output format]:format: '
}
_cave_print_id_arguments=(
'(--all -a --no-all +a)'{--all,-a,--no-all,+a}'[If the spec matches multiple IDs, display all matches]'
'(--best -b --no-best +b)'{--best,-b,--no-best,+b}'[If the spec matches multiple IDs, select the best ID rather than giving an error]'
)
(( ${+functions[_cave_cmd_print-id-actions]} )) ||
_cave_cmd_print-id-actions()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
${_cave_print_id_arguments[@]} \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_print-id-contents]} )) ||
_cave_cmd_print-id-contents()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
${_cave_print_id_arguments[@]} \
'--format[Select the output format]:format: ' \
'*'{--type,-t}'[Display only entries of the specified type]:contents type:((all\:"Show all entries"
a\:"Show all entries"
file\:"Show only file entries"
f\:"Show only file entries"
dir\:"Show only directory entries"
d\:"Show only directory entries"
sym\:"Show only symlink entries"
s\:"Show only symlink entries"
other\:"Show only other entries"
o\:"Show only other entries"))' \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_print-id-environment-variable]} )) ||
_cave_cmd_print-id-environment-variable()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
${_cave_print_id_arguments[@]} \
'*--variable-name[Show this environment variable]:environment variable: ' \
'--format[Select the output format]:format: ' \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_print-id-executables]} )) ||
_cave_cmd_print-id-executables()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
${_cave_print_id_arguments[@]} \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_print-id-masks]} )) ||
_cave_cmd_print-id-masks()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
${_cave_print_id_arguments[@]} \
'(--overridden --no-overridden)'{--overridden,--no-overridden}'[Show overridden masks]' \
'(--no-active --no-no-active)'{--no-active,--no-no-active}'[No not show active (non-overridden) masks]' \
'--format[Select the output format]:format: ' \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_print-id-metadata]} )) ||
_cave_cmd_print-id-metadata()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
${_cave_print_id_arguments[@]} \
'*--raw-name[Show only keys with this raw name]:raw name: ' \
'*--human-name[Show only keys with this human name]:human name: ' \
'--format[Select the output format]:output format: ' \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_print-id-size]} )) ||
_cave_cmd_print-id-size()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
${_cave_print_id_arguments[@]} \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_print-ids]} )) ||
_cave_cmd_print-ids()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'*'{--matching,-m}'[Show only IDs matching this spec]:package spec: ' \
'*'{--supporting,-s}'[Show only IDs supporting this action]:supporting action:((install uninstall pretend config fetch pretend-fetch info))' \
'(--with-mask -M)'{--with-mask,-M}'[Show only IDs with this kind of mask]:with mask:((none any user unaccepted repository unsupported))' \
'(--format -f)'{--format,-f}'[Select the output format]:output format: '
}
(( ${+functions[_cave_cmd_print-owners]} )) ||
_cave_cmd_print-owners()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--type -t)'{--type,-t}'[Which type of match algorithm to use]:match algorithm:((auto\:"If pattern starts with a \/, full; if it contains a \/, partial; otherwise, basename"
basename\:"Basename match"
full\:"Full match"
partial\:"Partial match"))' \
'*'{--matching,-m}'[Show only IDs matching this spec]:package spec: ' \
'(--format -f)'{--format,-f}'[Select the output format]:output format: ' \
'*:file:_files'
}
(( ${+functions[_cave_cmd_print-packages]} )) ||
_cave_cmd_print-packages()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'*'{--repository,-r}'[Show only names in the specified repository]:repository name:_cave_repositories' \
'*'{--category,-c}'[Show only names in the specified category]:category name:_cave_categories'
}
(( ${+functions[_cave_cmd_print-repositories]} )) ||
_cave_cmd_print-repositories()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'--format[Show only repositories of a specific format]:repository format:_cave_repository_formats'
}
(( ${+functions[_cave_cmd_print-repository-formats]} )) ||
_cave_cmd_print-repository-formats()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]'
}
(( ${+functions[_cave_cmd_print-repository-metadata]} )) ||
_cave_cmd_print-repository-metadata()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'*--raw-name[Show only keys with this raw name]:raw name: ' \
'*--human-name[Show only keys with this human name]:human name: ' \
'--format[Select the output format]:format: ' \
':repository:_cave_repositories' && return 0
}
(( ${+functions[_cave_cmd_print-set]} )) ||
_cave_cmd_print-set()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--expand -x --no-expand +x)'{--expand,-x,--no-expand,+x}'[Expand set contents recursively]'
}
(( ${+functions[_cave_cmd_print-sets]} )) ||
_cave_cmd_print-sets()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]'
}
(( ${+functions[_cave_cmd_print-spec]} )) ||
_cave_cmd_print-spec()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'--package[Specify the cat/pkg requirement]:category-package name: ' \
'--slot[Specify the slot requirement]:slot: ' \
'--in-repository[Specify the in-repository requirement]:repository:_cave_repositories' \
'--from-repository[Specify the from-repository requirement]:repository:_cave_repositories' \
'--installable-to-repository[Specify the installable-to-repository requirement]:repository:_cave_repositories' \
'--installed-at-path[Specify the installed-at-path requirement]:dir:_files' \
'--installable-to-path[Specify the installable-to-path requirement]:dir:_files' \
'--package-part[Specify the /pkg requirement]:package name: ' \
'--category-part[Specify the cat/ requirement]:category name: ' \
'*--version-requirement[Specify a version requirement]:version: ' \
'--version-requirements-mode[Specify the mode of version requirements]:mode:((default and or))' \
'*--additional-requirement[Specify an additional requirement]:requirement: ' \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_print-sync-protocols]} )) ||
_cave_cmd_print-sync-protocols()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]'
}
(( ${+functions[_cave_cmd_print-unmanaged-files]} )) ||
_cave_cmd_print-unmanaged-files()
{
_arguments -s : \
'(--help -h --root -r )'{--help,-h}'[Display help messsage]' \
'*'{--root,-r}'[Search under the specified root]:root:_directories' && return 0
}
(( ${+functions[_cave_cmd_print-unused-distfiles]} )) ||
_cave_cmd_print-unused-distfiles()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'*'{--include,-i}'[Treat all distfiles from IDs in the specified repository as used]:repository:_cave_repositories'
}
(( ${+functions[_cave_cmd_report]} )) ||
_cave_cmd_report()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]'
}
_cave_resolve_arguments=(
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--execute -x --no-execute +x)'{--execute,-x,--no-execute,+x}'[Execute the suggested actions]' \
'(--lazy -z --complete -c --everything -e --no-lazy +z --no-complete +c --no-everything +e)'{--lazy,-z,--no-lazy,+z}'[Do as little work as possible]' \
'(--lazy -z --complete -c --everything -e --no-lazy +z --no-complete +c --no-everything +e)'{--complete,-c,--no-complete,+c}'[Do all optional work]' \
'(--lazy -z --complete -c --everything -e --no-lazy +z --no-complete +c --no-everything +e)'{--everything,-e,--no-everything,+e}'[Do all optional work, and also reinstall]' \
'*'{--permit-uninstall,-U}'[Permit uninstallation of packages matching the supplied specification]:Spec: ' \
'*'{--permit-downgrade,-d}'[Permit downgrades matching the supplied specification]:Spec: ' \
'*'{--permit-old-version,-o}'[Permit installs of versions matching the supplied specification even if those versions are worse than the best visible version in the slot]:Spec: ' \
'*'{--purge,-P}'[Purge packages matching the given specification, if they will no longer be used after a resolution]:Spec: ' \
'(--no-override-masks --no-no-override-masks)'{--no-override-masks,--no-no-override-masks}'[If otherwise unable to make a decision, unless this option is specified the resolver will try packages that are weakly masked too]' \
'(--no-override-flags --no-no-override-flags)'{--no-override-flags,--no-no-override-flags}'[If otherwise unable to make a decision, unless this option is specified the resolver will try selecting packages using different options to the ones specified in the user'\''s configuration]' \
'*--no-restarts-for[Do not restart if the problematic package has the specified package name]:Spec: ' \
'*'{--uninstalls-may-break,-u}'[Permit uninstalls that might break packages matching the specified specification]:Spec: ' \
'*'{--remove-if-dependent,-r}'[Remove dependent packages that might be broken by other changes if those packages match the specified specification]:Spec: ' \
'*'{--less-restrictive-remove-blockers,-l}'[Use less restrictive blockers for packages matching the supplied specification if that package is to be removed by --remove-if-dependent]:Spec: ' \
'*'{--reinstall-dependents-of,-D}'[Force any installed package that is dependent upon any installed package matching the supplied spec to be reinstalled]:Spec: ' \
'(--keep-targets -K)'{--keep-targets,-K}'[Select whether to keep target packages]:When:((auto a never n if-transient t if-same-metadata m if-same s if-same-version v if-possible p))' \
'(--keep -k)'{--keep,-k}'[Select whether to keep installed packages that are not targets]:When:((never n if-transient t if-same-metadata m if-same s if-same-version v if-possible p))' \
'(--reinstall-scm -R)'{--reinstall-scm,-R}'[Select whether to reinstall SCM packages that would otherwise be kept]:When:((always a daily d weekly w never n))' \
'*'{--with,-w}'[Never keep installed packages with the supplied package name]:Spec: ' \
'*'{--without,-W}'[Keep installed packages with the supplied package name if possible]:Spec: ' \
'(--target-slots -S)'{--target-slots,-S}'[Which slots to consider for targets]:Which:((best-or-installed x installed-or-best i all a best b))' \
'(--slots -s)'{--slots,-s}'[Which slots to consider for packages that are not targets]:Which:((best-or-installed x installed-or-best i all a best b))' \
'(--follow-installed-build-dependencies -B --no-follow-installed-build-dependencies +B)'{--follow-installed-build-dependencies,-B,--no-follow-installed-build-dependencies,+B}'[Follow build dependencies for installed packages]' \
'(--no-follow-installed-dependencies -n --no-no-follow-installed-dependencies +n)'{--no-follow-installed-dependencies,-n,--no-no-follow-installed-dependencies,+n}'[Ignore dependencies for installed packages]' \
'*'{--no-dependencies-from,-0}'[Ignore dependencies (not blockers) from packages matching the supplied specification]:Spec: ' \
'*'{--no-blockers-from,-!}'[Ignore blockers from packages matching the supplied specification]:Spec: ' \
'--suggestions[How to treat suggestions and recommendations]:When:((ignore display take))' \
'--recommendations[How to treat recommendations]:When:((ignore display take))' \
'*'{--take,-t}'[Take any suggestion matching the supplied package specification or group name]:Spec: ' \
'*'{--take-from,-T}'[Take all suggestions made by any package matching the supplied package specification]:Spec: ' \
'*'{--ignore,-i}'[Discard any suggestion matching the supplied package specification or group name]:Spec: ' \
'*'{--ignore-from,-I}'[Discard all suggestions made by any package matching the supplied package specification]:Spec: ' \
'*'{--favour,-F}'[If there is a choice, favour the specified package names]:Spec: ' \
'*'{--avoid,-A}'[If there is a choice, avoid the specified package names]:Spec: ' \
'*'{--preset,-p}'[Preset a given constraint]:Spec: ' \
'*'{--hide,-H}'[When selecting origin ID candidates, pretend that any ID matching the specified spec does not exist]:Spec: ' \
'*'{--not-usable,-N}'[Consider installed packages matching the supplied specification as being unusable when breaking dependency cycles]' \
'*'{--early,-E}'[When given a collection of otherwise equally desirable packages to order, order packages matching the supplied spec first]' \
'*'{--late,-L}'[When given a collection of otherwise equally desirable packages to order, order packages matching the supplied spec last]' \
'(--make -m)'{--make,-m}'[Specify what to do with targets]:Make:((auto a install i binaries b chroot c cross-compile x))' \
'(--make-dependencies -M)'{--make-dependencies,-M}'[Specify what to do with dependencies of targets]:When:((auto runtime r all a none n))' \
'*'{--via-binary,-b}'[When building a package matching the supplied spec, create a binary package and use that for the install]' \
'(--dependencies-to-slash -/)'{--dependencies-to-slash,-/}'[Specify what to do with dependencies for the / filesystem when not working on /]:When:((all a runtime r build b none n))' \
'*'{--chroot-path,-2}'[When making a chroot, only consider destination repositories whose root is this value]:Root:'
'*'{--cross-host,-4}'[Specify which cross host to use]:Host:' \
'--one-binary-per-slot[When building a binary package, remove other versions in the same repository and slot]' \
'--ignore-unable-decisions[Ignore any resolvent for which we were unable to make a decision. Specifying this will break your system]' \
'--ignore-unorderable-jobs[Ignore any job we were unable to order. Specifying this will break your system]' \
'(--dump --no-dump)'{--dump,--no-dump}'[Dump debug output]' \
'(--dump-restarts --no-dump-restarts)'{--dump-restarts,--no-dump-restarts}'[Dump restarts]' \
'(--preserve-world -1 --no-preserve-world +1)'{--preserve-world,-1,--no-preserve-world,+1}'[Do not modify the world set]' \
'(--continue-on-failure -C)'{--continue-on-failure,-C}'[Whether to continue after an error occurs]:When:((never n if-satisfied s if-independent i always a))' \
'--resume-file[Write resume information to the specified file]:file:_files' \
'(--fetch -f --no-fetch +f)'{--fetch,-f,--no-fetch,+f}'[Skip any jobs that are not fetch jobs]' \
'(--fetch-jobs -J)'{--fetch-jobs,-J}'[The number of parallel fetch jobs to launch]' \
'*--skip-phase[Skip the named phases]:Phase:((fetch_extra killold init setup unpack prepare configure compile test test_expensive install strip preinst merge prerm postrm postinst tidyup))' \
'*--abort-at-phase[Abort when a named phase is encountered]:Phase:((fetch_extra killold init setup unpack prepare configure compile test test_expensive install strip preinst merge prerm postrm postinst tidyup))' \
'*--skip-until-phase[Skip every phase until a named phase is encountered]:Phase:((fetch_extra killold init setup unpack prepare configure compile test test_expensive install strip preinst merge prerm postrm postinst tidyup))' \
'*--change-phases-for[Control to which packages these phase options apply]:Which:((all first !first last !last targets !targets))' \
'--show-option-descriptions[Whether to display descriptions for package options]:Which:((none new changed all))' \
'--show-descriptions[Whether to display package descriptions]:When:((none new all))' \
'(--explain -X)'{--explain,-X}'[Explain why the resolver made a particular decision]:Spec: ' \
'--graph-jobs-basename[Specify the basename (filename without extension) to be used when creating job graphs]:file:_files' \
'--graph-jobs-format[Specifies the desired output format for the Graphviz graph]:format: ' \
'(--graph-jobs-all-arrows --no-graph-jobs-all-arrows)'{--graph-jobs-all-arrows,--no-graph-jobs-all-arrows}'[Show all arrows]' \
'(--graph-jobs-full-names --no-graph-jobs-full-names)'{--graph-jobs-full-names,--no-graph-jobs-full-names}'[Show full names for graph jobs]' \
'--display-resolution-program[The program used to display the resolution]:Command: ' \
'--graph-jobs-resolution-program[The program used to graph jobs]:Command: ' \
'--execute-resolution-program[The program used to execute the resolution]:Command: ' \
'--perform-program[The program used to perform actions]:Command: ' \
'--update-world-program[The program used to perform world updates]:Command: ' \
'--graph-program[The program used to create Graphviz graphs]:Command: '
)
(( ${+functions[_cave_cmd_purge]} )) ||
_cave_cmd_purge()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
${_cave_resolve_arguments[@]}
}
(( ${+functions[_cave_cmd_resolve]} )) ||
_cave_cmd_resolve()
{
_arguments -s : \
${_cave_resolve_arguments[@]} \
'*:package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_resume]} )) ||
_cave_cmd_resume()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--retry-failed -r --no-retry-failed +r)'{--retry-failed,-r,--no-retry-failed,+r}'[Retry any job that has already failed]' \
'(--retry-skipped -R --no-retry-skipped +R)'{--retry-skipped,-R,--no-retry-skipped,+R}'[Retry any job that has already been skipped]' \
'(--skip-failed -s --no-skip-failed +s)'{--skip-failed,-s,--no-skip-failed,+s}'[Skip any job that has already failed]' \
'(--continue-on-failure -C)'{--continue-on-failure,-C}'[Whether to continue after an error occurs]:When:((never n if-satisfied s if-independent i always a))' \
'--resume-file[Write resume information to the specified file]:file:_files' \
'(--fetch -f --no-fetch +f)'{--fetch,-f,--no-fetch,+f}'[Skip any jobs that are not fetch jobs]' \
'(--fetch-jobs -J)'{--fetch-jobs,-J}'[The number of parallel fetch jobs to launch]' \
'*--skip-phase[Skip the named phases]:Phase:((fetch_extra killold init setup unpack prepare configure compile test test_expensive install strip preinst merge prerm postrm postinst tidyup))' \
'*--abort-at-phase[Abort when a named phase is encountered]:Phase:((fetch_extra killold init setup unpack prepare configure compile test test_expensive install strip preinst merge prerm postrm postinst tidyup))' \
'*--skip-until-phase[Skip every phase until a named phase is encountered]:Phase:((fetch_extra killold init setup unpack prepare configure compile test test_expensive install strip preinst merge prerm postrm postinst tidyup))' \
'*--change-phases-for[Control to which packages these phase options apply]:Which:((all first !first last !last targets !targets))' \
'--display-resolution-program[The program used to display the resolution]:Command: ' \
'--graph-jobs-resolution-program[The program used to graph jobs]:Command: ' \
'--execute-resolution-program[The program used to execute the resolution]:Command: ' \
'--perform-program[The program used to perform actions]:Command: ' \
'--update-world-program[The program used to perform world updates]:Command: ' \
'--graph-program[The program used to create Graphviz graphs]:Command: '
}
(( ${+functions[_cave_cmd_search]} )) ||
_cave_cmd_search()
{
_arguments -s : \
${_cave_match_arguments[@]} \
'(--all-versions -a --no-all-versions +a)'{--all-versions,-a,--no-all-versions,+a}'[Search in every version of packages]' \
'(--visible -v --no-visible +v)'{--visible,-v,--no-visible,+v}'[Search only in visible (not masked) versions of packages]' \
'--matching[Search only in packages matching the supplied specification]:Spec: ' \
'--index[Use the specified index file]:file:_files'
}
(( ${+functions[_cave_cmd_show]} )) ||
_cave_cmd_show()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--type -t)'{--type,-t}'[Specify the type of the specified objects]:object type:((auto a repository r set s wildcard w package p))' \
'(--no-keys -n --no-no-keys +n)'{--no-keys,-n,--no-no-keys,+n}'[Do not show any metadata keys]' \
'(--complex-keys -c --no-complex-keys +c)'{--complex-keys,-c,--no-complex-keys,+c}'[Show complex keys]' \
'(--internal-keys -i --no-internal-keys +i)'{--internal-keys,-i,--no-internal-keys,+i}'[Show keys marked as internal-only]' \
'(--significant-keys-only -s --no-significant-keys-only +s)'{--significant-keys-only,-s,--no-significant-keys-only,+s}'[Show only keys marked as significant]' \
'*'{--key,-k}'[Show keys with the given name]' \
'(--description-keys -d --no-description-keys +d)'{--description-keys,-d,--no-description-keys,+d}'[Show description keys, regardless of other options]' \
'(--flat -f --no-flat +f)'{--flat,-f,--no-flat,+f}'[Do not spread key values over multiple lines]' \
'(--raw-names -r --no-raw-names +r)'{--raw-names,-r,--no-raw-names,+r}'[Display raw rather than human readable key names]' \
'(--one-version -1 --no-one-version +1 --all-versions -a --no-all-versions +a --no-versions -0 --no-no-versions +0)'{--one-version,-1,--no-one-version,+1}'[Display only a single version of any package, rather than all installed and the best installable package]' \
'(--one-version -1 --no-one-version +1 --all-versions -a --no-all-versions +a --no-versions -0 --no-no-versions +0)'{--all-versions,-a,--no-all-versions,+a}'[Display all installed and the best installable packageversions of packages]' \
'(--one-version -1 --no-one-version +1 --all-versions -a --no-all-versions +a --no-versions -0 --no-no-versions +0)'{--no-versions,-0,--no-no-versions,+0}'[Don'\''t display any version-specific information]' \
'(--repository-at-a-time -R --no-repository-at-a-time +R)'{--repository-at-a-time,-R,--no-repository-at-a-time,+R}'[Group versions by repository, and then show details for each individual repository]' \
'*:package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_size]} )) ||
_cave_cmd_size()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
':package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_sync]} )) ||
_cave_cmd_sync()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'--sequential[Only perform one sync at a time]' \
'(--source -s)'{--source,-s}'[Use the specified source for syncing]:Source: ' \
'(--revision -r)'{--revision,-r}'[Sync to the specified revision]:Revision: ' \
'*:repository:_cave_repositories' && return 0
}
(( ${+functions[_cave_cmd_sync-protocol-options]} )) ||
_cave_cmd_sync-protocol-options()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
':sync protocol:_cave_protocols' && return 0
}
(( ${+functions[_cave_cmd_uninstall]} )) ||
_cave_cmd_uninstall()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--all-versions -a --no-all-versions +a)'{--all-versions,-a,--no-all-versions,+a}'[Search in every version of packages]' \
${_cave_resolve_arguments[@]} \
'*:package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_update-world]} )) ||
_cave_cmd_update-world()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]' \
'(--verbose --no-verbose)'{--verbose,--no-verbose}'[Produce verbose output]' \
'(--remove -r --no-remove +r)'{--remove,-r,--no-remove,+r}'[Remove the specified items]' \
'(--if-nothing-left -l --no-if-nothing-left +l)'{--if-nothing-left,-l,--no-if-nothing-left,+l}'[Skip any removes where versions remain]' \
'(--set -s --no-set +s)'{--set,-s,--no-set,+s}'[Parameters are set names, not package names]' \
'*:package depspec:_cave_packages' && return 0
}
(( ${+functions[_cave_cmd_verify]} )) ||
_cave_cmd_verify()
{
_arguments -s : \
'(--help -h)'{--help,-h}'[Display help messsage]'
}
(( ${+functions[_cave_algorithms]} )) ||
_cave_algorithms() {
local -a _cave_algorithms
_cave_algorithms=( $(cave print-checksum-algorithms) )
_describe -t algorithm 'algorithm' _cave_algorithms
}
(( ${+functions[_cave_categories]} )) ||
_cave_categories() {
local -a _cave_categories
_cave_categories=( $(cave print-categories) )
_describe -t category 'category' _cave_categories
}
(( ${+functions[_cave_packages]} )) ||
_cave_packages() {
:
}
(( ${+functions[_cave_protocols]} )) ||
_cave_protocols() {
local -a _cave_protocols
_cave_protocols=( $(cave print-sync-protocols) )
_describe -t protocol 'protocol' _cave_protocols
}
(( ${+functions[_cave_repository_formats]} )) ||
_cave_repository_formats () {
local -a _cave_repository_formats
_cave_repository_formats=( $(cave print-repository-formats) )
_describe -t format 'print-repository-format' _cave_repository_formats
}
(( ${+functions[_cave_repositories]} )) ||
_cave_repositories() {
local -a _cave_repositories
_cave_repositories=( $(cave print-repositories) )
_describe -t repository 'repository' _cave_repositories
}
_cave "${@}"