1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-01 09:41:44 +02:00

49158: remove superfluous function definitions

This commit is contained in:
Oliver Kiddle 2021-07-11 00:32:34 +02:00
parent e9203d04aa
commit 6e10067ffd
10 changed files with 223 additions and 253 deletions

View file

@ -1,5 +1,15 @@
2021-07-10 Oliver Kiddle <opk@zsh.org>
* 49158: Completion/Debian/Command/_dscverify,
Completion/Solaris/Command/_dhcpinfo,
Completion/Solaris/Command/_inetadm,
Completion/Solaris/Command/_prstat,
Completion/Solaris/Command/_svcadm,
Completion/Solaris/Command/_svcprop,
Completion/Solaris/Command/_zlogin,
Completion/Unix/Command/_pkginfo, Completion/Unix/Command/_pkgrm:
remove superfluous function definitions
* 49157: Completion/Linux/Command/_valgrind,
Completion/Unix/Command/_baz, Completion/Unix/Command/_opustools,
Completion/Unix/Command/_tla: fix uses of literal % characters in

View file

@ -4,27 +4,23 @@
# This is dscverify, from the Debian devscripts package, version 2.20.2
# ...
_dscverify() {
local all_opts=(
local all_opts=(
'--help[show the help message and exit]'
'--version[show the version + copyright and exit]'
'--no-default-keyrings[do not check against the default keyrings]'
'*--keyring[add keyring to the list of keyrings used]:keyring:_files -g "*.(kbx|gpg)(-.)"'
'(--nosigcheck --no-sig-check -u)'{--nosigcheck,--no-sig-check,-u}'[do not verify the GPG signature]'
'--verbose[do not suppress GPG output]'
'(--nosigcheck --no-sig-check -u)'{--nosigcheck,--no-sig-check,-u}"[don't verify the GPG signature]"
"--verbose[don't suppress GPG output]"
'*:dsc file:_files -g "*.(changes|dsc|buildinfo)(-.)"'
)
)
local first_only=(
'(--no-conf --noconf)'{--no-conf,--noconf}'[do not read the devscripts config file]'
)
local first_only=(
'(--no-conf --noconf)'{--no-conf,--noconf}"[don't read the devscripts config file]"
)
if (( CURRENT == 2 )); then
all_opts+=($first_only)
fi
if (( CURRENT == 2 )); then
all_opts+=( $first_only )
fi
_arguments \
_arguments \
"$all_opts[@]"
}
_dscverify "$@"

View file

