From 6e10067ffd3d2ede3e0a59c36e03d00cee5d9ad1 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 11 Jul 2021 00:32:34 +0200 Subject: 49158: remove superfluous function definitions --- ChangeLog | 10 +++ Completion/Debian/Command/_dscverify | 38 +++++------ Completion/Solaris/Command/_dhcpinfo | 58 ++++++++-------- Completion/Solaris/Command/_inetadm | 22 +++--- Completion/Solaris/Command/_prstat | 79 ++++++++++----------- Completion/Solaris/Command/_svcadm | 129 +++++++++++++++++------------------ Completion/Solaris/Command/_svcprop | 42 +++++------- Completion/Solaris/Command/_zlogin | 30 ++++---- Completion/Unix/Command/_pkginfo | 36 +++++----- Completion/Unix/Command/_pkgrm | 32 ++++----- 10 files changed, 223 insertions(+), 253 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62814354c..2b4d4bcc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2021-07-10 Oliver Kiddle + * 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 diff --git a/Completion/Debian/Command/_dscverify b/Completion/Debian/Command/_dscverify index 4d383c6c4..84b00e4e7 100644 --- a/Completion/Debian/Command/_dscverify +++ b/Completion/Debian/Command/_dscverify @@ -4,27 +4,23 @@ # This is dscverify, from the Debian devscripts package, version 2.20.2 # ... -_dscverify() { - 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]' - '*:dsc file:_files -g "*.(changes|dsc|buildinfo)(-.)"' - ) +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}"[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 \ - "$all_opts[@]" -} - -_dscverify "$@" +_arguments \ + "$all_opts[@]" diff --git a/Completion/Solaris/Command/_dhcpinfo b/Completion/Solaris/Command/_dhcpinfo index 079b6e6f6..1dac684af 100644 --- a/Completion/Solaris/Command/_dhcpinfo +++ b/Completion/Solaris/Command/_dhcpinfo @@ -1,36 +1,32 @@ #compdef dhcpinfo -_dhcpinfo() { - local -a mnemonics_v4 mnemonics_v6 +local -a mnemonics_v4 mnemonics_v6 - mnemonics_v4=( - Subnet UTCoffst Router Timeserv IEN116ns DNSserv Logserv - Cookie Lprserv Impress Resource Hostname Bootsize Dumpfile - DNSdmain Swapserv Rootpath ExtendP IpFwdF NLrouteF PFilter - MaxIpSiz IpTTL PathTO PathTbl MTU SameMtuF Broadcst - MaskDscF MaskSupF RDiscvyF RSolictS StaticRt TrailerF - ArpTimeO EthEncap TcpTTL TcpKaInt TcpKaGbF NISdmain - NISservs NTPservs NetBNms NetBDsts NetBNdT NetBScop - XFontSrv XDispMgr LeaseTim Message T1Time T2Time NW_dmain - NWIPOpts NIS+dom NIS+serv TFTPsrvN OptBootF MblIPAgt - OptBootF MblIPAgt SMTPserv POP3serv NNTPserv WWWservs - Fingersv IRCservs STservs STDAservs UserClas SLP_DA SLP_SS - AgentOpt FQDN PXEarch BootFile BootPath BootSrvA BootSrvN - EchoVC LeaseNeg - ) +mnemonics_v4=( + Subnet UTCoffst Router Timeserv IEN116ns DNSserv Logserv + Cookie Lprserv Impress Resource Hostname Bootsize Dumpfile + DNSdmain Swapserv Rootpath ExtendP IpFwdF NLrouteF PFilter + MaxIpSiz IpTTL PathTO PathTbl MTU SameMtuF Broadcst + MaskDscF MaskSupF RDiscvyF RSolictS StaticRt TrailerF + ArpTimeO EthEncap TcpTTL TcpKaInt TcpKaGbF NISdmain + NISservs NTPservs NetBNms NetBDsts NetBNdT NetBScop + XFontSrv XDispMgr LeaseTim Message T1Time T2Time NW_dmain + NWIPOpts NIS+dom NIS+serv TFTPsrvN OptBootF MblIPAgt + OptBootF MblIPAgt SMTPserv POP3serv NNTPserv WWWservs + Fingersv IRCservs STservs STDAservs UserClas SLP_DA SLP_SS + AgentOpt FQDN PXEarch BootFile BootPath BootSrvA BootSrvN + EchoVC LeaseNeg +) - mnemonics_v6=( - ClientID ServerID Preference Unicast UserClass VendorClass - SIPNames SIPAddresses DNSAddresses DNSSearch NISServers - NIS+Servers NISDomain NIS+Domain SNTPServers InfoRefresh - BCMCDomain BCMCAddresses - ) +mnemonics_v6=( + ClientID ServerID Preference Unicast UserClass VendorClass + SIPNames SIPAddresses DNSAddresses DNSSearch NISServers + NIS+Servers NISDomain NIS+Domain SNTPServers InfoRefresh + BCMCDomain BCMCAddresses +) - _arguments -A \ - '-c[]' \ - '-i[interface]:interface:' \ - '-n[maximum number of lines]:limit:' \ - ':DHCP Parameter:_values "DHCP Parameter" $mnemonics_v4' \ -} - -_dhcpinfo "$@" +_arguments -A "-*" \ + '-c[]' \ + '-i[interface]:interface' \ + '-n[maximum number of lines]:limit' \ + ':DHCP parameter:_values "DHCP parameter" $mnemonics_v4' diff --git a/Completion/Solaris/Command/_inetadm b/Completion/Solaris/Command/_inetadm index 0c8b14a4e..527cc5a71 100644 --- a/Completion/Solaris/Command/_inetadm +++ b/Completion/Solaris/Command/_inetadm @@ -1,16 +1,10 @@ #compdef inetadm -_inetadm() { - _arguments -s \ - '-?[help]' \ - '-l[list service instance properties]:FMRI:_svcs_fmri -i' \ - '-e[enable specified instance]:FMRI:_svcs_fmri -i' \ - '-d[disable specified instance]:FMRI:_svcs_fmri -i' \ - '-p[list inet service properties]' \ - '-m[modify service instance properties]:FMRI:_svcs_fmri -i' \ - '-M[modify inet service properties]' -} - -_inetadm "$@" - -# vi:tw=0 +_arguments -s \ + '-?[help]' \ + '-l[list service instance properties]:FMRI:_svcs_fmri -i' \ + '-e[enable specified instance]:FMRI:_svcs_fmri -i' \ + '-d[disable specified instance]:FMRI:_svcs_fmri -i' \ + '-p[list inet service properties]' \ + '-m[modify service instance properties]:FMRI:_svcs_fmri -i' \ + '-M[modify inet service properties]' diff --git a/Completion/Solaris/Command/_prstat b/Completion/Solaris/Command/_prstat index 12be9c5a4..a95919127 100644 --- a/Completion/Solaris/Command/_prstat +++ b/Completion/Solaris/Command/_prstat @@ -1,46 +1,41 @@ #compdef prstat -_prstat() -{ - local d_opt sort_key - d_opt=( - "u"\:"seconds past the epoch" - "d"\:"standard date format" - ) +local d_opt sort_key +d_opt=( + "u"\:"seconds past the epoch" + "d"\:"standard date format" +) - sort_key=( - "cpu"\:"process CPU usage" - "pri"\:"process priority" - "rss"\:"resident set size" - "size"\:"size of process image" - "time"\:"process execution time" - ) +sort_key=( + "cpu"\:"process CPU usage" + "pri"\:"process priority" + "rss"\:"resident set size" + "size"\:"size of process image" + "time"\:"process execution time" +) - _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:' \ - '-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[information about home lgroup]' \ - '-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)]' \ - '-m[microstate process accounting information]' \ - '-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]' \ - '-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]' \ - '-T[information about processes and tasks]' \ - '-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[information about processes and zones]' -} - -_prstat "$@" +_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' \ + '-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[information about home lgroup]' \ + '-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)]' \ + '-m[microstate process accounting information]' \ + '-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]' \ + '-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]' \ + '-T[information about processes and tasks]' \ + '-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[information about processes and zones]' diff --git a/Completion/Solaris/Command/_svcadm b/Completion/Solaris/Command/_svcadm index c9826f2eb..22780d03f 100644 --- a/Completion/Solaris/Command/_svcadm +++ b/Completion/Solaris/Command/_svcadm @@ -1,78 +1,75 @@ #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 - _arguments -C -A "-*" \ - '-v[Print actions verbosely]' \ - '*::command:->subcmd' && return 0 +if [[ $service == "svcadm" ]]; then + _arguments -C -A "-*" \ + '-v[print actions verbosely]' \ + '*::command:->subcmd' && return 0 - if (( CURRENT == 1 )); then - _wanted commands expl 'svcadm subcommand' compadd -a subcmds - return - fi - service="$words[1]" - curcontext="${curcontext%:*}=$service:" - fi + if (( CURRENT == 1 )); then + _wanted commands expl 'svcadm subcommand' compadd -a subcmds + return + fi + service="$words[1]" + curcontext="${curcontext%:*}-$service:" +fi - 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]' \ - '*:instance FMRI:_svcs_fmri -i' - ;; +case $service in + (enable) + _arguments -A "-*" \ + '-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]' \ - '*:instance FMRI:_svcs_fmri -i' - ;; + (disable) + _arguments -A "-*" \ + '-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]' \ - ':state:(degraded maintenance)' \ - ':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]: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:' \ - '*:instance FMRI:_svcs_fmri -i' - ;; + (restart|refresh|clear) + _arguments \ + "-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:' \ - ':restarter FMRI:_svcs_fmri -r' \ - '*:FMRI:_svcs_fmri -i' - ;; + (delegate) + _arguments -A "-*" \ + '-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:' \ - '*:milestone FMRI:_svcs_fmri -m' - ;; + (milestone) + _arguments -A "-*" \ + '-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 "$@" + (*) + _message "unknown svcadm subcommand: $service" + ;; +esac diff --git a/Completion/Solaris/Command/_svcprop b/Completion/Solaris/Command/_svcprop index 4a5436caf..19c65d3cf 100644 --- a/Completion/Solaris/Command/_svcprop +++ b/Completion/Solaris/Command/_svcprop @@ -1,26 +1,20 @@ #compdef svcprop -_svcprop() { - _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]' \ - ':FMRI:_svcs_fmri -i' \ - - set2 \ - '-a[display all properties]' \ - '-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]' \ - '*:FMRI:_svcs_fmri -i' -} - -_svcprop "$@" - -# vi:tw=0 +_arguments -s \ + '-f[designate properties by their FMRI]' \ + '-q[quiet]' \ + '-t[use multi-property output format]' \ + '-v[verbose]' \ + - set1 \ + '-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' \ + '*-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[print values of named property or property group]' \ + '*:FMRI:_svcs_fmri -i' diff --git a/Completion/Solaris/Command/_zlogin b/Completion/Solaris/Command/_zlogin index 74cbafe82..142114302 100644 --- a/Completion/Solaris/Command/_zlogin +++ b/Completion/Solaris/Command/_zlogin @@ -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' \ - ':zonename:_zones' \ - - set1 \ - '-C[Connect to zone console]' \ - '-d[Disconnect on zone halt]' \ - - set2 \ - '-S["Safe" login mode]' \ - '(-):command name: _command_names -e' \ - '*::utility: _normal' -} - -_zlogin "$@" +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]' \ + - set2 \ + '-S["safe" login mode]' \ + '(-):command name: _command_names -e' \ + '*::utility: _normal' diff --git a/Completion/Unix/Command/_pkginfo b/Completion/Unix/Command/_pkginfo index 6c71082ef..eca9e057e 100644 --- a/Completion/Unix/Command/_pkginfo +++ b/Completion/Unix/Command/_pkginfo @@ -1,22 +1,18 @@ #compdef pkginfo -_pkginfo() { - _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: ' \ - - set1 \ - '(-p)-i[select completely installed packages]' \ - '(-i)-p[select partially installed packages]' \ - '-R[root path]:root path:_files -/' \ - '*:package instance:_pkg_instance --_opts installed:set1--R' \ - - set2 \ - '-d[device]:device file:_files' \ - '*:package instance:_pkg_instance --_opts uninstalled:set2--d' -} - -_pkginfo "$@" +_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' \ + - set1 \ + '(-p)-i[select completely installed packages]' \ + '(-i)-p[select partially installed packages]' \ + '-R[root path]:root path:_files -/' \ + '*:package instance:_pkg_instance --_opts installed:set1--R' \ + - set2 \ + '-d[device]:device file:_files' \ + '*:package instance:_pkg_instance --_opts uninstalled:set2--d' diff --git a/Completion/Unix/Command/_pkgrm b/Completion/Unix/Command/_pkgrm index 25a950221..1191a2d1f 100644 --- a/Completion/Unix/Command/_pkgrm +++ b/Completion/Unix/Command/_pkgrm @@ -1,20 +1,16 @@ #compdef pkgrm -_pkgrm() { - _arguments -s \ - '-Y[select packages by category]:category: ' \ - - set1 \ - '-n[non-interactive mode]' \ - '-v[trace all scripts]' \ - '-a[admin file]:admin file:_files' \ - "-A[force removal of all files]" \ - "-M[don't use vfstab file]" \ - '-R[root path]:root path:_files -/' \ - '-V[alternate vfstab file]:vfstab file:_files' \ - '*:package instance:_pkg_instance --_opts installed:set1--R' \ - - set2 \ - '-s[spool package]:spool directory:_files -/' \ - '*:package instance:_pkg_instance --_opts spooled:set2--s' -} - -_pkgrm "$@" +_arguments -s \ + '-Y[select packages by category]:category' \ + - set1 \ + '-n[non-interactive mode]' \ + '-v[trace all scripts]' \ + '-a[admin file]:admin file:_files' \ + "-A[force removal of all files]" \ + "-M[don't use vfstab file]" \ + '-R[root path]:root path:_files -/' \ + '-V[alternate vfstab file]:vfstab file:_files' \ + '*:package instance:_pkg_instance --_opts installed:set1--R' \ + - set2 \ + '-s[spool package]:spool directory:_files -/' \ + '*:package instance:_pkg_instance --_opts spooled:set2--s' -- cgit 1.4.1