style(shell-completion): expand hard tabs and fix indentation

This commit is contained in:
Eisuke Kawashima
2025-07-14 18:48:41 +09:00
parent 2da41c4b51
commit dfe6b3fa38
26 changed files with 170 additions and 171 deletions

View File

@@ -27,7 +27,7 @@ __contains_word () {
__get_machines() {
local a b
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read a b; do echo " $a"; done; } | \
{ while read a b; do echo " $a"; done; } | \
sort -u
}

View File

@@ -27,7 +27,7 @@ __contains_word() {
__get_machines() {
local a b
{ machinectl list-images --full --no-legend --no-pager 2>/dev/null; machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read a b; do echo " $a"; done; } | \
{ while read a b; do echo " $a"; done; } | \
sort -u
}

View File

@@ -95,9 +95,9 @@ _journalctl() {
;;
--unit|-u)
if __contains_word "--user" ${COMP_WORDS[*]}; then
comps=$(journalctl -F '_SYSTEMD_USER_UNIT' 2>/dev/null)
comps=$(journalctl -F '_SYSTEMD_USER_UNIT' 2>/dev/null)
else
comps=$(journalctl -F '_SYSTEMD_UNIT' 2>/dev/null)
comps=$(journalctl -F '_SYSTEMD_UNIT' 2>/dev/null)
fi
# Similarly to systemctl, we need to distinguish between
# escaped and unescaped names in order to be able to correctly

View File

@@ -33,7 +33,7 @@ __get_all_seats () { loginctl --no-legend list-seats | { while read -r a b
__get_machines() {
local a b
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read a b; do echo " $a"; done; } | \
{ while read a b; do echo " $a"; done; } | \
sort -u
}

View File

@@ -27,7 +27,7 @@ __contains_word() {
__get_machines() {
local a b
{ machinectl list-images --full --no-legend --no-pager 2>/dev/null; machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read a b; do echo " $a"; done; } | \
{ while read a b; do echo " $a"; done; } | \
sort -u
}

View File

@@ -27,7 +27,7 @@ __contains_word () {
__get_machines() {
local a b
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read a b; do echo " $a"; done; } | \
{ while read a b; do echo " $a"; done; } | \
sort -u
}

View File

@@ -27,7 +27,7 @@ __get_slice_units () { __systemctl list-units --all -t slice \
__get_machines() {
local a b
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read a b; do echo " $a"; done; } | \
{ while read a b; do echo " $a"; done; } | \
sort -u
}

View File

@@ -29,7 +29,7 @@ __contains_word () {
__get_machines() {
local a b
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read a b; do echo " $a"; done; } | \
{ while read a b; do echo " $a"; done; } | \
sort -u
}

View File

@@ -27,7 +27,7 @@ __contains_word() {
__get_machines() {
local a b
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read a b; do echo " $a"; done; } | \
{ while read a b; do echo " $a"; done; } | \
sort -u
}

View File

@@ -27,7 +27,7 @@ __contains_word() {
__get_machines() {
local a b
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read a b; do echo " $a"; done; } | \
{ while read a b; do echo " $a"; done; } | \
sort -u
}

View File

@@ -37,7 +37,7 @@ __get_slices() {
__get_machines() {
local a b
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read a b; do echo " $a"; done; } | \
{ while read a b; do echo " $a"; done; } | \
sort -u
}

View File

@@ -48,7 +48,7 @@ __get_timer_properties () {
__get_machines() {
local a b
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read -r a b; do echo " $a"; done; } | \
{ while read -r a b; do echo " $a"; done; } | \
sort -u
}

View File

@@ -29,7 +29,7 @@ __contains_word () {
__get_machines() {
local a b
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read a b; do echo " $a"; done; } | \
{ while read a b; do echo " $a"; done; } | \
sort -u
}

View File

@@ -51,12 +51,12 @@ __get_root() {
for ((i=0; i < COMP_CWORD; i++)); do
if [[ "${COMP_WORDS[i]}" = --root=* ]]; then
echo "${COMP_WORDS[i]#--root=}"
break
echo "${COMP_WORDS[i]#--root=}"
break
fi
if (( i > 0 )) && [[ "${COMP_WORDS[i-1]}" == "--root" ]]; then
echo "${COMP_WORDS[i]}"
break
echo "${COMP_WORDS[i]}"
break
fi
done
}

View File

@@ -32,7 +32,7 @@ _bootctl_reboot-to-firmware() {
local -a _completions
_completions=( yes no )
typeset -U _completions
_describe 'possible values' _completions
_describe 'possible values' _completions
}
(( $+functions[_bootctl_commands] )) || _bootctl_commands()

View File

@@ -48,26 +48,26 @@ _journalctl_field_values() {
(( $+functions[_journalctl_boots] )) ||
_journalctl_boots() {
local -a _bootid _previousboots
_bootid=( ${(f)"$(_call_program bootid "$service -F _BOOT_ID")"} )
_previousboots=( -{1..${#_bootid}} )
_alternative : \
"offsets:boot offsets:compadd -a '_previousboots[1,-2]'" \
"bootid:boot ids:compadd -a _bootid"
local -a _bootid _previousboots
_bootid=( ${(f)"$(_call_program bootid "$service -F _BOOT_ID")"} )
_previousboots=( -{1..${#_bootid}} )
_alternative : \
"offsets:boot offsets:compadd -a '_previousboots[1,-2]'" \
"bootid:boot ids:compadd -a _bootid"
}
(( $+functions[_journalctl_facilities] )) ||
_journalctl_facilities() {
local -a _journalctl_facilities
_journalctl_facilities=(help kern user mail daemon auth syslog lpr news uucp cron authpriv ftp local0 local1 local2 local3 local4 local5 local6 local7)
_describe 'possible values' _journalctl_facilities
local -a _journalctl_facilities
_journalctl_facilities=(help kern user mail daemon auth syslog lpr news uucp cron authpriv ftp local0 local1 local2 local3 local4 local5 local6 local7)
_describe 'possible values' _journalctl_facilities
}
(( $+functions[_journalctl_namespaces] )) ||
_journalctl_namespaces() {
local -a _journalctl_namespaces
_journalctl_namespaces=( ${(f)"$(_call_program namespaces "$service --list-namespaces --output=cat" 2>/dev/null)"} )
_describe 'possible values' _journalctl_namespaces
local -a _journalctl_namespaces
_journalctl_namespaces=( ${(f)"$(_call_program namespaces "$service --list-namespaces --output=cat" 2>/dev/null)"} )
_describe 'possible values' _journalctl_namespaces
}
# Build arguments for "journalctl" to be used in completion.

View File

@@ -35,8 +35,8 @@ for fun in session-status show-session activate lock-session unlock-session term
_loginctl_$fun() {
local -a _sys_all_sessions{,_descr}
_sys_all_sessions=( "self" )
_sys_all_sessions_descr=( "self:alias for the current session" )
_sys_all_sessions=( "self" )
_sys_all_sessions_descr=( "self:alias for the current session" )
_loginctl_all_sessions
for _ignore in $words[2,-1]; do
@@ -84,8 +84,8 @@ done
_loginctl_seats() {
local -a _sys_all_seats{,_descr}
_sys_all_seats=( "self" )
_sys_all_seats_descr=( "self:alias for the current seat" )
_sys_all_seats=( "self" )
_sys_all_seats_descr=( "self:alias for the current seat" )
_loginctl_all_seats
for _ignore in $words[2,-1]; do

View File

@@ -39,36 +39,36 @@
(( $+functions[_resolvectl_commands] )) ||
_resolvectl_commands() {
local -a _resolvectl_cmds
_resolvectl_cmds=(
default-route:"Configure per-interface default-route setting"
dns:"Configure per-interface DNS configuration"
dnsovertls:"Configure per-interface dnsovertls enabled status"
dnssec:"Configure per-interface dnssec enabled status"
domain:"Configure per-interface search and route-only domains"
flush-caches:"Flushes all DNS resource record caches the service maintains locally"
llmnr:"Configure per-interface llmnr enabled status"
log-level:"Get/set logging threshold for systemd-resolved"
mdns:"Configure per-interface mdns enabled status"
monitor:"Monitor DNS queries"
nta:"Configure per-interface nta domains"
openpgp:"Retrieve openpgp keys for an email"
query:"Resolve domain names, IPv4 and IPv6 addresses"
reset-server-features:"Flushes all feature level information the resolver has learned about specific servers"
reset-statistics:"Resets the statistics counter shown in statistics to zero"
revert:"Revert the per-interfce DNS configuration"
service:"Resolve DNS-SD and SRV services"
show-cache:"Show the current cache contents"
show-server-state:"Show servers state"
statistics:"Show resolver statistics"
status:"Show the global and per-link DNS settings currently in effect"
tlsa:"Query tlsa public keys stored as TLSA resource records"
)
local -a _resolvectl_cmds
_resolvectl_cmds=(
default-route:"Configure per-interface default-route setting"
dns:"Configure per-interface DNS configuration"
dnsovertls:"Configure per-interface dnsovertls enabled status"
dnssec:"Configure per-interface dnssec enabled status"
domain:"Configure per-interface search and route-only domains"
flush-caches:"Flushes all DNS resource record caches the service maintains locally"
llmnr:"Configure per-interface llmnr enabled status"
log-level:"Get/set logging threshold for systemd-resolved"
mdns:"Configure per-interface mdns enabled status"
monitor:"Monitor DNS queries"
nta:"Configure per-interface nta domains"
openpgp:"Retrieve openpgp keys for an email"
query:"Resolve domain names, IPv4 and IPv6 addresses"
reset-server-features:"Flushes all feature level information the resolver has learned about specific servers"
reset-statistics:"Resets the statistics counter shown in statistics to zero"
revert:"Revert the per-interfce DNS configuration"
service:"Resolve DNS-SD and SRV services"
show-cache:"Show the current cache contents"
show-server-state:"Show servers state"
statistics:"Show resolver statistics"
status:"Show the global and per-link DNS settings currently in effect"
tlsa:"Query tlsa public keys stored as TLSA resource records"
)
if (( CURRENT == 1 )); then
_describe -t commands 'resolvectl commands' _resolvectl_cmds
fi
}
if (( CURRENT == 1 )); then
_describe -t commands 'resolvectl commands' _resolvectl_cmds
fi
}
_arguments \
'(- *)'{-h,--help}'[Print a short help text and exit]' \

View File

@@ -2,56 +2,56 @@
(( $+functions[_run0_unit_properties] )) ||
_run0_unit_properties() {
local -a props=(
BlockIOAccounting BlockIODeviceWeight BlockIOReadBandwidth
BlockIOWeight BlockIOWriteBandwidth CPUAccounting
CPUShares DeviceAllow DevicePolicy
Environment EnvironmentFile ExitType
FinalKillSignal Group InaccessiblePaths
KillMode KillSignal LimitAS
LimitCORE LimitCPU LimitDATA
LimitFSIZE LimitLOCKS LimitMEMLOCK
LimitMSGQUEUE LimitNICE LimitNOFILE
LimitNPROC LimitRSS LimitRTPRIO
LimitRTTIME LimitSIGPENDING LimitSTACK
MemoryAccounting MemoryLimit Nice
NoNewPrivileges OOMScoreAdjust PassEnvironment
PrivateDevices PrivateNetwork PrivateTmp
ProtectHome ProtectSystem ReadOnlyPaths
ReadWritePaths RestartKillSignal RootDirectory
RuntimeDirectory SendSIGHUP SendSIGKILL
SyslogFacility SyslogIdentifier SyslogLevel
SyslogLevelPrefix TTYPath TimerSlackNSec
User WorkingDirectory
)
_values -S= 'properties' ${^props}'::()'
local -a props=(
BlockIOAccounting BlockIODeviceWeight BlockIOReadBandwidth
BlockIOWeight BlockIOWriteBandwidth CPUAccounting
CPUShares DeviceAllow DevicePolicy
Environment EnvironmentFile ExitType
FinalKillSignal Group InaccessiblePaths
KillMode KillSignal LimitAS
LimitCORE LimitCPU LimitDATA
LimitFSIZE LimitLOCKS LimitMEMLOCK
LimitMSGQUEUE LimitNICE LimitNOFILE
LimitNPROC LimitRSS LimitRTPRIO
LimitRTTIME LimitSIGPENDING LimitSTACK
MemoryAccounting MemoryLimit Nice
NoNewPrivileges OOMScoreAdjust PassEnvironment
PrivateDevices PrivateNetwork PrivateTmp
ProtectHome ProtectSystem ReadOnlyPaths
ReadWritePaths RestartKillSignal RootDirectory
RuntimeDirectory SendSIGHUP SendSIGKILL
SyslogFacility SyslogIdentifier SyslogLevel
SyslogLevelPrefix TTYPath TimerSlackNSec
User WorkingDirectory
)
_values -S= 'properties' ${^props}'::()'
}
(( $+functions[_run0_slices] )) ||
_run0_slices() {
local -a slices=(
${(@f)"$(_call_program slice-units systemctl --no-pager --legend=no --plain list-units --all -t slice 2>/dev/null)"}
)
slices=( ${slices%% *} )
_describe -t slice-units 'slice unit' slices
local -a slices=(
${(@f)"$(_call_program slice-units systemctl --no-pager --legend=no --plain list-units --all -t slice 2>/dev/null)"}
)
slices=( ${slices%% *} )
_describe -t slice-units 'slice unit' slices
}
local -a args=(
'--no-ask-password[Do not query the user for authentication]'
'--unit=[Use this unit name instead of an automatically generated one]'
{--property=,-p+}'[Sets a property on the service unit created]:property:_run0_unit_properties'
'--description=[Provide a description for the service unit]'
'--slice=[Make the new .service unit part of the specified slice]:slice unit:_run0_slices'
'--slice-inherit[Make the new service unit part of the current slice]'
{--user=,-u+}'[Switch to the specified user]:user:_users'
{--group=,-g+}'[Switch to the specified group]:group:_groups'
'--nice=[Run with specified nice level]:nice value'
{--chdir=,-D+}'[Run within the specified working directory]:directory:_files -/'
'--setenv=[Set the specified environment variable in the session]:environment variable:_parameters -g "*export*" -S = -q'
'--background=[Change the terminal background color to the specified ANSI color]:ansi color'
'--machine=[Execute the operation on a local container]:machine:_sd_machines'
{-h,--help}'[Show the help text and exit]'
'--version[Print a short version string and exit]'
'--no-ask-password[Do not query the user for authentication]'
'--unit=[Use this unit name instead of an automatically generated one]'
{--property=,-p+}'[Sets a property on the service unit created]:property:_run0_unit_properties'
'--description=[Provide a description for the service unit]'
'--slice=[Make the new .service unit part of the specified slice]:slice unit:_run0_slices'
'--slice-inherit[Make the new service unit part of the current slice]'
{--user=,-u+}'[Switch to the specified user]:user:_users'
{--group=,-g+}'[Switch to the specified group]:group:_groups'
'--nice=[Run with specified nice level]:nice value'
{--chdir=,-D+}'[Run within the specified working directory]:directory:_files -/'
'--setenv=[Set the specified environment variable in the session]:environment variable:_parameters -g "*export*" -S = -q'
'--background=[Change the terminal background color to the specified ANSI color]:ansi color'
'--machine=[Execute the operation on a local container]:machine:_sd_machines'
{-h,--help}'[Show the help text and exit]'
'--version[Print a short version string and exit]'
)
_arguments -S $args '*:: :{_normal -p $service}'

View File

@@ -3,10 +3,9 @@
(( $+functions[__sd_machines_get_machines] )) ||
__sd_machines_get_machines () {
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read a b; do echo "$a"; done; } | \
sort -u
{ machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
{ while read a b; do echo "$a"; done; } | \
sort -u
}
local -a _machines

View File

@@ -473,9 +473,9 @@ done
(( $+functions[_systemctl_unit_properties] )) ||
_systemctl_unit_properties() {
local -a _sys_all_properties=( ${(f)"$({{LIBEXECDIR}}/systemd --no-pager --dump-bus-properties 2>/dev/null)"} )
local -a _sys_all_properties=( ${(f)"$({{LIBEXECDIR}}/systemd --no-pager --dump-bus-properties 2>/dev/null)"} )
_wanted systemd-unit-properties expl 'unit property' \
_values -s , "${_sys_all_properties[@]}"
_values -s , "${_sys_all_properties[@]}"
}
(( $+functions[_systemctl_job_modes] )) ||

View File

@@ -34,7 +34,7 @@ case "$service" in
systemd-cgtop)
_arguments \
'(-)'{-h,--help}'[Show this help]' \
'(-)--version[Print version and exit]' \
'(-)--version[Print version and exit]' \
'(-c -m -i -t)-p[Order by path]' \
'(-c -p -m -i)-t[Order by number of tasks]' \
'(-m -p -i -t)-c[Order by CPU load]' \
@@ -48,7 +48,7 @@ case "$service" in
systemd-detect-virt)
_arguments \
'(-)'{-h,--help}'[Show this help]' \
'(-)--version[Show package version]' \
'(-)--version[Show package version]' \
'(-c --container)'{-c,--container}'[Only detect whether we are run in a container]' \
'(-v --vm)'{-v,--vm}'[Only detect whether we are run in a VM]' \
'(-q --quiet)'{-q,--quiet}"[Don't output anything, just set return value]"
@@ -56,12 +56,12 @@ case "$service" in
systemd-machine-id-setup)
_arguments \
'(-)'{-h,--help}'[Show this help]' \
'(-)--version[Show package version]'
'(-)--version[Show package version]'
;;
systemd-notify)
_arguments \
'(-)'{-h,--help}'[Show this help]' \
'(-)--version[Show package version]' \
'(-)--version[Show package version]' \
'--ready[Inform the init system about service start-up completion.]' \
'--pid=[Inform the init system about the main PID of the daemon]:daemon main PID:_pids' \
'--status=[Send a free-form status string for the daemon to the init systemd]:status string:' \
@@ -70,8 +70,8 @@ case "$service" in
systemd-tty-ask-password-agent)
_arguments \
'(-)'{-h,--help}'[Prints a short help text and exits.]' \
'(-)--version[Prints a short version string and exits.]' \
'--list[Lists all currently pending system password requests.]' \
'(-)--version[Prints a short version string and exits.]' \
'--list[Lists all currently pending system password requests.]' \
'--query[Process all currently pending system password requests by querying the user on the calling TTY.]' \
'--watch[Continuously process password requests.]' \
'--wall[Forward password requests to wall(1).]' \

View File

@@ -7,7 +7,7 @@
}
(( $+functions[_systemd-analyze_cat-config] )) ||
_systemd-analyze_cat-config() {
_systemd-analyze_cat-config() {
_files -W '(/run/systemd/ /etc/systemd/ /usr/lib/systemd/)' -P 'systemd/'
}

View File

@@ -3,7 +3,7 @@
typeset -A sdpath=( ${$(systemd-path)/:/} )
_arguments -S \
'(- *)'{-h,--help}'[Print help text and exit]' \
'(- *)'{-v,--version}'[Print a version string and exit]' \
'--suffix=[Append a suffix to the paths]:SUFFIX' \
'*:pathname:compadd -k sdpath'
'(- *)'{-h,--help}'[Print help text and exit]' \
'(- *)'{-v,--version}'[Print a version string and exit]' \
'--suffix=[Append a suffix to the paths]:SUFFIX' \
'*:pathname:compadd -k sdpath'

View File

@@ -50,10 +50,10 @@ _udevadm_trigger(){
(( $+functions[_udevadm_settle] )) ||
_udevadm_settle(){
_arguments \
'(-)'{-h,--help}'[Print help]' \
'(-)'{-V,--version}'[Print version of the program]' \
'(-t --timeout)'{-t,--timeout=}'[Maximum number of seconds to wait for the event queue to become empty.]:SEC' \
'(-E --exit-if-exists)'{-E,--exit-if-exists=}'[Stop waiting if file exists.]:files:_files'
'(-)'{-h,--help}'[Print help]' \
'(-)'{-V,--version}'[Print version of the program]' \
'(-t --timeout)'{-t,--timeout=}'[Maximum number of seconds to wait for the event queue to become empty.]:SEC' \
'(-E --exit-if-exists)'{-E,--exit-if-exists=}'[Stop waiting if file exists.]:files:_files'
}
(( $+functions[_udevadm_control] )) ||
@@ -92,7 +92,7 @@ _udevadm_test(){
'(-)'{-V,--version}'[Show package version]' \
'--action=[The action string.]:actions:(add change remove move online offline bind unbind)' \
'(-N --resolve-names)'{-N,--resolve-names=}'[When to resolve names.]:resolve:(early late never)' \
'--subsystem=[The subsystem string.]' \
'--subsystem=[The subsystem string.]' \
'(-D --extra-rules-dir=)'{-D,--extra-rules-dir=}'[Also load rules from the directory.]' \
'(-v --verbose)'{-v,--verbose}'[Show verbose logs.]' \
'--json=[Generate JSON output]:MODE:(pretty short off)' \
@@ -102,11 +102,11 @@ _udevadm_test(){
(( $+functions[_udevadm_test-builtin] )) ||
_udevadm_test-builtin(){
if (( CURRENT == 2 )); then
_arguments \
'(- *)'{-h,--help}'[Print help]' \
'(- *)'{-V,--version}'[Print version of the program]' \
'--action=[The action string.]:actions:(add change remove move online offline bind unbind)' \
'*::builtins:(blkid btrfs dissect_image factory_reset hwdb input_id keyboard kmod net_driver net_id net_setup_link path_id uaccess usb_id)'
_arguments \
'(- *)'{-h,--help}'[Print help]' \
'(- *)'{-V,--version}'[Print version of the program]' \
'--action=[The action string.]:actions:(add change remove move online offline bind unbind)' \
'*::builtins:(blkid btrfs dissect_image factory_reset hwdb input_id keyboard kmod net_driver net_id net_setup_link path_id uaccess usb_id)'
elif (( CURRENT == 3 )); then
_arguments \
'--action=[The action string.]:actions:(add change remove move online offline bind unbind)' \

View File

@@ -4,67 +4,67 @@
local -a reply line
_varlinkctl_interfaces() {
compadd "$@" -- \
"${(@f)$(_call_program varlink-interfaces varlinkctl list-interfaces $line[2])}"
compadd "$@" -- \
"${(@f)$(_call_program varlink-interfaces varlinkctl list-interfaces $line[2])}"
}
_varlinkctl_methods() {
compadd "$@" -- \
"${(@f)$(_call_program varlink-methods varlinkctl list-methods $line[2])}"
compadd "$@" -- \
"${(@f)$(_call_program varlink-methods varlinkctl list-methods $line[2])}"
}
local -a varlink_addr=(
/$'[^\0]#\0'/ ':varlink-addresses:varlink address:_files -g "*(=)"'
/$'[^\0]#\0'/ ':varlink-addresses:varlink address:_files -g "*(=)"'
)
local -a varlink_interface=(
$varlink_addr
/$'[^\0]#\0'/ ':varlink-interfaces:varlink interface:_varlinkctl_interfaces'
$varlink_addr
/$'[^\0]#\0'/ ':varlink-interfaces:varlink interface:_varlinkctl_interfaces'
)
local -a varlink_method=(
$varlink_addr
/$'[^\0]#\0'/ ':varlink-methods:varlink method:_varlinkctl_methods'
$varlink_addr
/$'[^\0]#\0'/ ':varlink-methods:varlink method:_varlinkctl_methods'
)
local -a varlink_call=($varlink_method /$'[^\0]#\0'/ ':argument:argument:()')
local -a varlink_idl=(/$'[^\0]#\0'/ ':varlink-idl-file:idl file:_files')
_regex_words varlink-commands 'varlink command' \
'info:show service information:$varlink_addr' \
'list-interfaces:List interfaces implemented by a service:$varlink_addr' \
'list-methods:List methods implemented by an interface:$varlink_interface' \
'introspect:show an interface definition:$varlink_interface' \
'call:invoke a method:$varlink_call' \
'validate-idl:validate an interface description:$varlink_idl' \
'help:show a help message'
'info:show service information:$varlink_addr' \
'list-interfaces:List interfaces implemented by a service:$varlink_addr' \
'list-methods:List methods implemented by an interface:$varlink_interface' \
'introspect:show an interface definition:$varlink_interface' \
'call:invoke a method:$varlink_call' \
'validate-idl:validate an interface description:$varlink_idl' \
'help:show a help message'
local -a varlinkcmd=( /$'[^\0]#\0'/ "$reply[@]" )
_regex_arguments _varlinkctl_cmd "$varlinkcmd[@]"
_varlinkctl_command() {
local varlink_command=varlinkctl
((CURRENT > 2 )) && varlink_command=varlinkctl-$line[1]
local varlink_command=varlinkctl
((CURRENT > 2 )) && varlink_command=varlinkctl-$line[1]
local -a varlink_args
case "$line[1]" in
(info|list-interfaces)
varlink_args=(address) ;;
(introspect|list-methods)
varlink_args=(address interface) ;;
(call)
varlink_args=(address method arguments) ;;
(validate-idl)
varlink_args=(file) ;;
esac
local -a varlink_args
case "$line[1]" in
(info|list-interfaces)
varlink_args=(address) ;;
(introspect|list-methods)
varlink_args=(address interface) ;;
(call)
varlink_args=(address method arguments) ;;
(validate-idl)
varlink_args=(file) ;;
esac
curcontext="${curcontext%:*:*}:$varlink_command:$varlink_args[CURRENT-2]"
_varlinkctl_cmd "$@"
curcontext="${curcontext%:*:*}:$varlink_command:$varlink_args[CURRENT-2]"
_varlinkctl_cmd "$@"
}
local -a opts=(
{-h,--help}'[Show a help message and exit]'
'--version[Show package version and exit]'
'--no-pager[Do not pipe output to a pager]'
'--more[Request multiple responses]'
'--collect[Collect multiple responses in a JSON array]'
{-j+,--json=}'[Output as json]:json-mode:(pretty short)'
{-h,--help}'[Show a help message and exit]'
'--version[Show package version and exit]'
'--no-pager[Do not pipe output to a pager]'
'--more[Request multiple responses]'
'--collect[Collect multiple responses in a JSON array]'
{-j+,--json=}'[Output as json]:json-mode:(pretty short)'
)
_arguments -S $opts '*:: := _varlinkctl_command'