From 40a6265aa3f611178ccb99b05522f458ac466f61 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Sun, 6 Aug 2023 13:35:20 -0700 Subject: 52013,52014,52015,52016,52017,52018: updates for coreutils option changes --- Completion/Unix/Command/_date | 1 + 1 file changed, 1 insertion(+) (limited to 'Completion/Unix/Command/_date') diff --git a/Completion/Unix/Command/_date b/Completion/Unix/Command/_date index 97c272830..6be34ffcd 100644 --- a/Completion/Unix/Command/_date +++ b/Completion/Unix/Command/_date @@ -19,6 +19,7 @@ if _pick_variant gnu="Free Software Foundation" unix --version; then $f{-R,--rfc-email}'[display in RFC5322 format]' $f'--rfc-3339=-[display in RFC 3339 format]:precision:(date seconds ns)' '(-u --utc --universal)'{-u,--utc,--universal}'[display or set time in UTC]' + '--resolution[output the available resolution of timestamps]' '(- :)--help[output help and exit]' '(- :)--version[output version info and exit]' ) -- cgit v1.2.3 From 9b9870a6dc526e9d1f4406a730cbaa17a462e46f Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Mon, 14 Aug 2023 15:51:12 +0900 Subject: 52037: complete only external commands for env/watch also includes a few minor fixes for _date, _env and _watch --- ChangeLog | 7 +++++++ Completion/Unix/Command/_date | 2 +- Completion/Unix/Command/_env | 4 ++-- Completion/Unix/Command/_watch | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) (limited to 'Completion/Unix/Command/_date') diff --git a/ChangeLog b/ChangeLog index 97efdcec4..13230c3b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-08-14 Jun-ichi Takimoto + + * 52037: Completion/Unix/Command/_date, + Completion/Unix/Command/_env, Completion/Unix/Command/_watch: + complete only external commands for env and watch, with a few + more minor fixes + 2023-08-06 Bart Schaefer * Shohei YOSHIDA: 52018: Completion/Unix/Command/_wc: latest diff --git a/Completion/Unix/Command/_date b/Completion/Unix/Command/_date index 6be34ffcd..9add1a9bc 100644 --- a/Completion/Unix/Command/_date +++ b/Completion/Unix/Command/_date @@ -19,7 +19,7 @@ if _pick_variant gnu="Free Software Foundation" unix --version; then $f{-R,--rfc-email}'[display in RFC5322 format]' $f'--rfc-3339=-[display in RFC 3339 format]:precision:(date seconds ns)' '(-u --utc --universal)'{-u,--utc,--universal}'[display or set time in UTC]' - '--resolution[output the available resolution of timestamps]' + $d'--resolution[output the available resolution of timestamps]' '(- :)--help[output help and exit]' '(- :)--version[output version info and exit]' ) diff --git a/Completion/Unix/Command/_env b/Completion/Unix/Command/_env index f7283e132..bdab71bbe 100644 --- a/Completion/Unix/Command/_env +++ b/Completion/Unix/Command/_env @@ -9,7 +9,7 @@ case $variant in (( $#words > 2 )) && ign='!' args=( '(-)'{-i,--ignore-environment}'[start with empty environment]' - '(-0 --null)'{-0,--null}'[end each output line with NUL, not newline]' + '(* -0 --null)'{-0,--null}'[end each output line with NUL, not newline]' '(--ignore-environment -i --help --version)*'{-u+,--unset=}'[remove variable from the environment]:env var to remove:_parameters -g "*export*"' '(-C --chdir)'{-C+,--chdir=}'[change working directory]:directory:_directories' '(-S --split-string)'{-S+,--split-string=}'[perform word splitting]:string to split' @@ -59,7 +59,7 @@ if [[ -n $state ]]; then shift words (( CURRENT-- )) done - _normal && ret=0 + _normal -p env && ret=0 ;; user-class) if compset -P 1 '*/'; then diff --git a/Completion/Unix/Command/_watch b/Completion/Unix/Command/_watch index 91244abe7..e12add520 100644 --- a/Completion/Unix/Command/_watch +++ b/Completion/Unix/Command/_watch @@ -18,7 +18,7 @@ case $variant in '(-g --chgexit)'{-g,--chgexit}'[exit on command output change]' \ '(-n --interval)'{-n+,--interval=}'[specify update interval]:update interval (seconds) [2]' \ '(-p --precise)'{-p,--precise}'[run command at precise intervals]' \ - '(-q --equexit)'{-q,--equexit}'[exit when output of command does not change for the given cycles]:cycles' \ + '(-q --equexit)'{-q+,--equexit=}'[exit when output of command does not change for the given cycles]:cycles' \ '(-r --no-rerun)'{-r,--no-rerun}'[do not run the program on terminal resize]' \ '(-t --no-title)'{-t,--no-title}'[disable header]' \ '(-w --no-wrap)'{-w,--no-wrap}'[disable line wrapping]' \ @@ -34,7 +34,7 @@ case $variant in then _cmdstring && ret=0 else - _normal && ret=0 + _normal -p watch && ret=0 fi ;; # watch(1) has completely different semantics on freebsd compared to linux, hence: -- cgit v1.2.3 From 985952e2f616c816e24c4cf5aee70416e4f23e07 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 11 Oct 2023 00:57:16 +0200 Subject: 52217: update completions for FreeBSD 14 --- ChangeLog | 13 ++++ Completion/BSD/Command/_freebsd-update | 1 + Completion/BSD/Command/_ipfw | 137 +++++++++++++++++++-------------- Completion/BSD/Command/_pfctl | 5 +- Completion/BSD/Command/_sockstat | 8 ++ Completion/Unix/Command/_cmp | 14 +++- Completion/Unix/Command/_date | 4 +- Completion/Unix/Command/_elfdump | 11 ++- Completion/Unix/Command/_gcore | 1 + Completion/Unix/Command/_ifconfig | 17 +++- Completion/Unix/Command/_iostat | 2 +- Completion/Unix/Command/_ldd | 3 +- Completion/Unix/Command/_ls | 13 ++-- Completion/Unix/Command/_mktemp | 54 ++++++------- Completion/Unix/Command/_netstat | 3 + Completion/Unix/Command/_script | 6 +- Completion/Unix/Command/_service | 5 +- Completion/Unix/Command/_split | 13 +++- Completion/Unix/Command/_ssh | 2 +- Completion/Unix/Command/_sysctl | 8 +- Completion/Unix/Type/_diff_options | 17 ++-- 21 files changed, 213 insertions(+), 124 deletions(-) (limited to 'Completion/Unix/Command/_date') diff --git a/ChangeLog b/ChangeLog index 9a5204ce7..cfc1a2841 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2023-10-10 Oliver Kiddle + * 52217: Completion/BSD/Command/_freebsd-update, + Completion/BSD/Command/_ipfw, Completion/BSD/Command/_pfctl, + Completion/BSD/Command/_sockstat, Completion/Unix/Command/_cmp, + Completion/Unix/Command/_date, Completion/Unix/Command/_elfdump, + Completion/Unix/Command/_gcore, Completion/Unix/Command/_mktemp, + Completion/Unix/Command/_iostat, Completion/Unix/Command/_ldd, + Completion/Unix/Command/_ls, Completion/Unix/Command/_ifconfig, + Completion/Unix/Command/_netstat, Completion/Unix/Command/_script, + Completion/Unix/Command/_service, Completion/Unix/Command/_split, + Completion/Unix/Command/_ssh, Completion/Unix/Command/_sysctl, + Completion/Unix/Type/_diff_options: + update completions for FreeBSD 14 + * 52216: Src/Modules/watch.c: metafy usernames to allow for them to be UTF-8 encoded diff --git a/Completion/BSD/Command/_freebsd-update b/Completion/BSD/Command/_freebsd-update index 7dd907298..af37641e4 100644 --- a/Completion/BSD/Command/_freebsd-update +++ b/Completion/BSD/Command/_freebsd-update @@ -17,6 +17,7 @@ _arguments \ '-d[store working files in workdir]:workdir:_files -/' \ '-f[read configuration options from conffile]:conf file:_files' \ '-F[force freebsd-update fetch to proceed where it normally would not]' \ + '-j[operate on specified jail]: :_jails' \ '-k[trust an RSA key with SHA256 of KEY]:RSA key' \ '-r[specify the new release]:new release' \ '-s[fetch files from the specified server or server pool]:server:_hosts' \ diff --git a/Completion/BSD/Command/_ipfw b/Completion/BSD/Command/_ipfw index 49d0ef1e8..b910aa34d 100644 --- a/Completion/BSD/Command/_ipfw +++ b/Completion/BSD/Command/_ipfw @@ -1,7 +1,7 @@ -#compdef ipfw +#compdef ipfw dnctl local word=$'/[^ \t\0]#[ \t\0]/' comma next pqs nat -local -a actions address pathname ropts ca +local -a actions address dummynet args ropts ca local -A opt_args nat_options _ipfw_tables() { @@ -80,6 +80,46 @@ address=( \| \) ) +dummynet=( + $'/(pipe|queue|sched)[ \t\0]/' -'pqs=${match%?}' ':dummynet-commands:dummynet configuration:$ca pipe queue sched' + $word ': _message -e numbers number' + $word ':options:config:$ca config' + \( $'/bw[ \t\0]/' + \( $word ':bandwidths: :_numbers -M "m:{a-z}={A-Z}" bandwidth {K,M,G}{bit,Byte}/s' + \| $word ':devices:device:_net_interfaces -qS " "' \) + \| $'/delay[ \t\0]/' $word ': _message -e numbers "propagation delay (ms)"' + \| $'/burst[ \t\0]/' $word ': _message -e numbers "size (bytes)"' + \| $'/profile[ \t\0]/' $word ':files:file:_files -qS " "' + \| $'/pipe[ \t\0]/' $word ': _message -e pipes pipe' + \| $'/weight[ \t\0]/' $word ': _message -e weights "weight (1-100) [1]"' + \| $'/type[ \t\0]/-' + \( $'/fq_(pie|codel)[ \t\0]/' + \( $'/limit[ \t\0]/' $word ': _message -e numbers "limit (packets) [10240]"' + \| $'/flows[ \t\0]/' $word ': _message -e numbers "flow queues [1024]"' + \| $'/quantum[ \t\0]/' ':parameters:parameter:$ca -F line quantum limit flows' \) \# + '/[]/' + \| $word ':types:scheduling algorithm:$ca fifo wf2q+ rr qfq fq_codel fq_pie fq_codel' \) + \| $'/buckets[ \t\0]/' $word ': _message -e sizes "hash table size (16-65536)"' + \| $'/mask[ \t\0]/' $word ':mask-specifiers:mask specifier:$ca dst-ip dst-ip6 src-ip src-ip6 dst-port src-port flow-id proto all' + \| $'/plr[ \t\0]/' $word ': _message -e numbers "packet loss rate (0.0-1.0)"' + \| $'/queue[ \t\0]/' $word ': _message -e sizes "queue size"' + \| $'/(red|gred)[ \t\0]/' $word ': _message -e thresholds thresholds' + \| $'/codel[ \t\0]/' + \( $'/(target|interval)[ \t\0]/' $word ': _message -e times "time (ms)"' + \| $'/(ecn|noecn)[ \t\0]/' ':options:option:$ca -F line target interval ecn noecn' \) \# + '/[]/' + \| $'/pie[ \t\0]/' + \( $'/(target|tupdate|max_burst)[ \t\0]/' $word ': _message -e times "time"' + \| $'/(alpha|beta)[ \t\0]/' $word ': _message -e weights weight' + \| $'/max_ecnth[ \t\0]/' $word ': _message -e probabilities probability' + \| $word ':options:option:$ca -F line alpha beta max_burst max_ecnth {,no}{ecn,capdrop,drand} onoff dre ts' \) \# + '/[]/' + \| // '-[[ $pqs = pipe ]]' $'/noerror[ \t\0]/' ':options:option:$ca -F line bw delay burst profile buckets mask noerror plr queue red gred codel pie' + \| // '-[[ $pqs = queue ]]' $'/noerror[ \t\0]/' ':options:option:$ca -F line pipe weight buckets mask noerror plr queue red gred codel pie' + \| // '-[[ $pqs = sched ]]' $'/[]/' ':options:option:$ca -F line type bw delay burst profile' + \) \# +) + actions=( $'/[^\0]##\0(-[a-zA-Z0-9]##[ \t]#)#/' # skip over options, completed by _arguments but can \( # be quoted in one argument which that doesn't handle @@ -241,48 +281,14 @@ actions=( \| $'/redirect_proto[ \t\0]/' $word ':protocols:protocol:$ca sctp tcp udp' $word ': _message -e ip-addresses "IP address"' $word ': _message -e ip-addresses "IP address"' - \| $word ':parameters:config parameter:$ca ip if log deny_in same_ports unreg_only unreg_cgn reset reverse proxy_only skip_global redirect_port redirect_addr redirect_proto' + \| $'/port_range[ \t\0]/' + '/[0-9]#-/' ': _message -e ports lower' + $word ': _message -e ports upper' + \| $word ':parameters:config parameter:$ca ip if log deny_in same_ports unreg_only unreg_cgn reset reverse proxy_only skip_global redirect_port redirect_addr redirect_proto port_range' \) \# \| $'/show[ \t\0]/' $word ':actions:action:(config log)' \| '/[]/' ':commands:command:$ca config show' \) - \| # dummynet configuration - $'/(pipe|queue|sched)[ \t\0]/' -'pqs=${match%?}' ':dummynet-commands:dummynet configuration:$ca pipe queue sched' - $word ': _message -e numbers number' - $word ':options:config:$ca config' - \( $'/bw[ \t\0]/' - \( $word ':bandwidths: :_numbers -M "m:{a-z}={A-Z}" bandwidth {K,M,G}{bit,Byte}/s' - \| $word ':devices:device:_net_interfaces -qS " "' \) - \| $'/delay[ \t\0]/' $word ': _message -e numbers "propagation delay (ms)"' - \| $'/burst[ \t\0]/' $word ': _message -e numbers "size (bytes)"' - \| $'/profile[ \t\0]/' $word ':files:file:_files -qS " "' - \| $'/pipe[ \t\0]/' $word ': _message -e pipes pipe' - \| $'/weight[ \t\0]/' $word ': _message -e weights "weight (1-100) [1]"' - \| $'/type[ \t\0]/-' - \( $'/fq_(pie|codel)[ \t\0]/' - \( $'/limit[ \t\0]/' $word ': _message -e numbers "limit (packets) [10240]"' - \| $'/flows[ \t\0]/' $word ': _message -e numbers "flow queues [1024]"' - \| $'/quantum[ \t\0]/' ':parameters:parameter:$ca -F line quantum limit flows' \) \# - '/[]/' - \| $word ':types:scheduling algorithm:$ca fifo wf2q+ rr qfq fq_codel fq_pie fq_codel' \) - \| $'/buckets[ \t\0]/' $word ': _message -e sizes "hash table size (16-65536)"' - \| $'/mask[ \t\0]/' $word ':mask-specifiers:mask specifier:$ca dst-ip dst-ip6 src-ip src-ip6 dst-port src-port flow-id proto all' - \| $'/plr[ \t\0]/' $word ': _message -e numbers "packet loss rate (0.0-1.0)"' - \| $'/queue[ \t\0]/' $word ': _message -e sizes "queue size"' - \| $'/(red|gred)[ \t\0]/' $word ': _message -e thresholds thresholds' - \| $'/codel[ \t\0]/' - \( $'/(target|interval)[ \t\0]/' $word ': _message -e times "time (ms)"' - \| $'/(ecn|noecn)[ \t\0]/' ':options:option:$ca -F line target interval ecn noecn' \) \# - '/[]/' - \| $'/pie[ \t\0]/' - \( $'/(target|tupdate|max_burst)[ \t\0]/' $word ': _message -e times "time"' - \| $'/(alpha|beta)[ \t\0]/' $word ': _message -e weights weight' - \| $'/max_ecnth[ \t\0]/' $word ': _message -e probabilities probability' - \| $word ':options:option:$ca -F line alpha beta max_burst max_ecnth {,no}{ecn,capdrop,drand} onoff dre ts' \) \# - '/[]/' - \| // '-[[ $pqs = pipe ]]' $'/noerror[ \t\0]/' ':options:option:$ca -F line bw delay burst profile buckets mask noerror plr queue red gred codel pie' - \| // '-[[ $pqs = queue ]]' $'/noerror[ \t\0]/' ':options:option:$ca -F line pipe weight buckets mask noerror plr queue red gred codel pie' - \| // '-[[ $pqs = sched ]]' $'/[]/' ':options:option:$ca -F line type bw delay burst profile' - \) \# + \| $dummynet \| # sysctl shortcuts $'/(en|dis)able[ \t\0]/' ':sysctl-shortcuts:sysctl shortcut:$ca enable disable' $word ':values:value:(firewall altq one_pass debug verbose dyn_keepalive)' @@ -292,11 +298,36 @@ actions=( \) ) -if (( $words[(I)-p*] )); then - pathname=( ':path:_files -P / -W /' ) -fi +case $service in + ipfw) + _regex_arguments _ipfw_actions "$actions[@]" + args=( + '!-e' # nop for compatibility + '(-p)-a[show counter values when listing rules (implied by show)]' + '(-p)-b[show only the action and the comment]' + '-c[show rules in compact form]' + '(-p)-d[show dynamic rules in addition to static ones]' + '(-p)-D[act on dynamic states only]' + '-f[run without confirmation]' + '(-p)-i[format values as IP addresses in table listings]' + '-N[resolve addresses and service names in output]' + '-q[quiet output]' + '-S[show the set each rule belongs to]' + '(-p -T)-t[show timestamp of last match, ctime() format]' + '(-p -t)-T[show timestamp of last match as seconds since epoch]' + '(-a -b -d -D -i -s -t -T *)-p+[specify preprocessor]:preprocessor:_command_names -e' + ) + if (( $words[(I)-p*] )); then + args+=( ':path:_files -P / -W /' ) + fi + ;; + dnctl) + _regex_arguments _ipfw_actions \ + $'/[^\0]##\0(-[a-zA-Z0-9]##[ \t]#)#/' \ + "$dummynet[@]" + ;; +esac -_regex_arguments _ipfw_actions "$actions[@]" if [[ -prefix *[$' \t']* ]]; then # This allows from things like ipfw "-n add..." @@ -304,22 +335,10 @@ if [[ -prefix *[$' \t']* ]]; then return fi -_arguments -s $pathname \ - '(-p)-a[show counter values when listing rules (implied by show)]' \ - '(-p)-b[show only the action and the comment]' \ - '-c[show rules in compact form]' \ - '(-p)-d[show dynamic rules in addition to static ones]' \ - '(-p)-D[act on dynamic states only]' \ - '-f[run without confirmation]' \ +_arguments -s $args \ '(- *)-h[display syntax summary]' \ - '(-p)-i[format values as IP addresses in table listings]' \ '-n[only check syntax, make no changes]' \ - '-N[resolve addresses and service names in output]' \ - '-q[quiet output]' \ - '-S[show the set each rule belongs to]' \ '(-p)-s+[sort pipes by field]:field (negative reverses):((0\:unsorted 1\:packets 2\:bytes 3\:total\ packets 4\:total\ bytes))' \ - '(-p -T)-t[show timestamp of last match, ctime() format]' \ - '(-p -t)-T[show timestamp of last match as seconds since epoch]' \ - '(-a -b -d -D -i -s -t -T *)-p+[specify preprocessor]:preprocessor:_command_names -e' \ + '-v[verbose]' \ '*:::actions:= _ipfw_actions' diff --git a/Completion/BSD/Command/_pfctl b/Completion/BSD/Command/_pfctl index 812e52bdb..8063eb504 100644 --- a/Completion/BSD/Command/_pfctl +++ b/Completion/BSD/Command/_pfctl @@ -91,7 +91,10 @@ case $OSTYPE in ) ;| freebsd*) - args+=( '-P[display ports numerically]' ) + args+=( + '-M[kill matching states in the opposite direction]' + '-P[display ports numerically]' + ) ;; esac diff --git a/Completion/BSD/Command/_sockstat b/Completion/BSD/Command/_sockstat index 1d7973db7..f372fe1b3 100644 --- a/Completion/BSD/Command/_sockstat +++ b/Completion/BSD/Command/_sockstat @@ -21,6 +21,14 @@ case $OSTYPE in '-w[use wider field size for displaying addresses]' ) ;| + freebsd<13->.*) + args+=( + '-C[display the congestion control module]' + '-i[display the inp_gencnt]' + "-n[don't resolve numeric UIDs to user names]" + '-q[quiet mode, do not print the header line]' + ) + ;| freebsd*) for proto in ${${(M)${(f)"$(.*|openbsd*) + args+=( '-z+[specify timezone for output]:time zone:_time_zone') ;| netbsd*) args+=( '-d[output date specified by string]:time string:' ) diff --git a/Completion/Unix/Command/_elfdump b/Completion/Unix/Command/_elfdump index 065f4b97f..b3cc77695 100644 --- a/Completion/Unix/Command/_elfdump +++ b/Completion/Unix/Command/_elfdump @@ -34,10 +34,15 @@ case $OSTYPE in '-l[show long section names without truncation]' '-O[specify osabi to apply]:osabi' '-P[use alternative section header]' - "*:elf file:_object_files" ) ;; - freebsd*) args+=( '-a[dump all information]' ) ;; + freebsd*) + args+=( + '-a[dump all information]' + '(-)-E[return success if file is an ELF file and failure if not]' + ) + ;; esac -_arguments -s $args +_arguments -s $args \ + "*:elf file:_object_files" diff --git a/Completion/Unix/Command/_gcore b/Completion/Unix/Command/_gcore index a31a81267..ef3afd919 100644 --- a/Completion/Unix/Command/_gcore +++ b/Completion/Unix/Command/_gcore @@ -46,6 +46,7 @@ case $OSTYPE in _arguments -s \ '-c+[write core file to specified file]:file:_files' \ '-f[dump all available segments]' \ + '-k[use the ptrace(2) PT_COREDUMP kernel facility to write the core dump]' \ '::executable:' \ ':pid:_pids' ;; diff --git a/Completion/Unix/Command/_ifconfig b/Completion/Unix/Command/_ifconfig index 25ddd55bd..4e1f25e2e 100644 --- a/Completion/Unix/Command/_ifconfig +++ b/Completion/Unix/Command/_ifconfig @@ -20,10 +20,20 @@ case $OSTYPE in ) ;; freebsd*|dragonfly*) - args=( -s $updown - '(-a -l -u -d -m -L 1 *)-C[list interface cloners]' + args=( -s $updownlist + '(-a -j -f -l -G -g -u -d -m -L 1 *)-C[list interface cloners]' + '(-C)-f+[control the output format]: :_values -s, -S\: format + "addr[adjust inet address display]\:format [numeric]\:(default fqdn host numeric)" + "ether[adjust ethernet address display]\:format [colon]\:(colon dash dotted default)" + "inet[adjust inet subnet mask display]\:format [hex]\:(default cidr dotted hex)" + "inet6[adjust inet6 prefix display]\:format [numeric]\:(default cidr numeric)"' + '(-C)-G+[exclude members of the specified group]:group' + '(-C)-g+[limit output to members of the specified group]:group' + '(-C)-k[print keying information for the interface]' '(-l -C)-m[list supported media]' + '(-C)-n[disable automatic loading of network interface drivers]' '(-l -C)-L[show address lifetime as time offset]' + '(-C)-v[get more verbose status for an interface]' ) listopts=( active caps chan countries mac mesh regdomain roam txparam txpower @@ -37,6 +47,9 @@ case $OSTYPE in roam roam:rssi roam:rate roaming ) ;| + freebsd<14->.*) + args+=( '(-C)-j+[perform actions inside jail]:jail:_jails' ) + ;; dragonfly*) args+=( '-n[disable auto-loading of kernel network interface driver]' ) ;; diff --git a/Completion/Unix/Command/_iostat b/Completion/Unix/Command/_iostat index 1152b0d8b..d3943fcb4 100644 --- a/Completion/Unix/Command/_iostat +++ b/Completion/Unix/Command/_iostat @@ -34,7 +34,6 @@ case $OSTYPE:l in args+=( '-x[show extended disk statistics]' '-z[omit lines for devices with no activity]' - '(* -)-?[display a usage statement and exit]' ) ;; dragonfly*) @@ -126,6 +125,7 @@ case $OSTYPE:l in parser=( -s ) args=( '-c[display CPU utilization report]' + "--compact[don't break into sub-reports keeping metrics to a single line]" '-d[display device utilization report]' '--dec=-[specify the number of decimal places to use]:decimal places [2]:(0 1 2)' '-f[specify alternative directory to read device statistics from]:directory:_directories' diff --git a/Completion/Unix/Command/_ldd b/Completion/Unix/Command/_ldd index 3c7b088df..98ac41e14 100644 --- a/Completion/Unix/Command/_ldd +++ b/Completion/Unix/Command/_ldd @@ -30,8 +30,7 @@ else freebsd*) args=( '-a[show all objects that are needed by each loaded object]' - '-v[verbose listing of the dynamic linking headers]' - '-f+[specify format]:format:((%a\:program\ name %A\:environment\ name %o\:library\ name %p\:path\ to\ library %x\:load\ address))' + '*-f+[specify format]:format:((%a\:program\ name %A\:environment\ name %o\:library\ name %p\:path\ to\ library %x\:load\ address))' ) ;; esac diff --git a/Completion/Unix/Command/_ls b/Completion/Unix/Command/_ls index df14e7e2c..975a28196 100644 --- a/Completion/Unix/Command/_ls +++ b/Completion/Unix/Command/_ls @@ -96,6 +96,7 @@ if ! _pick_variant gnu=gnu unix --help; then if [[ $OSTYPE = freebsd* ]]; then arguments+=( '-,[print file sizes grouped and separated by thousands]' + '(-S -f -t -U)-v[sort by version (filename treated numerically)]' '-y[with -t, sort filenames in the same order as the time]' '-Z[display MAC label]' '--color=-[control use of color]:color:(never always auto)' @@ -163,12 +164,12 @@ else '(-a --all -U -l --format -s --size -t --sort --full-time)-f[unsorted, all, short list]' '(--reverse -r -U -f)'{--reverse,-r}'[reverse sort order]' - '(--sort -t -U -v -X)-S[sort by size]' - '(--sort -S -U -v -X)-t[sort by modification time]' - '(--sort -S -t -v -X)-U[unsorted]' - '(--sort -S -t -U -X)-v[sort by version (filename treated numerically)]' - '(--sort -S -t -U -v)-X[sort by extension]' - '(-S -t -U -v -X)--sort=[specify sort key]:sort key:(size time none version extension)' + '(--sort -f -t -U -v -X)-S[sort by size]' + '(--sort -f -S -U -v -X)-t[sort by modification time]' + '(--sort -f -S -t -v -X)-U[unsorted]' + '(--sort -f -S -t -U -X)-v[sort by version (filename treated numerically)]' + '(--sort -f -S -t -U -v)-X[sort by extension]' + '(-S -f -t -U -v -X)--sort=[specify sort key]:sort key:(size time none version extension)' '--color=-[control use of color]:color:(never always auto)' "*--hide=[like -I, but overridden by -a or -A]:pattern: " diff --git a/Completion/Unix/Command/_mktemp b/Completion/Unix/Command/_mktemp index 03fc89e36..0f66d744e 100644 --- a/Completion/Unix/Command/_mktemp +++ b/Completion/Unix/Command/_mktemp @@ -1,43 +1,45 @@ #compdef mktemp gmktemp local variant -local args +local -a args -_pick_variant -r variant busybox=BusyBox gnu='Free Soft' unix --version +_pick_variant -r variant busybox=BusyBox gnu='Free Soft' $OSTYPE --version args=( '(-d --directory)'{-d,--directory}'[make directory instead of file]' - '(: -)--help[display help information]' - '(-p --tmpdir)'{-p+,--tmpdir=}'[make relative to specified directory]: :_directories' '(-q --quiet)'{-q,--quiet}'[suppress error messages]' - '--suffix=[append specified suffix to template]:template suffix' - '-t[interpret template as single path component relative to temp dir]' '(-u --dry-run)'{-u,--dry-run}'[print file name only]' - '(: -)'{-V,--version}'[display version information]' - '1: :_guard "^-*" "template name"' ) -# Non-GNU variants don't support long options (except BusyBox's --help) -if [[ $variant == *busybox* ]]; then # See also: _busybox - args=( ${args:#((#s)|*\))(\*|)--^help*} ) -elif [[ $variant != gnu ]]; then - args=( ${args:#((#s)|*\))(\*|)--*} ) -fi - -[[ $variant == gnu ]] || { - # BusyBox, OpenBSD, and Solaris have -p, but -t doesn't take an argument - if [[ $variant == *busybox* ]] || [[ $OSTYPE == (openbsd|solaris)* ]]; then - args=( ${args:#((#s)|*\))(\*|)-t*} ) - args+=( '-t[generate template relative to temp dir]' ) - # Dragonfly, FreeBSD, and Darwin take an argument to -t and support any number - # of template files. These OSes do not have -p and -V. - else - args=( ${args:#((#s)|*\))(1:*|(\*|)-[ptV]*)} ) +case $variant in + ^(dragonfly|darwin)*) + args+=( '(-p --tmpdir)'{-p+,--tmpdir=}'[make relative to specified directory]: :_directories' ) + ;| + gnu) + args+=( + '--suffix=[append specified suffix to template]:template suffix' + '(: -)'{-V,--version}'[display version information]' + ) + ;| + # Most variants don't support long options (except BusyBox's --help) + ^(gnu|freebsd*)) + args=( ${args:#((#s)|*\))(\*|)--*} ) + ;| + gnu|*busybox*) + args+=( '(: -)--help[display help information]' ) + ;| + (gnu|*busybox|openbsd|solaris)*) + args+=( + '-t[generate template relative to temp dir]' + '1: :_guard "^-*" "template name"' + ) + ;; + (dragonfly|netbsd|freebsd|darwin)*) args+=( '-t[generate template relative to temp dir using specified prefix]:template prefix' '*: :_guard "^-*" "template name"' ) - fi -} + ;; +esac _arguments -s -S : $args diff --git a/Completion/Unix/Command/_netstat b/Completion/Unix/Command/_netstat index 8016b2475..35d639f99 100644 --- a/Completion/Unix/Command/_netstat +++ b/Completion/Unix/Command/_netstat @@ -302,6 +302,9 @@ case $OSTYPE in memory+=( $Xopt) statistics+=( $Xopt ) pcb+=( $Mopts $popt ) ;; + freebsd<14->.*) + args+=( '-j+[run inside a jail]:jail:_jails' ) + ;& freebsd<13->.*) sockets+=( '-c[show TCP stack used for each session]' diff --git a/Completion/Unix/Command/_script b/Completion/Unix/Command/_script index f39cfe535..d38d56f2e 100644 --- a/Completion/Unix/Command/_script +++ b/Completion/Unix/Command/_script @@ -47,7 +47,7 @@ case $OSTYPE in '-q[be quiet: suppress display of starting and ending lines]' '(-a -r -k)-d[suppress sleeps when playing back a session]' '(-a -r -k -t)-p[play back a recorded session]' - '(-d -p)-r[record a session with input, output and timing data]' + '(-d -p -T)-r[record a session with input, output and timing data]' ) ;| netbsd*|openbsd*) @@ -60,7 +60,9 @@ case $OSTYPE in ;| freebsd*) args+=( + '-e[return exit status of the child process]' '-f[use filemon(4)]' + '(-a -r -k -t)-T[play back a recorded session, reporting only timestamps]: :_date_formats' ) ;| darwin*|dragonfly*|freebsd*) @@ -71,8 +73,6 @@ case $OSTYPE in '*:::arguments: _normal $service' ) ;| - darwin*|freebsd*) - ;| *) args+=( '(-p -d)-a[append output]' diff --git a/Completion/Unix/Command/_service b/Completion/Unix/Command/_service index 1216f57a8..28563429b 100644 --- a/Completion/Unix/Command/_service +++ b/Completion/Unix/Command/_service @@ -10,8 +10,11 @@ zstyle -T ":completion:${ctx}" tag-order && \ zstyle ":completion:${ctx}" tag-order init case $OSTYPE in + freebsd<14->.*) + args=( '-E+[set environment variable before executing the rc.d script]:variable:_parameters -g "*export*~*readonly*" -S=' ) + ;& freebsd<11->.*) - args=( '-j+[perform actions in specified jail]:jail:_jails' ) + args+=( '-j+[perform actions in specified jail]:jail:_jails' ) ;& freebsd*|dragonfly*) actions=( diff --git a/Completion/Unix/Command/_split b/Completion/Unix/Command/_split index c5ab0dc9b..5ecc1bb67 100644 --- a/Completion/Unix/Command/_split +++ b/Completion/Unix/Command/_split @@ -8,7 +8,7 @@ _pick_variant -r variant gnu=GNU $OSTYPE --version args=( '-a+[generate suffixes of specified length]:length [2]' \ - '(-l -p -n)-b+[put specified size in bytes in each output file]:size (bytes)' \ + '(-l -p -n)-b+[put specified size in bytes in each output file]: :_numbers -u bytes size k m g' \ '(-b -p -n)-l+[put specified number of lines/records in each output file]:lines' \ '1:file:_files' \ '2: :_guard "^-*" "prefix [x]"' @@ -19,8 +19,8 @@ case $variant in args=( -C '(H -a --suffix-length)'{-a+,--suffix-length=}'[generate suffixes of specified length]:length [2]' '(H)--additional-suffix=[append an additional suffix to file names]:suffix' - '(H -b --bytes -C --line-bytes -l --lines -n --number)'{-b+,--bytes=}'[put specified size in bytes in each output file]:size (bytes)' - '(H -b --bytes -C --line-bytes -l --lines -n --number)'{-C+,--line-bytes=}'[put whole lines/records up to size limit in each output file]:size (bytes)' + '(H -b --bytes -C --line-bytes -l --lines -n --number)'{-b+,--bytes=}'[put specified size in each output file]: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size {K,M,G,T,P,E,Z}{,B}' \ + '(H -b --bytes -C --line-bytes -l --lines -n --number)'{-C+,--line-bytes=}'[put whole lines/records up to size limit in each output file]: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size {K,M,G,T,P,E,Z}{,B}' '(H --numeric-suffixes -x --hex-suffixes)-d[use numeric suffixes starting at 0]' '(H -d -x --hex-suffixes)--numeric-suffixes=-[use numeric suffixes]::start value [0]' '(H -d --numeric-suffixes --hex-suffixes)-x[use hex suffixes starting at 0]' @@ -47,7 +47,12 @@ case $variant in '(-b -l -n)-p+[split the file whenever a line matches specified pattern]:pattern' ) ;| - freebsd*) args+=( '-d[use numeric suffixes]' ) ;; + freebsd*) + args+=( + '-d[use numeric suffixes]' + "-c[continue creating files and don't overwrite existing output files]" + ) + ;; esac _arguments -s -S $args && ret=0 diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index 0ba1f3775..dc3979a58 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -57,7 +57,7 @@ _ssh () { "-N[don't execute a remote command]" \ '-n[redirect stdin from /dev/null]' \ '-O+[control an active connection multiplexing master process]:multiplex control command:((check\:"check master process is running" exit\:"request the master to exit" forward\:"request forward without command execution" stop\:"request the master to stop accepting further multiplexing requests" cancel\:"cancel existing forwardings with -L and/or -R" proxy))' \ - '-P[use non privileged port]' \ + '-P+[specify a tag name that may be used to select configuration]:tag' \ '-p+[specify port on remote host]:port number on remote host' \ '(-v)*-q[quiet operation]' \ '*-R+[specify remote port forwarding]:remote port forwarding:->forward' \ diff --git a/Completion/Unix/Command/_sysctl b/Completion/Unix/Command/_sysctl index 0416ca05e..442953c4d 100644 --- a/Completion/Unix/Command/_sysctl +++ b/Completion/Unix/Command/_sysctl @@ -28,6 +28,12 @@ case $OSTYPE in '(- :)'{-V,--version}'[display version info and exit]' \ '*:sysctl variable:_files -W /proc/sys' ;; + freebsd<14->.*) + args+=( + '-F[print the format of the variable]' + '(-N)-l[show the length of variables along with their values]' + ) + ;| freebsd<11->.*) args+=( '-B[specify buffer size for reading]:buffer size' @@ -53,7 +59,7 @@ case $OSTYPE in '-d[print the description of the variable instead of its value]' \ '(-N -n)-e[separate name and value with =]' \ "-i[silently exit if variable doesn't exist]" \ - '(-n)-N[show only variable names]' \ + '(-n -l)-N[show only variable names]' \ '(-N)-n[show only variable values]' \ '(-x)-o[show opaques as well (values suppressed)]' \ '-q[suppress some warnings]' \ diff --git a/Completion/Unix/Type/_diff_options b/Completion/Unix/Type/_diff_options index 2646527df..45b777dfe 100644 --- a/Completion/Unix/Type/_diff_options +++ b/Completion/Unix/Type/_diff_options @@ -1,6 +1,6 @@ #autoload -local of ofwuc ouc oss ofwy ofwg ofwl cmd variant +local of ofwuc ouc oss ofwy ofwg ofwl cmd variant ign local -a args cmd="$1" @@ -26,6 +26,8 @@ _diff_palette() { } if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12->.* ]]; then + (( $#words > 2 )) && ign='!' + # output formats of="-y --side-by-side -n --rcs -e -f --ed -q --brief -c -C --context -u -U \ --unified --old-group-format --new-group-format --changed-group-format \ @@ -61,23 +63,19 @@ if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12-> --unchanged-group-format" if [[ $variant = gnu ]]; then - (( $#words > 2 )) || args+=( - '(-v --version)'{-v,--version}'[display version information]' - '--help[display usage information]' - ) args+=( '(-H --speed-large-files)'{-H,--speed-large-files}'[assume large files and many small changes]' '(-E --ignore-tab-expansion)'{-E,--ignore-tab-expansion}'[ignore changes due to tab expansion]' '(-Z --ignore-trailing-space)'{-Z,--ignore-trailing-space}'[ignore white space at line end]' - "($ofwuc $oss -F --show-function-line)"{-F+,--show-function-line=}'[show the most recent line matching regex]:regex' "($ofwy $ouc)--left-column[output only left column of common lines]" "($ofwg $ouc $oss)--old-group-format=[set old group format]:old group format" "($ofwg $ouc $oss)--new-group-format=[set new group format]:new group format" "($ofwl $ouc $oss)--unchanged-line-format=[set unchanged line format]:unchanged line format" - '(--to-file)--from-file=[compare specified file to all operands]:from file:_files' \ - '(--from-file)--to-file=[compare all operands to specified file]:to file:_files' \ + '(--to-file)--from-file=[compare specified file to all operands]:from file:_files' + '(--from-file)--to-file=[compare all operands to specified file]:to file:_files' '--color=-[use colors in output]::when [auto]:(never always auto)' '--palette=[specify colors to use]:color:_diff_palette' + "${ign}(1 2)-v[display version information]" ) else args+=( '!--speed-large-files' ) @@ -99,6 +97,7 @@ if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12-> "($of $oss)-u[output a unified diff]" \ "($ofwuc $oss)*"{-L+,--label=}'[set label to use instead of file name and timestamp]:label' \ "($ofwuc $oss -p --show-c-function)"{-p,--show-c-function}'[show C function of each change]' \ + "($ofwuc $oss -F --show-function-line)"{-F+,--show-function-line=}'[show the most recent line matching regex]:regex' \ "($of $ouc $oss)"{-q,--brief}'[output only whether files differ]' \ "($of $ouc $oss -e --ed)"{--ed,-e}'[output an ed script]' \ "!($of $ouc $oss)--normal" \ @@ -127,6 +126,8 @@ if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12-> "($of $ouc)"{-y,--side-by-side}'[output in two columns]' \ "($ofwy $ouc)--suppress-common-lines[don't output common lines]" \ "($ofwy $ouc --width -W)"{--width=,-W+}'[set size of line]:number of characters per line' \ + "${ign}(1 2)--version[display version information]" \ + "${ign}(1 2)--help[display usage information]" \ "$@" else of='-c -e -f' -- cgit v1.2.3 From 6306dcfaa52237fbaa76eafe7bc396e68eda66ca Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 17 Nov 2023 18:13:41 +0100 Subject: 52303: updates to completions for macOS 13 --- ChangeLog | 14 ++++++++++++++ Completion/Unix/Command/_chown | 7 ++++++- Completion/Unix/Command/_cp | 8 +++++--- Completion/Unix/Command/_cut | 2 +- Completion/Unix/Command/_date | 20 +++++++++----------- Completion/Unix/Command/_du | 8 ++++---- Completion/Unix/Command/_env | 4 +++- Completion/Unix/Command/_id | 4 ++-- Completion/Unix/Command/_ifconfig | 18 ++++++++++++------ Completion/Unix/Command/_ln | 12 ++++-------- Completion/Unix/Command/_ls | 33 +++++++++++++++++++-------------- Completion/Unix/Command/_make | 2 +- Completion/Unix/Command/_mount | 8 ++++++-- Completion/Unix/Command/_mv | 12 ++++++------ Completion/Unix/Command/_rm | 6 +----- Completion/Unix/Command/_sed | 5 ++--- Completion/Unix/Command/_split | 4 ++-- Completion/Unix/Command/_touch | 2 +- Completion/Unix/Command/_uniq | 2 +- Completion/Unix/Command/_xargs | 2 +- 20 files changed, 100 insertions(+), 73 deletions(-) (limited to 'Completion/Unix/Command/_date') diff --git a/ChangeLog b/ChangeLog index 0de5c2fcb..5b50aa342 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2023-11-17 Oliver Kiddle + + * 52303: Completion/Unix/Command/_ifconfig, + Completion/Unix/Command/_chown, Completion/Unix/Command/_cp, + Completion/Unix/Command/_cut, Completion/Unix/Command/_date, + Completion/Unix/Command/_du, Completion/Unix/Command/_env, + Completion/Unix/Command/_id, Completion/Unix/Command/_ln, + Completion/Unix/Command/_ls, Completion/Unix/Command/_make, + Completion/Unix/Command/_mount, Completion/Unix/Command/_mv, + Completion/Unix/Command/_rm, Completion/Unix/Command/_sed, + Completion/Unix/Command/_split, Completion/Unix/Command/_touch, + Completion/Unix/Command/_uniq, Completion/Unix/Command/_xargs: + updates to completions for macOS 13 + 2023-11-15 Bart Schaefer * 52309: Src/exec.c: suppress job control inside <<(substition) diff --git a/Completion/Unix/Command/_chown b/Completion/Unix/Command/_chown index 9ebbf7bab..4362d6e75 100644 --- a/Completion/Unix/Command/_chown +++ b/Completion/Unix/Command/_chown @@ -43,7 +43,7 @@ case "$variant" in '(-H -L -P)-P[do not follow symlinks (default)]' ) ;| - dragonfly*|freebsd*) + dragonfly*|freebsd*|darwin*) args+=( "-x[don't traverse file systems]" ) @@ -63,6 +63,11 @@ case "$variant" in '-s[owner and/or group are Windows SID strings]' ) ;; + darwin*) + args+=( + '-n[interpret user and group as numeric, avoiding name lookups]' + ) + ;; esac (( $+words[(r)--reference*] )) || args+=( '(--reference)1: :->owner' ) diff --git a/Completion/Unix/Command/_cp b/Completion/Unix/Command/_cp index f7411055b..da9428ce3 100644 --- a/Completion/Unix/Command/_cp +++ b/Completion/Unix/Command/_cp @@ -51,14 +51,16 @@ else '(aix|hpux|irix|solaris)*' '-r[copy directories recursively]' \ 'solaris2.<9->*' '-@[preserve extended attributes]' \ 'solaris2.<11->*' '-/[preserve extended attributes and extended system attributes]' \ + 'solaris2.<11->*' '-z[fast relink(3C) based copy]' \ '(darwin|dragonfly|freebsd)*' "(-f -i)-n[don't overwrite existing file]" \ 'netbsd*' "-N[don't copy file flags]" \ '(darwin|dragonfly|freebsd|netbsd|openbsd)*' '-a[archive mode, same as -RpP]' \ - '(dragonfly|freebsd)*' '-l[link files instead of copying]' \ + '(dragonfly|freebsd|darwin)*' '-l[link files instead of copying]' \ '(darwin|dragonfly|*bsd)*' '-v[show file names as they are copied]' \ 'darwin*' "-X[don't copy extended attributes or resource forks]" \ - '(dragonfly|freebsd)*' "-x[don't traverse file systems]" \ - 'freebsd<10->.*' '-s[make symbolic links instead of copies of non-directories]' + '(dragonfly|freebsd|darwin)*' "-x[don't traverse file systems]" \ + '(freebsd<10->.|darwin)*' '-s[make symbolic links instead of copies of non-directories]' \ + 'darwin*' '-c[copy files using clonefile(2)]' do [[ $OSTYPE = $~pattern ]] && args+=( $arg ) done diff --git a/Completion/Unix/Command/_cut b/Completion/Unix/Command/_cut index 29565280d..778439cf1 100644 --- a/Completion/Unix/Command/_cut +++ b/Completion/Unix/Command/_cut @@ -46,7 +46,7 @@ if _pick_variant gnu="Free Soft" unix --version; then '*:file:_files' else case $OSTYPE in - freebsd*|dragonfly*) args=( '(-d)-w[use whitespace as the delimiter]' ) ;; + freebsd*|dragonfly*|darwin*) args=( '(-d)-w[use whitespace as the delimiter]' ) ;; esac _arguments $args \ "-b[${_cut_args[bytes]}]:list" \ diff --git a/Completion/Unix/Command/_date b/Completion/Unix/Command/_date index a15d30b21..f0053ec02 100644 --- a/Completion/Unix/Command/_date +++ b/Completion/Unix/Command/_date @@ -7,8 +7,8 @@ local -a opts args opts=( -s -w -C ) if _pick_variant gnu="Free Software Foundation" unix --version; then - local d='(-d --date -f --file -r --reference -s --set)' - local f='(-I --iso-8601 -R --rfc-email --rfc-3339)' + local d='(-d --date -f --file -r --reference -s --set --resolution)' + local f='(-I --iso-8601 -R --rfc-email --rfc-3339 --resolution)' args=( $d{-d+,--date=}'[output date specified by string]:time string' '--debug[annotate parsed date and warn about questionable usage]' @@ -16,10 +16,10 @@ if _pick_variant gnu="Free Software Foundation" unix --version; then $d{-r+,--reference=}'[output last modification time of specified file]:file:_files' $d{-s+,--set=}'[set time]:time string' $f{-I-,--iso-8601=-}'[display in ISO 8601 format]::precision:(date hours minutes seconds ns)' + '(-)--resolution[output the available resolution of timestamps]' $f{-R,--rfc-email}'[display in RFC5322 format]' $f'--rfc-3339=-[display in RFC 3339 format]:precision:(date seconds ns)' - '(-u --utc --universal)'{-u,--utc,--universal}'[display or set time in UTC]' - $d'--resolution[output the available resolution of timestamps]' + '(-u --utc --universal --resolution)'{-u,--utc,--universal}'[display or set time in UTC]' '(- :)--help[output help and exit]' '(- :)--version[output version info and exit]' ) @@ -44,12 +44,12 @@ else '-f+[use specified format for input]:parsing format:_date_formats:new date' ) ;| - dragonfly*|darwin*|netbsd*|openbsd*) + dragonfly*|netbsd*|openbsd*) args+=( '-r+[output date specified by reference time]:seconds since epoch' ) ;| - freebsd*) + freebsd*|darwin*) local -a alts alts=( 'seconds:sec:_guard "(0x[0-9a-fA-F]#|[0-9]#)" "seconds since epoch"' @@ -57,23 +57,21 @@ else ) args+=( '-r+[reference time: file modification or literal time]:reference: _alternative $alts' - '(-R)-I-[display in ISO 8601 format]::precision:(date hours minutes seconds)' ) ;| freebsd*|dragonfly*|darwin*) args+=( + '-R[display in RFC2822 format]' + '(-R)-I-[display in ISO 8601 format]::precision [date]:(date hours minutes seconds)' "*-v+[adjust and print (but don't set) date]:[+-]value[ymwdHMS]" ) ;| - freebsd<-12>.*|darwin*) + freebsd<-12>.*) args+=( '-d+:daylight saving time value' '-t+:minutes west of GMT' ) ;| - freebsd*|dragonfly*) - args+=( '-R[display in RFC2822 format]' ) - ;| openbsd*|netbsd*) args+=( '-a[gradually skew]' ) ;| freebsd<14->.*|openbsd*) diff --git a/Completion/Unix/Command/_du b/Completion/Unix/Command/_du index 711f43471..ccb5bdd94 100644 --- a/Completion/Unix/Command/_du +++ b/Completion/Unix/Command/_du @@ -55,7 +55,7 @@ else ) local xdev='[skip directories on different filesystems]' for pattern arg in \ - 'freebsd*' '-A[apparent size instead of usage]' \ + '(freebsd|darwin)*' '-A[apparent size instead of usage]' \ '(darwin*|*bsd*|dragonfly*|solaris2.<10->)' '(-H -L -P)-H[follow symlinks on the command line]' \ '(darwin|*bsd|dragonfly)*' '(-H -L -P)-P[do not follow symlinks (default)]' \ '(darwin|dragonfly|freebsd)*' '*-I+[ignore files/directories matching specified mask]:mask' \ @@ -64,12 +64,12 @@ else 'netbsd*' '-i[output inode usage instead of blocks]' \ '(darwin*|freebsd*|netbsd*|solaris2.<11->)' '(-h -k -g -B)-m[use block size of 1M-byte]' \ '(darwin|freebsd<8->.|netbsd)*' '(-h -k -m -B)-g[use block size of 1G-byte]' \ - 'freebsd*' '(-h -k -m -g)-B+[block size]:block size (bytes)' \ + '(freebsd|darwin)*' '(-h -k -m -g)-B+[block size]:block size (bytes)' \ '(darwin|*bsd|dragonfly)*' '-c[display grand total]' \ - 'freebsd*' '-l[count sizes many times if hard linked]' \ + '(freebsd|darwin)*' '-l[count sizes many times if hard linked]' \ '(freebsd|netbsd)*' '-n[ignore files and directories with nodump flag set]' \ 'solaris*' "(-a)-o[don't add child directories' usage to parent's total]" \ - 'freebsd<8->.*' '-t+[report only entries for which size exceeds threshold]:threshold' \ + '(freebsd|darwin)*' '-t+[report only entries for which size exceeds threshold]:threshold' \ 'solaris*' "-d$xdev" \ '(darwin|*bsd|dragonfly|solaris)*' "-x$xdev" do diff --git a/Completion/Unix/Command/_env b/Completion/Unix/Command/_env index bdab71bbe..8cf0ad467 100644 --- a/Completion/Unix/Command/_env +++ b/Completion/Unix/Command/_env @@ -24,11 +24,13 @@ case $variant in ;; freebsd*) args=( - '-0[use NUL, not newline after each variable in output]' '-L[add variables from system login.conf(5)]: :->user-class' '-U[add variables from user and system login.conf(5)]: :->user-class' ) ;| + freebsd*|darwin*) + args=( '-0[use NUL, not newline after each variable in output]' ) + ;| freebsd*|darwin*|dragonfly*) args+=( '(-i)*-u+[remove variable from the environment]:env var to remove:_parameters -g "*export*"' diff --git a/Completion/Unix/Command/_id b/Completion/Unix/Command/_id index a0a03faad..c123afcd7 100644 --- a/Completion/Unix/Command/_id +++ b/Completion/Unix/Command/_id @@ -41,13 +41,13 @@ else darwin*|dragonfly*|freebsd*) args+=( '(-)-P[print id in the form of a password file entry]' ) ;| - darwin*|freebsd*) + freebsd*) args+=( '(-)-A[print process audit user ID]' '(-)-M[print MAC label of the current process]' + '(-)-c[print current login class]' ) ;| - freebsd*) args+=( '(-)-c[print current login class]' ) ;| darwin*|dragonfly*|freebsd*|netbsd*|openbsd*) args+=( '(-)-p[human readable output]' ) ;; diff --git a/Completion/Unix/Command/_ifconfig b/Completion/Unix/Command/_ifconfig index 4e1f25e2e..86ec46038 100644 --- a/Completion/Unix/Command/_ifconfig +++ b/Completion/Unix/Command/_ifconfig @@ -13,15 +13,16 @@ updownlist=( case $OSTYPE in darwin*) - args=( -s $updownlist ) + args=( -s $updownlist + '-X+[list interfaces whose names match regular expression]:regex:_net_interfaces' + ) opts=( $alias $debug delete dest_address ipdst nsellength {,-}trailers {,-}link{0,1,2} ) - ;; + ;| freebsd*|dragonfly*) args=( -s $updownlist - '(-a -j -f -l -G -g -u -d -m -L 1 *)-C[list interface cloners]' '(-C)-f+[control the output format]: :_values -s, -S\: format "addr[adjust inet address display]\:format [numeric]\:(default fqdn host numeric)" "ether[adjust ethernet address display]\:format [colon]\:(colon dash dotted default)" @@ -30,10 +31,7 @@ case $OSTYPE in '(-C)-G+[exclude members of the specified group]:group' '(-C)-g+[limit output to members of the specified group]:group' '(-C)-k[print keying information for the interface]' - '(-l -C)-m[list supported media]' '(-C)-n[disable automatic loading of network interface drivers]' - '(-l -C)-L[show address lifetime as time offset]' - '(-C)-v[get more verbose status for an interface]' ) listopts=( active caps chan countries mac mesh regdomain roam txparam txpower @@ -47,6 +45,14 @@ case $OSTYPE in roam roam:rssi roam:rate roaming ) ;| + freebsd*|darwin*|dragonfly*) + args+=( + '(-a -j -f -l -G -g -u -d -m -L 1 *)-C[list interface cloners]' + '(-l -C)-m[list supported media]' + '(-l -C)-L[show address lifetime as time offset]' + '(-C)-v[get more verbose status for an interface]' + ) + ;| freebsd<14->.*) args+=( '(-C)-j+[perform actions inside jail]:jail:_jails' ) ;; diff --git a/Completion/Unix/Command/_ln b/Completion/Unix/Command/_ln index 9d5efcabb..7bd2f7f27 100644 --- a/Completion/Unix/Command/_ln +++ b/Completion/Unix/Command/_ln @@ -45,9 +45,11 @@ case $variant; in {-h,-n}'[do not dereference destination]' '(-f)-i[prompt before removing destination files]') ;; - darwin*|dragonfly*|freebsd*|netbsd*|openbsd*) + darwin*|dragonfly*|*bsd*) args+=( - {-h,-n}'[do not dereference destination]' + {-h,-n}"[don't dereference destination]" + '(-L)-P[create hard links directly to symbolic links]' + '(-P)-L[create hard links to symbolic link references]' ) ;| darwin*|dragonfly*|freebsd*|netbsd*) @@ -57,12 +59,6 @@ case $variant; in '-v[print name of each linked file]' ) ;| - dragonfly*|freebsd*|netbsd*|openbsd*) - args+=( - '(-L)-P[create hard links directly to symbolic links]' - '(-P)-L[create hard links to symbolic link references]' - ) - ;| dragonfly*|freebsd*|netbsd*) args+=( "-w[warn if source of a symbolic link doesn't currently exist]" diff --git a/Completion/Unix/Command/_ls b/Completion/Unix/Command/_ls index 975a28196..392b8490b 100644 --- a/Completion/Unix/Command/_ls +++ b/Completion/Unix/Command/_ls @@ -75,12 +75,12 @@ if ! _pick_variant gnu=gnu unix --help; then if [[ $OSTYPE = (dragonfly*|freebsd*|darwin*) ]]; then arguments+=( '-G[enable colorized output]' + '(-A)-I[prevent -A from being automatically set for the super-user]' '-P[do not follow symlinks]' ) fi if [[ $OSTYPE = (dragonfly*|freebsd*) ]]; then arguments+=( - '(-A)-I[prevent -A from being automatically set for the super-user]' '(-1 -C -m -x)-D+[specify format for date]:format: _date_formats' ) fi @@ -91,15 +91,17 @@ if ! _pick_variant gnu=gnu unix --help; then ) fi if [[ $OSTYPE = (freebsd*|darwin*) ]]; then - arguments+=( '(-c -u)-U[file creation time]' ) + arguments+=( + '-,[print file sizes grouped and separated by thousands]' + '(-c -u)-U[file creation time]' + '-y[with -t, sort filenames in the same order as the time]' + '--color=-[control use of color]:color:(never always auto)' + ) fi if [[ $OSTYPE = freebsd* ]]; then arguments+=( - '-,[print file sizes grouped and separated by thousands]' '(-S -f -t -U)-v[sort by version (filename treated numerically)]' - '-y[with -t, sort filenames in the same order as the time]' '-Z[display MAC label]' - '--color=-[control use of color]:color:(never always auto)' ) fi if [[ $OSTYPE = darwin* ]]; then @@ -109,6 +111,7 @@ if ! _pick_variant gnu=gnu unix --help; then '(-l -1 -C -m -x)-o[long listing but without group information]' '-O[display file flags]' '-v[print raw characters]' + '-%[distinguish dataless files and directories with a %]' ) fi if [[ $OSTYPE = solaris* ]]; then @@ -140,8 +143,8 @@ else '(--recursive -R)'{--recursive,-R}'[list subdirectories recursively]' '(--no-group -G)'{--no-group,-G}'[inhibit display of group information]' - '(--block-size --human-readable -h --si --kilobytes -k)'{--human-readable,-h}'[print sizes in human readable form]' - '(--block-size --human-readable -h --si --kilobytes -k)--si[sizes in human readable form; powers of 1000]' + '(--block-size --human-readable -h --si --kibibytes -k)'{--human-readable,-h}'[print sizes in human readable form]' + '(--block-size --human-readable -h --si --kibibytes -k)--si[sizes in human readable form; powers of 1000]' '(--inode -i)'{--inode,-i}'[print file inode numbers]' '(--format -l -g -o -1 -C -m -x)-l[long listing]' @@ -149,16 +152,16 @@ else --group-directories-first '(--format -l --no-group -G -1 -C -m -x)-o[no group, long]' '(--format -l -g -o -C -m -x)-1[single column output]' - '(--format -l -g -o -1 -m -x)-C[list entries in columns sorted vertically]' - '(--format -l -g -o -1 -C -x)-m[comma separated]' - '(--format -l -g -o -1 -C -m)-x[sort horizontally]' + '(--format -l -g -o -1 -m -x --block-size --human-readable -h --si --kibibytes -k)-C[list entries in columns sorted vertically]' + '(--format -l -g -o -1 -C -x --block-size --human-readable -h --si --kibibytes -k)-m[comma separated]' + '(--format -l -g -o -1 -C -m --block-size --human-readable -h --si --kibibytes -k)-x[sort horizontally]' '(-l -g -o -1 -C -m -x)--format=[specify output format]:format:(verbose long commas horizontal across vertical single-column)' '(--size -s -f)'{--size,-s}'[display size of each file in blocks]' '(--time -u)-c[status change time]' '(--time -c)-u[access time]' - '(-c -u)--time=[specify time to show]:time:(ctime status use atime access)' + '(-c -u)--time=[specify time to show]:time:(ctime status use atime access birth creation)' '--time-style=[show times using specified style]:style: _alternative "time-styles\:time style\:(full-iso long-iso iso locale)" $datef' '(-a --all -U -l --format -s --size -t --sort --full-time)-f[unsorted, all, short list]' @@ -174,15 +177,16 @@ else '--color=-[control use of color]:color:(never always auto)' "*--hide=[like -I, but overridden by -a or -A]:pattern: " '--hyperlink=[output terminal codes to link files using file::// URI]::when:(none auto always)' - '(--classify -F --indicator-style -p --file-type)'{--classify,-F}'[append file type indicators]' + '(--classify -F --indicator-style -p --file-type)-F[append file type indicators]' + '(--classify -F --indicator-style -p --file-type)--classify=-[append file type indicators]::when [always]:(none auto always)' '(--file-type -p --indicator-style -F --classify)--file-type[append file type indicators except *]' '(--file-type -p --indicator-style -F --classify)-p[append / to directories]' '(-F --classify -p --file-type)--indicator-style=[specify indicator style]:indicator style:(none file-type classify slash)' '(-f)--full-time[list both full date and full time]' - '(--block-size --human-readable -h --si --kilobytes -k)'{--kilobytes,-k}'[use block size of 1k]' - '(--human-readable -h --si --kilobytes -k)--block-size=[specify block size]:block size (bytes):(K M G T P E Z Y KB MB TB PB EB ZB YB)' + '(--block-size --human-readable -h --si --kibibytes -k)'{--kibibytes,-k}'[use block size of 1k]' + '(--human-readable -h --si --kibibytes -k -C -x)--block-size=[specify block size]:block size (bytes):(K M G T P E Z Y KB MB TB PB EB ZB YB)' '(--numeric-uid-gid -n)'{--numeric-uid-gid,-n}'[numeric uid, gid]' '(--tabsize -T)'{--tabsize=,-T+}'[specify tab size]:tab size' @@ -195,6 +199,7 @@ else '(--hide-control-chars -q --show-control-chars)'{--hide-control-chars,-q}'[hide control chars]' '(-q --hide-control-chars)--show-control-chars' + '--zero[end each output line with NUL, not newline]' '(- :)--help[display help information]' '(- :)--version[display version information]' '*:file:_files' diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make index d5ec6423d..99c786dc7 100644 --- a/Completion/Unix/Command/_make +++ b/Completion/Unix/Command/_make @@ -1,4 +1,4 @@ -#compdef make gmake pmake dmake freebsd-make bmake +#compdef make gmake gnumake pmake dmake freebsd-make bmake # TODO: Based on targets given on the command line, show only variables that # are used in those targets and their dependencies. diff --git a/Completion/Unix/Command/_mount b/Completion/Unix/Command/_mount index 301b9e58e..5a379b424 100644 --- a/Completion/Unix/Command/_mount +++ b/Completion/Unix/Command/_mount @@ -40,12 +40,13 @@ fi # are below these table. local curcontext="$curcontext" state line expl suf ret=1 -local args deffs=iso9660 tmp typeops=-t _nfs_access _fs_nfs _nfs_ufs \ +local deffs=iso9660 tmp typeops=-t _nfs_access _fs_nfs _nfs_ufs \ _fs_ufs _fs_efs _fs_cd9660 _fs_iso9660 _fs_cachefs _fs_s5fs _fs_tmpfs _fs_pcfs \ _fs_hsfs _fs_advfs _fs_cdfs _fs_affs _fs_ext2 _fs_fat _fs_ext3 _fs_msdos \ _fs_msdosfs _fs_umsdos _fs_vfat _fs_hpfs _fs_ntfs _fs_reiserfs _fs_smbfs \ _fs_xfs _fs_std _fs_devfs _fs_fdesc _fs_kernfs _fs_linprocfs _fs_linsysfs \ _fs_procfs _fs_btrfs _fs_ext4 +local -a args typeset -A opt_args @@ -735,8 +736,11 @@ if [[ "$service" = mount ]]; then deffs=hsfs typeops=-F ;; + darwin*) + args=( '-k[follow no symlinks in the provided mount-on directory]' ) + ;& freebsd*|dragonfly*|darwin*) - args=( -s + args=( -s $args '(:)-a[mount all filesystems in fstab]' '-d[cause everything to be done except for the actual system call]' '-f[forced mount]' diff --git a/Completion/Unix/Command/_mv b/Completion/Unix/Command/_mv index 84e43d47e..c52e7a5e4 100644 --- a/Completion/Unix/Command/_mv +++ b/Completion/Unix/Command/_mv @@ -13,13 +13,17 @@ case $variant; in {existing,nil}"[numbered backups, if they already exist]" {simple,never}"[always make simple backups]"' '(-b --backup -n --no-clobber)-b[make a backup of each existing destination file]' + '(-v)--debug[explain how a file is copied]' '(-f --force -i --interactive -n --no-clobber)'{-f,--force}"[don't prompt before overwriting]" '(-f --force -i --interactive -n --no-clobber)'{-i,--interactive}'[prompt before overwriting existing file]' + '(-f --force -i --interactive -n --no-clobber)'{-n,--no-clobber}"[don't overwrite existing file]" + "--no-copy[don't copy if renaming fails]" '--strip-trailing-slashes[remove any trailing slashes from each source argument]' '(-S --suffix)'{-S+,--suffix=}'[specify the backup suffix]:backup suffix [~]' '(-t --target-directory)'{-t+,--target-directory=}'[move all source arguments into specified directory]:directory:_directories' '(-T --no-target-directory)'{-T,--no-target-directory}'[treat final argument as a normal file]' - '(-u --update)'{-u,--update}'[move only when destination file is older or missing]' + '(-u)--update=-[move only when destination file is older or missing]::update files [older]:(all none older)' + '(--update)-u[move only when destination file is older or missing]' '(-v --verbose)'{-v,--verbose}'[show file names after they are moved]' '(- *)--help[display usage information]' '(- *)--version[display version information]' @@ -37,6 +41,7 @@ case $variant; in darwin*|dragonfly*|freebsd*) args+=( "(-f -i)-n[don't overwrite existing file]" + "-h[if target is a symlink to a directory, don't follow it]" ) ;| darwin*|dragonfly*|*bsd*) @@ -44,11 +49,6 @@ case $variant; in '-v[show file names after they are moved]' ) ;| - dragonfly*|freebsd*) - args+=( - "-h[if target is a symlink to a directory, don't follow it]" - ) - ;; esac _arguments -s -S $aopts $args \ diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm index e66b77fa4..6dddb5ece 100644 --- a/Completion/Unix/Command/_rm +++ b/Completion/Unix/Command/_rm @@ -47,14 +47,10 @@ case $variant; in darwin*|dragonfly*|freebsd*|netbsd*) args+=( '-W[attempt to undelete named files]' - ) - ;| - dragonfly*|freebsd*|netbsd*) - args+=( "-x[don't cross file systems when removing a hierarchy]" ) ;| - dragonfly*|freebsd*) + darwin*|dragonfly*|freebsd*) args+=( '(-i)-I[prompt when removing many files]' ) diff --git a/Completion/Unix/Command/_sed b/Completion/Unix/Command/_sed index 79a010c92..ef3aaf2fd 100644 --- a/Completion/Unix/Command/_sed +++ b/Completion/Unix/Command/_sed @@ -104,14 +104,13 @@ else case $OSTYPE in openbsd*|freebsd*|netbsd*|darwin*|dragonfly*) args+=( - '(-r -E)'-E$extended + '(-r -E)'{-E,-r}$extended '-a[delay opening files listed with w function]' ) ;| - openbsd*|freebsd*|netbsd*|dragonfly*) args+=( '(-r -E)'-r$extended ) ;| darwin*|freebsd*|netbsd*|openbsd*|dragonfly*) args+=( '-i+'$inplace ) ;| darwin*|freebsd*|netbsd*|dragonfly*) args+=( '-l[make output line buffered]' ) ;| - freebsd*|dragonfly*) args+=( '-u[disable data buffering]' ) ;| + darwin*|freebsd*|dragonfly*) args+=( '-u[disable data buffering]' ) ;| freebsd*|netbsd*|dragonfly*) args+=( '-I+[edit files in-place, treating all files as a single input stream]:: :_guard "^(*[@/; \\\]*|?(#c6,)|-*)" "suffix for backup"' diff --git a/Completion/Unix/Command/_split b/Completion/Unix/Command/_split index 5ecc1bb67..5d5afa436 100644 --- a/Completion/Unix/Command/_split +++ b/Completion/Unix/Command/_split @@ -39,17 +39,17 @@ case $variant in '(- 1 2)--version[display version information]' ) ;; - (free|net)bsd*) + (free|net)bsd*|darwin*) args+=( '(-b -l -p)-n+[generate specified number of output files]:output files' ) ;| darwin*|freebsd*) args+=( + '-d[use numeric suffixes]' '(-b -l -n)-p+[split the file whenever a line matches specified pattern]:pattern' ) ;| freebsd*) args+=( - '-d[use numeric suffixes]' "-c[continue creating files and don't overwrite existing output files]" ) ;; diff --git a/Completion/Unix/Command/_touch b/Completion/Unix/Command/_touch index 9b9144756..47190c579 100644 --- a/Completion/Unix/Command/_touch +++ b/Completion/Unix/Command/_touch @@ -28,7 +28,7 @@ case $variant in darwin*|dragonfly*|freebsd*|netbsd*) args+=( '-h[act on symbolic links themselves]' ) ;| - dragonfly*|freebsd*|openbsd*|solaris*) + darwin*|dragonfly*|freebsd*|openbsd*|solaris*) args+=( '(-r -t 1)-d+[use specified date/time]:date/time' ) ;| darwin*|dragonfly*|freebsd*|netbsd*|solaris*) diff --git a/Completion/Unix/Command/_uniq b/Completion/Unix/Command/_uniq index e123a94cd..479b3848d 100644 --- a/Completion/Unix/Command/_uniq +++ b/Completion/Unix/Command/_uniq @@ -25,7 +25,7 @@ if ! _pick_variant gnu=Free\ Soft unix --version; then if [[ "$OSTYPE" == (darwin|dragonfly|freebsd|openbsd)* ]]; then optchars+=i fi - [[ $OSTYPE = freebsd* ]] && optchars+=D + [[ $OSTYPE = (darwin|freebsd)* ]] && optchars+=D args=( ${(M)args:#(|\*)(|\(*\))-[$optchars]*} ) fi diff --git a/Completion/Unix/Command/_xargs b/Completion/Unix/Command/_xargs index 8e23a04bb..30e5f8daa 100644 --- a/Completion/Unix/Command/_xargs +++ b/Completion/Unix/Command/_xargs @@ -25,7 +25,7 @@ case $variant in '-R[specify maximum arguments that -I will replace in]:replacements' ) ;| - freebsd*|netbsd*|dragonfly*) + darwin*|freebsd*|netbsd*|dragonfly*) args+=( '-S[space that -I can use for replacements]:size (bytes) [255]' ) -- cgit v1.2.3 From 87aba4d437f5fef46917c1235c00b9162d7bcbd0 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 27 Jan 2025 23:00:17 +0100 Subject: 53325: cover newer BSD releases in completion --- ChangeLog | 15 +++++++++++++++ Completion/BSD/Command/_acpiconf | 28 ++++++++++++++++++++++++++++ Completion/BSD/Command/_bsdconfig | 1 + Completion/BSD/Command/_pkgin | 2 ++ Completion/BSD/Command/_procstat | 35 ++++++++++++++++++----------------- Completion/BSD/Command/_sockstat | 5 +++++ Completion/BSD/Command/_systat | 1 + Completion/Unix/Command/_date | 17 ++++++++++++++--- Completion/Unix/Command/_df | 19 ++++++++++++------- Completion/Unix/Command/_dhclient | 1 + Completion/Unix/Command/_dmidecode | 6 ++++-- Completion/Unix/Command/_env | 14 +++++++++++--- Completion/Unix/Command/_iostat | 3 +++ Completion/Unix/Command/_last | 14 +++++++------- Completion/Unix/Command/_ls | 6 +++++- Completion/Unix/Command/_mv | 8 ++++---- Completion/Unix/Command/_ps | 2 +- Completion/Unix/Command/_script | 13 +++++++++++-- Completion/Unix/Command/_sed | 6 ++++-- Completion/Unix/Command/_vmstat | 6 +++++- Completion/Unix/Command/_w | 7 ++++++- Completion/Unix/Command/_wc | 2 +- Completion/Unix/Command/_zfs | 31 +++++++++++++++++++++++-------- 23 files changed, 182 insertions(+), 60 deletions(-) create mode 100644 Completion/BSD/Command/_acpiconf (limited to 'Completion/Unix/Command/_date') diff --git a/ChangeLog b/ChangeLog index ba7054a8e..2585d50e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2025-01-27 Oliver Kiddle + + * 53325: Completion/BSD/Command/_acpiconf, + Completion/BSD/Command/_bsdconfig, Completion/BSD/Command/_pkgin, + Completion/BSD/Command/_procstat, Completion/BSD/Command/_sockstat, + Completion/BSD/Command/_systat, Completion/Unix/Command/_date, + Completion/Unix/Command/_df, Completion/Unix/Command/_dhclient, + Completion/Unix/Command/_dmidecode, Completion/Unix/Command/_env, + Completion/Unix/Command/_iostat, Completion/Unix/Command/_last, + Completion/Unix/Command/_ls, Completion/Unix/Command/_mv, + Completion/Unix/Command/_ps, Completion/Unix/Command/_script, + Completion/Unix/Command/_sed, Completion/Unix/Command/_vmstat, + Completion/Unix/Command/_w, Completion/Unix/Command/_wc, + Completion/Unix/Command/_zfs: cover newer BSD releases in completion + 2025-01-20 Bart Schaefer * Julian Prein: 53309: Completion/Unix/Command/_uniq: remove diff --git a/Completion/BSD/Command/_acpiconf b/Completion/BSD/Command/_acpiconf new file mode 100644 index 000000000..817a2f1ad --- /dev/null +++ b/Completion/BSD/Command/_acpiconf @@ -0,0 +1,28 @@ +#compdef acpiconf + +local curcontext="$curcontext" sep ret=1 +local -a state line modes desc +local -A opt_args + +_arguments -s \ + '(-)-h[display usage information]' \ + '(-)-i[get battery information]:battery' \ + '(-)-k[ack or abort a pending suspend]:ack' \ + '(-)-s[enter specified sleep mode]: :->modes' && ret=0 + +if [[ -n $state ]]; then + modes=( $(_call_program modes sysctl -n hw.acpi.supported_sleep_state) ) + zstyle -s ":completion:${curcontext}:modes" list-separator sep || sep=-- + (( $#modes )) || modes=( S3 S4 ) + desc=( + "S1 $sep stop the processor clock" + "S2 $sep low wake latency sleep state" + "S3 $sep suspend to RAM" + "S4 $sep suspend to disk" + "S5 $sep soft off state" + ) + desc=( ${(M)desc:#(${(~j.|.)modes}) *} ) + _wanted modes expl 'mode' compadd -M 'B:S=' -ld desc - ${modes#S} && ret=0 +fi + +return ret diff --git a/Completion/BSD/Command/_bsdconfig b/Completion/BSD/Command/_bsdconfig index f88255575..5de8f777d 100644 --- a/Completion/BSD/Command/_bsdconfig +++ b/Completion/BSD/Command/_bsdconfig @@ -51,6 +51,7 @@ shortcuts=( vt_saver vt_screenmap vt_ttys + wifi wireless wlan ) _arguments -s -w -A '-*' : \ diff --git a/Completion/BSD/Command/_pkgin b/Completion/BSD/Command/_pkgin index 662bed181..c4ed3aa14 100644 --- a/Completion/BSD/Command/_pkgin +++ b/Completion/BSD/Command/_pkgin @@ -5,6 +5,8 @@ local -a state state_descr line expl cmds short pkgs local -A opt_args _arguments -s -S -C \ + '(-6)-4[only use IPv4 addresses]' \ + '(-4)-6[only use IPv6 addresses]' \ '-c+[enable chrooting pkgin in the given repository]:chroot path:_directories' \ '-d[download only]' \ '-f[force database update]' \ diff --git a/Completion/BSD/Command/_procstat b/Completion/BSD/Command/_procstat index a1708f6ac..867ddc501 100644 --- a/Completion/BSD/Command/_procstat +++ b/Completion/BSD/Command/_procstat @@ -1,26 +1,27 @@ #compdef procstat _arguments -s -A "-*" -S \ - '-b[show binary information]' \ - '-c[show command line arguments]' \ - '-e[show environment variables]' \ - '-f[show file descriptor information]' \ - '-i[show signal pending and disposition]' \ - '-j[show signal pending and blocked information for process threads]' \ - '-k[show stacks of kernel threads]' \ - '-l[show resource limits]' \ - "-L[show LWP info for the process pertaining to it's signal driven exit]" \ - '-r[show resource usage]' \ - '-s[show security credential information]' \ - '-S[show cpuset information]' \ - '-t[show thread information]' \ - '-v[show virtual memory mappings]' \ - '-x[show ELF auxiliary vector]' \ + '(1)-b[show binary information]' \ + '(1)-c[show command line arguments]' \ + '(1)-e[show environment variables]' \ + '(1)-f[show file descriptor information]' \ + '(1)-i[show signal pending and disposition]' \ + '(1)-j[show signal pending and blocked information for process threads]' \ + '(1)-k[show stacks of kernel threads]' \ + '(1)-l[show resource limits]' \ + "(1)-L[show LWP info for the process pertaining to it's signal driven exit]" \ + '(1)-r[show resource usage]' \ + '(1)-s[show security credential information]' \ + '(1)-S[show cpuset information]' \ + '(1)-t[show thread information]' \ + '(1)-v[show virtual memory mappings]' \ + '(1)-x[show ELF auxiliary vector]' \ '-h[suppress table headers]' \ - '(1)-a[all processes]' \ + '(2 *)-a[all processes]' \ '-w+[repeat information after specified interval]:delay (seconds)' \ '-C[print additional capability information for file descriptors]' \ '-H[statistics per-thread rather than per-process]' \ '-n[numeric form for signals]' \ - '1::core file:_path_files -g "*core*(-.)"' \ + '1::command:(advlock argument auxv basic binary cpuset credential environment fd file kstack pargs ptlwpinfo pwdx rlimit rlimitusage rusage sigfastblock signal thread tsignal vm)' \ + '2::core file:_path_files -g "*core*(-.)"' \ '*:process id:_pids' diff --git a/Completion/BSD/Command/_sockstat b/Completion/BSD/Command/_sockstat index f372fe1b3..b99d3681a 100644 --- a/Completion/BSD/Command/_sockstat +++ b/Completion/BSD/Command/_sockstat @@ -29,6 +29,11 @@ case $OSTYPE in '-q[quiet mode, do not print the header line]' ) ;| + freebsd<14->.*) + args+=( + '-I[show local address of socket to which the current socket is spliced]' + ) + ;| freebsd*) for proto in ${${(M)${(f)"$(.*) args+=( '-d+:daylight saving time value' @@ -77,6 +83,11 @@ else freebsd<14->.*|openbsd*) args+=( '-z+[specify timezone for output]:time zone:_time_zone') ;| + freebsd*) + args+=( + '(-R)-I-[display in ISO 8601 format]::precision [date]:(date hours minutes seconds ns)' + ) + ;| netbsd*) args+=( '-d[output date specified by string]:time string:' ) ;; diff --git a/Completion/Unix/Command/_df b/Completion/Unix/Command/_df index 21abff105..315758488 100644 --- a/Completion/Unix/Command/_df +++ b/Completion/Unix/Command/_df @@ -45,21 +45,25 @@ elif [[ "$OSTYPE" == (darwin|dragonfly|freebsd|netbsd*|openbsd)* ]]; then '-a[show all mount points]' '(-b -g -H -h -k -m --si)-g[use 1024^3-byte blocks]' '(-b -g -H -h -k -m --si)-m[use 1024*1024-byte blocks]' - ) - ;| - (darwin*|dragonfly*|freebsd*) - args+=( '(-b -g -H -h -k -m --si)-b[use 512-byte blocks (default)]' '(-b -g -H -h -k -m --si)-H[human-readable output (base 10)]' ) ;| - (darwin*|freebsd*) + (darwin*|freebsd*|netbsd*) args+=( '-c[display a grand total]' ) + ;| + (darwin*|freebsd*) + args+=( + '--libxo[generate output via libxo]' + '-,[separate thousands]' + ) ;| (darwin*) args+=( + '-I[suppress inode counts]' + '-Y[include file system type]' "-T+$spec" "!-t+$spec" # obsolete ) @@ -76,14 +80,15 @@ elif [[ "$OSTYPE" == (darwin|dragonfly|freebsd|netbsd*|openbsd)* ]]; then ;| (freebsd*) args+=( - '--libxo[generate output via libxo]' '(-b -g -H -h -k -m --si)--si[human-readable output (base 10)]' - '-,[separate thousands]' ) ;; (netbsd*) args+=( + '(-P -G -N)-f[display only the available free]' '(-G -i -P)-G[display all fields in statvfs]' + '(-G -P)-N[suppress the header line normally output]' + '-W[print widge name instead of the device]' ) ;; esac diff --git a/Completion/Unix/Command/_dhclient b/Completion/Unix/Command/_dhclient index e22586b04..f38e9a9e5 100644 --- a/Completion/Unix/Command/_dhclient +++ b/Completion/Unix/Command/_dhclient @@ -12,6 +12,7 @@ case $OSTYPE in args+=( '(-d)-b[immediately move to the background]' '-l+[specify leases file]:file:_files' + "-n[don't wait for ARP resolution]" '-p+[specify PID file]:file:_files' '-u[reject leases with unknown options]' '-q[quiet]' diff --git a/Completion/Unix/Command/_dmidecode b/Completion/Unix/Command/_dmidecode index e2c511313..62a950a7a 100644 --- a/Completion/Unix/Command/_dmidecode +++ b/Completion/Unix/Command/_dmidecode @@ -5,8 +5,10 @@ _arguments -s \ '(-)'{-h,--help}'[display usage information]' \ '(-q --quiet -u --dump)'{-q,--quiet}'[be less verbose]' \ '--no-quirks[decode everything without quirks]' \ - '(-t --type -H --handle -u --dump --dump-bin -s --string)'{-s+,--string=}'[only display value of specified DMI string]:DMI string:(bios-vendor bios-version bios-release-date system-manufacturer system-product-name system-version system-serial-number system-uuid baseboard-manufacturer baseboard-product-name baseboard-version baseboard-serial-number baseboard-asset-tag chassis-manufacturer chassis-type chassis-version chassis-serial-number chassis-asset-tag processor-family processor-manufacturer processor-version processor-frequency)' \ - '(-s --string -H --handle --dump-bin)*'{-t+,--type=}'[only display entries of specified type]:entry type:(bios system baseboard chassis processor memory cache connector slot)' \ + '(-t --type -H --handle -u --dump --dump-bin -s --string)'{-s+,--string=}'[only display value of specified DMI string]:DMI string:compadd -M "r\:|-=* r\:|=*" - $(_call_program strings dmidecode --list-strings)' \ + '--list-strings[list available string keywords]' \ + '(-s --string -H --handle --dump-bin)*'{-t+,--type=}'[only display entries of specified type]:entry type:compadd - $(_call_program types dmidecode --list-types)' \ + '--list-types[list available type keywords]' \ '(-s --string -t --type -H --handle --dump-bin)'{-H,--handle=}'[only display the entry of specified handle]:handle' \ '(-q --quiet -u --dump -s --string)'{-u,--dump}"[don't decode entries]" \ '(-s --string -t --type -H --handle)--dump-bin=[dump DMI data to a binary file]:file:_files' \ diff --git a/Completion/Unix/Command/_env b/Completion/Unix/Command/_env index 8cf0ad467..89a45e4a4 100644 --- a/Completion/Unix/Command/_env +++ b/Completion/Unix/Command/_env @@ -8,6 +8,7 @@ case $variant in gnu) (( $#words > 2 )) && ign='!' args=( + '(-a --argv0)'{-a+,--argv0=}'[pass argument as the zeroth argument of command]:argument' '(-)'{-i,--ignore-environment}'[start with empty environment]' '(* -0 --null)'{-0,--null}'[end each output line with NUL, not newline]' '(--ignore-environment -i --help --version)*'{-u+,--unset=}'[remove variable from the environment]:env var to remove:_parameters -g "*export*"' @@ -28,12 +29,19 @@ case $variant in '-U[add variables from user and system login.conf(5)]: :->user-class' ) ;| - freebsd*|darwin*) - args=( '-0[use NUL, not newline after each variable in output]' ) + freebsd*|netbsd*) + args+=( '-C+[change working directory]:directory:_directories' ) ;| - freebsd*|darwin*|dragonfly*) + freebsd*|darwin*|netbsd*) + args+=( '-0[use NUL, not newline after each variable in output]' ) + ;| + freebsd*|darwin*|dragonfly*|netbsd*|openbsd*) args+=( '(-i)*-u+[remove variable from the environment]:env var to remove:_parameters -g "*export*"' + ) + ;| + freebsd*|darwin*|dragonfly*) + args+=( '-P+[specify alternate executable search PATH]:path:_dir_list' '-S+[perform word splitting]:string to split' '*-v[verbose output]' diff --git a/Completion/Unix/Command/_iostat b/Completion/Unix/Command/_iostat index d3943fcb4..36a3b7904 100644 --- a/Completion/Unix/Command/_iostat +++ b/Completion/Unix/Command/_iostat @@ -50,6 +50,9 @@ case $OSTYPE:l in args+=( '-x[show extended disk statistics]' '-y[report data on waiting and active requests]' + '-z[replace drive and CPU statistics that are zero with spaces]' + "-H+[set page height explicitly]:height [$LINES]" + "-W+[set page width explicitly]:width [$COLUMNS]" ) ;; aix*) diff --git a/Completion/Unix/Command/_last b/Completion/Unix/Command/_last index 2013cc1c2..d76260c36 100644 --- a/Completion/Unix/Command/_last +++ b/Completion/Unix/Command/_last @@ -8,17 +8,16 @@ ttys=( ${ttys#/dev/} ) for pattern arg in \ '(solaris*|linux-gnu)' '(--hostlast)-a[display hostname in last column]' \ '((free|net|open)bsd*|darwin*|dragonfly*)' '-h+[limit sessions by hostname]:host:_hosts' \ - '((free|open)bsd*)' '-s[report duration in seconds]' \ - '(freebsd*|openbsd*)' '-d+[limit sessions to those active at snapshot time]:time ([[CC]YY][MMDD]hhmm[.SS])' \ + '((free|open)bsd*|darwin*)' '-s[report duration in seconds]' \ + '((free|open)bsd*|darwin*)' '-d+[limit sessions to those active at snapshot time]:time ([[CC]YY][MMDD]hhmm[.SS])' \ '((net|free|open)bsd*|darwin*|dragonfly*)' '-t+[limit sessions by tty]:tty:_ttys -D' \ 'openbsd*' '-c[calculate total time]' \ - '^darwin*' '(--file)-f+[specify account file]:file:_files' \ - '(solaris*|linux-gnu|freebsd*|openbsd*)' '(--limit)-n+[specify number of lines to show]:number' \ + '(solaris*|darwin*|linux-gnu|freebsd*|openbsd*)' '(--limit)-n+[specify number of lines to show]:number' \ '((open|net)bsd*|dragonfly*)' '-T[show more detailed time information including year and seconds]' \ 'netbsd*' '-x[assume file is in wtmpx(5) format]' \ 'netbsd*' '-n[show IP of remote hosts]' \ - 'freebsd*' '-w[show seconds in duration field]' \ - 'freebsd*' '-y[show year in session start time]' + '(freebsd*|darwin*)' '-w[show seconds in duration field]' \ + '(freebsd*|darwin*)' '-y[show year in session start time]' do [[ $OSTYPE = $~pattern ]] && args+=( $arg ) done @@ -58,4 +57,5 @@ else args+=( '*:user:_users' ) fi -_arguments -s -S $args +_arguments -s -S $args \ + '(--file)-f+[specify account file]:file:_files' diff --git a/Completion/Unix/Command/_ls b/Completion/Unix/Command/_ls index 392b8490b..a19ad30e2 100644 --- a/Completion/Unix/Command/_ls +++ b/Completion/Unix/Command/_ls @@ -61,12 +61,16 @@ if ! _pick_variant gnu=gnu unix --help; then '(-l -1 -C -m -x)-g[long listing but without owner information]' ) fi + if [[ $OSTYPE = (netbsd*|darwin*) ]]; then + arguments+=( + "-X[don't cross mount points when recursing]" + ) + fi if [[ $OSTYPE = netbsd* ]]; then arguments+=( '-M[output file sizes in comma-separated form]' '-O[output only leaf (non-directory) files]' '-P[print full pathname for each file]' - "-X[don't cross mount points when recursing]" ) fi if [[ $OSTYPE = (dragonfly*|freebsd*|openbsd*|darwin*) ]]; then diff --git a/Completion/Unix/Command/_mv b/Completion/Unix/Command/_mv index c52e7a5e4..983c25ea8 100644 --- a/Completion/Unix/Command/_mv +++ b/Completion/Unix/Command/_mv @@ -38,11 +38,11 @@ case $variant; in '(-f -n)-i[prompt before overwriting existing file]' ) ;| + darwin*|dragonfly*|freebsd*|netbsd*) + args+=( "-h[if target is a symlink to a directory, don't follow it]" ) + ;| darwin*|dragonfly*|freebsd*) - args+=( - "(-f -i)-n[don't overwrite existing file]" - "-h[if target is a symlink to a directory, don't follow it]" - ) + args+=( "(-f -i)-n[don't overwrite existing file]" ) ;| darwin*|dragonfly*|*bsd*) args+=( diff --git a/Completion/Unix/Command/_ps b/Completion/Unix/Command/_ps index c3dfae47d..158fb6b83 100644 --- a/Completion/Unix/Command/_ps +++ b/Completion/Unix/Command/_ps @@ -106,9 +106,9 @@ case $OSTYPE in ;| linux-gnu|netbsd*) bsdarg+=( 'k[specify sort order]' ) ;| linux-gnu|openbsd*) bsd+=( 'f[show process hierarchy]' ) ;| + darwin*|freebsd*|netbsd*) bsdarg+=( '*G[select processes by real group]' ) ;| darwin*|freebsd*) bsd+=( 'X[skip processes with no controlling terminal]' ) - bsdarg+=( '*G[select processes by real group]' ) ;| freebsd*|dragonfly*) bsd+=( 'f[show command and environment for swapped out processes]' ) diff --git a/Completion/Unix/Command/_script b/Completion/Unix/Command/_script index d38d56f2e..25f8ea35f 100644 --- a/Completion/Unix/Command/_script +++ b/Completion/Unix/Command/_script @@ -50,19 +50,28 @@ case $OSTYPE in '(-d -p -T)-r[record a session with input, output and timing data]' ) ;| + darwin*|netbsd*|freebsd*) + args+=( + '-e[return exit status of the child process]' + ) + ;| netbsd*|openbsd*) args+=( '-c[run specified command instead of a shell]:command:_cmdstring' ) ;| + darwin*|freebsd*) + args+=( + '(-a -r -k -t)-T[play back a recorded session, reporting only timestamps]: :_date_formats' + ) + ;| netbsd*) args+=( '-f[flush output after each write]' ) ;| freebsd*) args+=( - '-e[return exit status of the child process]' '-f[use filemon(4)]' - '(-a -r -k -t)-T[play back a recorded session, reporting only timestamps]: :_date_formats' + '-w[forward terminal size changes on SIGWINCH]' ) ;| darwin*|dragonfly*|freebsd*) diff --git a/Completion/Unix/Command/_sed b/Completion/Unix/Command/_sed index ef3aaf2fd..ecbec61d1 100644 --- a/Completion/Unix/Command/_sed +++ b/Completion/Unix/Command/_sed @@ -104,7 +104,7 @@ else case $OSTYPE in openbsd*|freebsd*|netbsd*|darwin*|dragonfly*) args+=( - '(-r -E)'{-E,-r}$extended + '(-r -E -H)'{-E,-r}$extended '-a[delay opening files listed with w function]' ) ;| @@ -115,8 +115,10 @@ else args+=( '-I+[edit files in-place, treating all files as a single input stream]:: :_guard "^(*[@/; \\\]*|?(#c6,)|-*)" "suffix for backup"' ) - ;; + ;| openbsd*) args+=( '-u[make output line buffered]' ) ;; + darwin*) args+=( '(-r -E)-H[use enhanced regular expressions]' ) ;; + netbsd*) args+=( '(-r -E)-g[use GNU regular expressions]' '!(-r -E -g)-G' ) ;; esac fi diff --git a/Completion/Unix/Command/_vmstat b/Completion/Unix/Command/_vmstat index 6db776e62..1d0ac855d 100644 --- a/Completion/Unix/Command/_vmstat +++ b/Completion/Unix/Command/_vmstat @@ -37,10 +37,14 @@ case $OSTYPE in '-f[report on the number fork syscalls since boot and pages of virtual memory for each]' ) ;| + freebsd*|dragonfly*|netbsd*) + specs+=( + '-n+[change the maximum number of disks to display]:number of disks to display [2]' + ) + ;| freebsd*|dragonfly*) specs+=( '-m[report on the usage of kernel dynamic memory allocated using malloc(9) by type]' - '-n+[change the maximum number of disks to display]:number of disks to display [2]' '*-p+[specify which types of devices to display]: :->devices' '-s[display the contents of the SUM structure]' '-z[report on memory used by the kernel zone allocator, uma(9), by zone]' diff --git a/Completion/Unix/Command/_w b/Completion/Unix/Command/_w index e82c84f57..408cb76af 100644 --- a/Completion/Unix/Command/_w +++ b/Completion/Unix/Command/_w @@ -23,7 +23,7 @@ case $OSTYPE in openbsd*) args+=( '-a[translate network addresses into names]' ) ;| - (free|net)bsd*|dragonfly*) + (free|net)bsd*|dragonfly*|darwin*) args+=( '-n[show network addresses as numbers]' ) ;| *bsd*|dragonfly*) @@ -35,6 +35,11 @@ case $OSTYPE in freebsd*|dragonfly*) args+=( '-d[dump process list on a per controlling tty basis]' ) ;| + netbsd*) + args+=( + '-A[sort tty names alphabetically instead of utmp or utmpx order]' + ) + ;| solaris*) args+=( '!(-s -w -l)'{-l,-w} '-s[short output form]' diff --git a/Completion/Unix/Command/_wc b/Completion/Unix/Command/_wc index a1897e289..2a4f7ab05 100644 --- a/Completion/Unix/Command/_wc +++ b/Completion/Unix/Command/_wc @@ -18,7 +18,7 @@ if _pick_variant gnu=GNU unix --version; then else args=( -A "-*" "${(@)args:#(|\(*\))(|\*)--*}" ) case $OSTYPE in - freebsd*|netbsd*) args+=( '-L[print longest line lengths]' ) ;; + freebsd*|netbsd*|darwin*) args+=( '-L[print longest line lengths]' ) ;; openbsd*) args+=( '-h[human readable: use unit suffixes]' ) ;; solaris*) args+=( ${${(M)args:#*-m\[*}//-m\[/-C\[} ) ;; esac diff --git a/Completion/Unix/Command/_zfs b/Completion/Unix/Command/_zfs index c09435a1f..5a45c2920 100644 --- a/Completion/Unix/Command/_zfs +++ b/Completion/Unix/Command/_zfs @@ -79,7 +79,7 @@ rw_ds_props=( 'paths:mountpoint:_directories -W / -P /'" 'multilevel:value:(on off)' 'nbmand:value:(on off)' - 'primarycache:value:(all none metadata)' + {prefetch,primarycache}':value:(all none metadata)' 'quota: :->quotas' 'readonly:value:(on off)' 'recordsize:value:(512 1K 2K 4K 8K 16K 32K 64K 128K 256K 512K 1M)' @@ -515,9 +515,11 @@ case $service:$words[1] in ;; zfs:set) - [[ $implementation = solaris ]] && args=( - '-r[recursively apply value]' \ - ) + if [[ $implementation = solaris ]]; then + args=( '-r[recursively apply value]' ) + else + args=( "-u[update property but don't mount or share dataset]" ) + fi _arguments -C -A "-*" -S $args \ ':property:->set-properties' \ '*:filesystem/volume:_zfs_dataset -t fs -t vol' @@ -598,13 +600,14 @@ case $service:$words[1] in zfs:mount) [[ $OSTYPE != freebsd* ]] && args=( '-O[overlay mount]' ) [[ $implementation = openzfs ]] && args+=( - '-l[load keys for encrypted filesystems as they are being mounted]' + '-l[load keys for encrypted filesystems as they are being mounted]' + '(-a)-R[mount filesystems along with all their children]' ) _arguments -A "-*" -S $args \ '-o+[specify temporary file system options]: :_values -s , "option" {,no}{atime,dev,exec,relatime,suid,xattr} ro rw' \ '-v[report mount progress]' \ '-f[force mount]' \ - '(:)-a[mount all available ZFS filesystems]' \ + '(: -R)-a[mount all available ZFS filesystems]' \ '(-a):filesystem:_zfs_dataset -t fs' ;; @@ -888,6 +891,12 @@ case $service:$words[1] in ':property:($delegatable_perms $ro_ds_props ${rw_ds_props%%:*})' ;; + zpool:(clear|online)) + [[ $OSTYPE = linux* ]] && args=( + "--power[power on the device's slot in the storage enclosure]" + ) + ;| + zpool:help) _arguments -A "-*" -S \ - commands \ @@ -905,6 +914,7 @@ case $service:$words[1] in '-L[display real paths for vdevs resolving all symbolic links]' '-o+[set given pool properties]: :_values -s , "property" "${(@M)ci_po_props\:#ashift*}"' \ '-P[display real paths for vdevs instead of only the last component of the path]' + --allow-ashift-mismatch --allow-in-use --allow-replication-mismatch ) elif [[ $implementation = solaris ]]; then args=( '-l[display configuration in /dev/chassis location form]' ) @@ -1004,7 +1014,7 @@ case $service:$words[1] in zpool:get) [[ $implementation = solaris ]] && args=( - '-s+[specify sources to display]: :_values -s "source" local default none' + '-s+[specify sources to display]: :_values -s , "source" local default none' ) _arguments -A "-*" -S $args \ '-H[suppress headers and tab-delimit fields]' \ @@ -1140,6 +1150,9 @@ case $service:$words[1] in [[ $implementation = openzfs ]] && args=( '-f[force disk into faulted state]' ) + [[ $OSTYPE = linux* ]] && args=( + "--power[power off the device's slot in the storage enclosure]" + ) _arguments -C -A "-*" -S $args \ '-t[offline until next reboot]' \ ':pool:_zfs_pool' \ @@ -1147,7 +1160,7 @@ case $service:$words[1] in ;; zpool:online) - _arguments -C -A "-*" -S \ + _arguments -C -A "-*" -S $args \ '-e[expand device to use all available space]' \ ':pool:_zfs_pool' \ '*:virtual device:->pool-devices' @@ -1234,8 +1247,10 @@ case $service:$words[1] in zpool:status) if [[ $implementation = openzfs ]]; then args=( + '--power[display vdev enclosure slot power status]' '-D[display a histogram of deduplication statistics]' '-c[run scripts on each vdev]:script:_files -W "($ZPOOL_SCRIPTS_PATH /etc/zfs/zpool.d ~/.zpool.d)"' + '-e[only show unhealthy vdevs]' '-i[display vdev initialization status]' '-g[display vdev GUIDs instead of the normal device names]' '-L[display real paths for vdevs resolving all symbolic links]' -- cgit v1.2.3