Add completion for gpgconf
This commit is contained in:
parent
b8cc3b9b67
commit
c90c27f8fc
|
@ -0,0 +1,44 @@
|
|||
#compdef gpgconf
|
||||
# Description:
|
||||
# Completions for gpgconf (configuration utility provided with GnuPG
|
||||
# <https://gnupg.org>)
|
||||
#
|
||||
# Authors:
|
||||
# * "score" <seejay.11@gmail.com> https://keybase.io/score_under
|
||||
|
||||
_gpgconf_component() {
|
||||
local values=(
|
||||
"${(@f)$(gpgconf --list-components \
|
||||
| perl -lne 'my ($name, $desc, $x) = split /:/; print "${name}[$desc]"')}"
|
||||
)
|
||||
if [ "${action[2]}" = all ]; then
|
||||
values+=('all[All daemon components]')
|
||||
fi
|
||||
|
||||
_values 'component' "${(o)values[@]}"
|
||||
}
|
||||
|
||||
_arguments \
|
||||
'--help[print help text]' \
|
||||
'--list-components[list all components]' \
|
||||
'--check-programs[check all programs]' \
|
||||
'--apply-defaults[apply global default values]' \
|
||||
'--list-dirs[get the configuration directories for gpgconf]' \
|
||||
'--list-config[list global configuration file]' \
|
||||
'--check-config[check global configuration file]' \
|
||||
'--query-swdb[query the software version database]' \
|
||||
'--reload[reload all or a given component]:component:_gpgconf_component all' \
|
||||
'--launch[launch a given component]:component:_gpgconf_component all' \
|
||||
'--kill[kill a given component]:component:_gpgconf_component all' \
|
||||
'--create-socketdir[create a directory for sockets below /run/user or /var/run/user]' \
|
||||
'--remove-socketdir[remove a directory created with command --create-socketdir]' \
|
||||
'--list-options[list options]:component:_gpgconf_component' \
|
||||
'--change-options[change options]:component:_gpgconf_component' \
|
||||
'--check-options[check options]:component:_gpgconf_component' \
|
||||
'--apply-profile[update configuration files using the specified file]:configuration file:_path_files' \
|
||||
'--status-fd[write status info to the specified file descriptor]:file descriptor' \
|
||||
'(-o --output)'{-o,--output}'[write output to the specified file]:output file:_path_files' \
|
||||
'(-v --verbose)'{-v,--verbose}'[verbose]' \
|
||||
'(-q --quiet)'{-q,--quiet}'[quiet]' \
|
||||
'(-n --dry-run)'{-n,--dry-run}'[do not make any changes]' \
|
||||
'(-r --runtime)'{-r,--runtime}'[activate changes at runtime, if possible]'
|
Loading…
Reference in New Issue