@ -1,9 +1,8 @@
#compdef dhcpinfo
_dhcpinfo() {
local -a mnemonics_v4 mnemonics_v6
local -a mnemonics_v4 mnemonics_v6
mnemonics_v4=(
mnemonics_v4=(
Subnet UTCoffst Router Timeserv IEN116ns DNSserv Logserv
Cookie Lprserv Impress Resource Hostname Bootsize Dumpfile
DNSdmain Swapserv Rootpath ExtendP IpFwdF NLrouteF PFilter
@ -17,20 +16,17 @@ _dhcpinfo() {
Fingersv IRCservs STservs STDAservs UserClas SLP_DA SLP_SS
AgentOpt FQDN PXEarch BootFile BootPath BootSrvA BootSrvN
EchoVC LeaseNeg
)
)
mnemonics_v6=(
mnemonics_v6=(
ClientID ServerID Preference Unicast UserClass VendorClass
SIPNames SIPAddresses DNSAddresses DNSSearch NISServers
NIS+Servers NISDomain NIS+Domain SNTPServers InfoRefresh
BCMCDomain BCMCAddresses
)
)
_arguments -A \
_arguments -A "-*" \
'-c[]' \
'-i[interface]:interface:' \
'-n[maximum number of lines]:limit:' \
':DHCP Parameter:_values "DHCP Parameter" $mnemonics_v4' \
}
_dhcpinfo "$@"
'-i[interface]:interface' \
'-n[maximum number of lines]:limit' \
':DHCP parameter:_values "DHCP parameter" $mnemonics_v4'

View file

@ -1,7 +1,6 @@
#compdef inetadm
_inetadm() {
_arguments -s \
_arguments -s \
'-?[help]' \
'-l[list service instance properties]:FMRI:_svcs_fmri -i' \
'-e[enable specified instance]:FMRI:_svcs_fmri -i' \
@ -9,8 +8,3 @@ _inetadm() {
'-p[list inet service properties]' \
'-m[modify service instance properties]:FMRI:_svcs_fmri -i' \
'-M[modify inet service properties]'
}
_inetadm "$@"
# vi:tw=0

View file

@ -1,29 +1,27 @@
#compdef prstat
_prstat()
{
local d_opt sort_key
d_opt=(
local d_opt sort_key
d_opt=(
"u"\:"seconds past the epoch"
"d"\:"standard date format"
)
)
sort_key=(
sort_key=(
"cpu"\:"process CPU usage"
"pri"\:"process priority"
"rss"\:"resident set size"
"size"\:"size of process image"
"time"\:"process execution time"
)
)
_arguments -A "-*" \
_arguments -A "-*" \
'-a[information about processes and users]' \
'-c[new reports below previous reports instead of overprinting them]' \
'-C[processes or lwps that are bound to processor sets in the list]:processor set list:' \
'-C[processes or lwps that are bound to processor sets in the list]:processor set list' \
'-d[specify the representation of time]:time representation:(($d_opt))' \
'-h[only processes or lwps whose home lgroup is in the list]:lgroup list:' \
'-h[only processes or lwps whose home lgroup is in the list]:lgroup list' \
'-H[information about home lgroup]' \
'-j[only processes or lwps whose project ID is in the given list]:project list:' \
'-j[only processes or lwps whose project ID is in the given list]:project list' \
'-J[information about processes and projects]' \
'-k[only processes or lwps whose task ID is in tasklist]:task list'\
'-L[statistics for each light-weight process (LWP)]' \
@ -31,7 +29,7 @@ _prstat()
'-n[restrict number of output lines]:ntop,[nbottom]' \
'-p[only processes whose process ID is in the list]:PID list' \
'-P[only processes or lwps which have most recently executed on a CPU in the list]:CPU list' \
'-R[Put prstat in the real time scheduling class]' \
'-R[put prstat in the real time scheduling class]' \
'-s[sort key (descending)]:sort key [cpu]:(($sort_key))' \
'-S[sort key (ascending)]:sort key [cpu]:(($sort_key))' \
'-t[total usage summary for each user]' \
@ -39,8 +37,5 @@ _prstat()
'-u[only processes whose effective user ID is in the list]:UID:_users' \
'-U[only processes whose real user ID is in the list]:UID:_users' \
'-v[verbose process usage]' \
'-z[only processes or LWPs whose zone ID is in the list]:zone ID:' \
'-z[only processes or LWPs whose zone ID is in the list]:zone ID' \
'-Z[information about processes and zones]'
}
_prstat "$@"

View file

@ -1,14 +1,13 @@
#compdef svcadm
_svcadm() {
local curcontext="$curcontext" state line expl subcmds
typeset -A opt_args
local curcontext="$curcontext" state line expl subcmds
typeset -A opt_args
subcmds=( enable disable restart refresh mark delegate clear milestone )
subcmds=( enable disable restart refresh mark delegate clear milestone )
if [[ $service == "svcadm" ]]; then
if [[ $service == "svcadm" ]]; then
_arguments -C -A "-*" \
'-v[Print actions verbosely]' \
'-v[print actions verbosely]' \
'*::command:->subcmd' && return 0
if (( CURRENT == 1 )); then
@ -16,63 +15,61 @@ _svcadm() {
return
fi
service="$words[1]"
curcontext="${curcontext%:*}=$service:"
fi
curcontext="${curcontext%:*}-$service:"
fi
case $service in
case $service in
(enable)
_arguments -A "-*" \
'-r[Recursively enable dependencies]' \
'-s[Wait for service to come online]' \
'-T[Timeout for -s]:seconds:' \
'-t[State change is temporary]' \
'-r[recursively enable dependencies]' \
'-s[wait for service to come online]' \
'-T[timeout for -s]:timeout (seconds)' \
'-t[state change is temporary]' \
'*:instance FMRI:_svcs_fmri -i'
;;
(disable)
_arguments -A "-*" \
'-s[Wait for service to become disabled]' \
'-T[Timeout for -s]:seconds:' \
'-t[State change is temporary]' \
'-s[wait for service to become disabled]' \
'-T[timeout for -s]:timeout (seconds)' \
'-t[state change is temporary]' \
'*:instance FMRI:_svcs_fmri -i'
;;
(mark)
_arguments -A "-*" \
'-I[Change state immediately]' \
"-s[Wait for service to reach the new state]" \
'-T[Timeout for -s]:seconds:' \
'-t[State change is temporary]' \
'-I[change state immediately]' \
"-s[wait for service to reach the new state]" \
'-T[timeout for -s]:timeout (seconds)' \
'-t[state change is temporary]' \
':state:(degraded maintenance)' \
':instance FMRI:_svcs_fmri -i'
;;
(restart|refresh|clear)
_arguments \
"-s[Wait for service to $service]" \
'-T[Timeout for -s]:seconds:' \
"-s[wait for service to $service]" \
'-T[timeout for -s]:timeout (seconds)' \
'*:instance FMRI:_svcs_fmri -i'
;;
(delegate)
_arguments -A "-*" \
'-s[Wait for instances to come online]' \
'-T[Timeout for -s]:seconds:' \
'-s[wait for instances to come online]' \
'-T[timeout for -s]:timeout (seconds)' \
':restarter FMRI:_svcs_fmri -r' \
'*:FMRI:_svcs_fmri -i'
;;
(milestone)
_arguments -A "-*" \
'-d[Make milestone the default]' \
'-s[Wait for the transition to the new milestone]' \
'-T[Timeout for -s]:seconds:' \
'-d[make milestone the default]' \
'-s[wait for the transition to the new milestone]' \
'-T[timeout for -s]:timeout (seconds)' \
'*:milestone FMRI:_svcs_fmri -m'
;;
(*)
_message "unknown svcadm subcommand: $service"
esac
}
_svcadm "$@"
;;
esac

View file

@ -1,26 +1,20 @@
#compdef svcprop
_svcprop() {
_arguments -s \
_arguments -s \
'-f[designate properties by their FMRI]' \
'-q[quiet]' \
'-t[use multi-property output format]' \
'-v[verbose]' \
- set1 \
'-w[waits for the selected property or property group to change]' \
'-p[prints values of named property or property group]' \
'-w[wait for the selected property or property group to change]' \
'-p[print values of named property or property group]' \
':FMRI:_svcs_fmri -i' \
- set2 \
'-a[display all properties]' \
'-g[group type filter]:group type:' \
'-g[group type filter]:group type' \
'*-l[properties from a layer]:layer:(admin site-profile system-profile manifest)' \
'(-c -s)-C[retrieve properties without composition]' \
'(-C -s)-c[retrieve properties with composition]' \
'(-c -C)-s[retrieve properties from snapshot]:snapshot:' \
'*-p[prints values of named property or property group]' \
'(-c -C)-s[retrieve properties from snapshot]:snapshot' \
'*-p[print values of named property or property group]' \
'*:FMRI:_svcs_fmri -i'
}
_svcprop "$@"
# vi:tw=0

View file

@ -1,20 +1,16 @@
#compdef zlogin
# Synced with the Nevada build 162 man page
_zlogin() {
local -a _comp_priv_prefix
_arguments -s \
'-E[Disable escape character]' \
'-e[Specify escape character]:character:' \
'-l[Specify username]:username:_users' \
local -a _comp_priv_prefix
_arguments -s \
'-E[disable escape character]' \
'-e[specify escape character]:character' \
'-l[specify username]:username:_users' \
':zonename:_zones' \
- set1 \
'-C[Connect to zone console]' \
'-d[Disconnect on zone halt]' \
'-C[connect to zone console]' \
'-d[disconnect on zone halt]' \
- set2 \
'-S["Safe" login mode]' \
'-S["safe" login mode]' \
'(-):command name: _command_names -e' \
'*::utility: _normal'
}
_zlogin "$@"

View file

@ -1,14 +1,13 @@
#compdef pkginfo
_pkginfo() {
_arguments -s \
_arguments -s \
'(-q -r -x)-l[long listing]' \
'(-l -r -x)-q[quiet mode]' \
'(-l -q -x)-r[relocation base]' \
'(-l -q -r)-x[extracted listing]' \
'-c[category]:category: ' \
'-a[architecture]:architecture: ' \
'-v[version]:version: ' \
'-c[category]:category' \
'-a[architecture]:architecture' \
'-v[version]:version' \
- set1 \
'(-p)-i[select completely installed packages]' \
'(-i)-p[select partially installed packages]' \
@ -17,6 +16,3 @@ _pkginfo() {
- set2 \
'-d[device]:device file:_files' \
'*:package instance:_pkg_instance --_opts uninstalled:set2--d'
}
_pkginfo "$@"

View file

@ -1,8 +1,7 @@
#compdef pkgrm
_pkgrm() {
_arguments -s \
'-Y[select packages by category]:category: ' \
_arguments -s \
'-Y[select packages by category]:category' \
- set1 \
'-n[non-interactive mode]' \
'-v[trace all scripts]' \
@ -15,6 +14,3 @@ _pkgrm() {
- set2 \
'-s[spool package]:spool directory:_files -/' \
'*:package instance:_pkg_instance --_opts spooled:set2--s'
}
_pkgrm "$@"