1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-06-12 07:28:04 +02:00

52217: update completions for FreeBSD 14

This commit is contained in:
Oliver Kiddle 2023-10-11 00:57:16 +02:00
parent 4878c2b130
commit 985952e2f6
21 changed files with 213 additions and 124 deletions

View file

@ -1,5 +1,18 @@
2023-10-10 Oliver Kiddle <opk@zsh.org> 2023-10-10 Oliver Kiddle <opk@zsh.org>
* 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 * 52216: Src/Modules/watch.c: metafy usernames to allow for
them to be UTF-8 encoded them to be UTF-8 encoded

View file

@ -17,6 +17,7 @@ _arguments \
'-d[store working files in workdir]:workdir:_files -/' \ '-d[store working files in workdir]:workdir:_files -/' \
'-f[read configuration options from conffile]:conf file:_files' \ '-f[read configuration options from conffile]:conf file:_files' \
'-F[force freebsd-update fetch to proceed where it normally would not]' \ '-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' \ '-k[trust an RSA key with SHA256 of KEY]:RSA key' \
'-r[specify the new release]:new release' \ '-r[specify the new release]:new release' \
'-s[fetch files from the specified server or server pool]:server:_hosts' \ '-s[fetch files from the specified server or server pool]:server:_hosts' \

View file

@ -1,7 +1,7 @@
#compdef ipfw #compdef ipfw dnctl
local word=$'/[^ \t\0]#[ \t\0]/' comma next pqs nat 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 local -A opt_args nat_options
_ipfw_tables() { _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=( actions=(
$'/[^\0]##\0(-[a-zA-Z0-9]##[ \t]#)#/' # skip over options, completed by _arguments but can $'/[^\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 \( # 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' \| $'/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 ': _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)' \| $'/show[ \t\0]/' $word ':actions:action:(config log)'
\| '/[]/' ':commands:command:$ca config show' \) \| '/[]/' ':commands:command:$ca config show' \)
\| # dummynet configuration \| $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'
\) \#
\| # sysctl shortcuts \| # sysctl shortcuts
$'/(en|dis)able[ \t\0]/' ':sysctl-shortcuts:sysctl shortcut:$ca enable disable' $'/(en|dis)able[ \t\0]/' ':sysctl-shortcuts:sysctl shortcut:$ca enable disable'
$word ':values:value:(firewall altq one_pass debug verbose dyn_keepalive)' $word ':values:value:(firewall altq one_pass debug verbose dyn_keepalive)'
@ -292,11 +298,36 @@ actions=(
\) \)
) )
if (( $words[(I)-p*] )); then case $service in
pathname=( ':path:_files -P / -W /' ) ipfw)
fi _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 if [[ -prefix *[$' \t']* ]]; then
# This allows from things like ipfw "-n add..." # This allows from things like ipfw "-n add..."
@ -304,22 +335,10 @@ if [[ -prefix *[$' \t']* ]]; then
return return
fi fi
_arguments -s $pathname \ _arguments -s $args \
'(-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]' \
'(- *)-h[display syntax summary]' \ '(- *)-h[display syntax summary]' \
'(-p)-i[format values as IP addresses in table listings]' \
'-n[only check syntax, make no changes]' \ '-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)-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]' \ '-v[verbose]' \
'(-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' \
'*:::actions:= _ipfw_actions' '*:::actions:= _ipfw_actions'

View file

@ -91,7 +91,10 @@ case $OSTYPE in
) )
;| ;|
freebsd*) freebsd*)
args+=( '-P[display ports numerically]' ) args+=(
'-M[kill matching states in the opposite direction]'
'-P[display ports numerically]'
)
;; ;;
esac esac

View file

@ -21,6 +21,14 @@ case $OSTYPE in
'-w[use wider field size for displaying addresses]' '-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*) freebsd*)
for proto in ${${(M)${(f)"$(</etc/protocols)"}##[a-z0-9]*}}; do for proto in ${${(M)${(f)"$(</etc/protocols)"}##[a-z0-9]*}}; do
case $proto in case $proto in

View file

@ -1,23 +1,29 @@
#compdef cmp gcmp #compdef cmp gcmp
local args variant local args variant units
_pick_variant -r variant gnu=GNU $OSTYPE --version _pick_variant -r variant gnu=GNU $OSTYPE --version
case $variant in case $variant in
gnu) freebsd*|gnu)
args=( args=(
'(-b --print-bytes)'{-b,--print-bytes}'[print differing bytes]' '(-b --print-bytes)'{-b,--print-bytes}'[print differing bytes]'
'(-i --ignore-initial)'{-i+,--ignore-initial}'[skip specified number of bytes]:bytes' '(-i --ignore-initial)'{-i+,--ignore-initial}'[skip specified number of bytes]:bytes'
'(-l --verbose -s --silent --quiet)'{-l,--verbose}'[output all differences]' '(-l --verbose -s --silent --quiet)'{-l,--verbose}'[output all differences]'
'(-n --bytes)'{-n+,--bytes=}'[specify maximum bytes to compare]:bytes' '(-n --bytes)'{-n+,--bytes=}'[specify maximum bytes to compare]:bytes'
'(-s --quiet --silent -l --verbose)'{-s,--quiet,--silent}'[return status alone signifies differences]' '(-s --quiet --silent -l --verbose)'{-s,--quiet,--silent}'[return status alone signifies differences]'
)
units=":_numbers -u bytes offset K M G T P E Z Y"
;|
gnu)
args=(
'(- *)'{-v,--version}'[display version information]' '(- *)'{-v,--version}'[display version information]'
'(- *)--help[display help information]' '(- *)--help[display help information]'
) )
units+=" kB MB GB TB PB EB ZB YB"
;; ;;
netbsd*) args+=( "-c[don't use mmap]" ) ;| netbsd*) args+=( "-c[don't use mmap]" ) ;|
freebsd*|openbsd*) freebsd*|openbsd*)
args=( args+=(
"-h[don't follow symbolic links]" "-h[don't follow symbolic links]"
'-x[hexadecimal output and zero based offset index]' '-x[hexadecimal output and zero based offset index]'
'-z[compare file sizes first]' '-z[compare file sizes first]'
@ -31,4 +37,4 @@ case $variant in
;; ;;
esac esac
_arguments -s $args '1:file 1:_files' '2:file 2:_files' '::byte offset' '::byte offset' _arguments -s $args '1:file 1:_files' '2:file 2:_files' "::byte offset$units" "::byte offset$units"

View file

@ -76,8 +76,8 @@ else
;| ;|
openbsd*|netbsd*) args+=( '-a[gradually skew]' ) openbsd*|netbsd*) args+=( '-a[gradually skew]' )
;| ;|
openbsd*) freebsd<14->.*|openbsd*)
args+=( '-z[specify timezone for output]:time zone:_time_zone') args+=( '-z+[specify timezone for output]:time zone:_time_zone')
;| ;|
netbsd*) netbsd*)
args+=( '-d[output date specified by string]:time string:' ) args+=( '-d[output date specified by string]:time string:' )

View file

@ -34,10 +34,15 @@ case $OSTYPE in
'-l[show long section names without truncation]' '-l[show long section names without truncation]'
'-O[specify osabi to apply]:osabi' '-O[specify osabi to apply]:osabi'
'-P[use alternative section header]' '-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 esac
_arguments -s $args _arguments -s $args \
"*:elf file:_object_files"

View file

@ -46,6 +46,7 @@ case $OSTYPE in
_arguments -s \ _arguments -s \
'-c+[write core file to specified file]:file:_files' \ '-c+[write core file to specified file]:file:_files' \
'-f[dump all available segments]' \ '-f[dump all available segments]' \
'-k[use the ptrace(2) PT_COREDUMP kernel facility to write the core dump]' \
'::executable:' \ '::executable:' \
':pid:_pids' ':pid:_pids'
;; ;;

View file

@ -20,10 +20,20 @@ case $OSTYPE in
) )
;; ;;
freebsd*|dragonfly*) freebsd*|dragonfly*)
args=( -s $updown args=( -s $updownlist
'(-a -l -u -d -m -L 1 *)-C[list interface cloners]' '(-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]' '(-l -C)-m[list supported media]'
'(-C)-n[disable automatic loading of network interface drivers]'
'(-l -C)-L[show address lifetime as time offset]' '(-l -C)-L[show address lifetime as time offset]'
'(-C)-v[get more verbose status for an interface]'
) )
listopts=( listopts=(
active caps chan countries mac mesh regdomain roam txparam txpower active caps chan countries mac mesh regdomain roam txparam txpower
@ -37,6 +47,9 @@ case $OSTYPE in
roam roam:rssi roam:rate roaming roam roam:rssi roam:rate roaming
) )
;| ;|
freebsd<14->.*)
args+=( '(-C)-j+[perform actions inside jail]:jail:_jails' )
;;
dragonfly*) dragonfly*)
args+=( '-n[disable auto-loading of kernel network interface driver]' ) args+=( '-n[disable auto-loading of kernel network interface driver]' )
;; ;;

View file

@ -34,7 +34,6 @@ case $OSTYPE:l in
args+=( args+=(
'-x[show extended disk statistics]' '-x[show extended disk statistics]'
'-z[omit lines for devices with no activity]' '-z[omit lines for devices with no activity]'
'(* -)-?[display a usage statement and exit]'
) )
;; ;;
dragonfly*) dragonfly*)
@ -126,6 +125,7 @@ case $OSTYPE:l in
parser=( -s ) parser=( -s )
args=( args=(
'-c[display CPU utilization report]' '-c[display CPU utilization report]'
"--compact[don't break into sub-reports keeping metrics to a single line]"
'-d[display device utilization report]' '-d[display device utilization report]'
'--dec=-[specify the number of decimal places to use]:decimal places [2]:(0 1 2)' '--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' '-f[specify alternative directory to read device statistics from]:directory:_directories'

View file

@ -30,8 +30,7 @@ else
freebsd*) freebsd*)
args=( args=(
'-a[show all objects that are needed by each loaded object]' '-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 esac

View file

@ -96,6 +96,7 @@ if ! _pick_variant gnu=gnu unix --help; then
if [[ $OSTYPE = freebsd* ]]; then if [[ $OSTYPE = freebsd* ]]; then
arguments+=( arguments+=(
'-,[print file sizes grouped and separated by thousands]' '-,[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]' '-y[with -t, sort filenames in the same order as the time]'
'-Z[display MAC label]' '-Z[display MAC label]'
'--color=-[control use of color]:color:(never always auto)' '--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]' '(-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]' '(--reverse -r -U -f)'{--reverse,-r}'[reverse sort order]'
'(--sort -t -U -v -X)-S[sort by size]' '(--sort -f -t -U -v -X)-S[sort by size]'
'(--sort -S -U -v -X)-t[sort by modification time]' '(--sort -f -S -U -v -X)-t[sort by modification time]'
'(--sort -S -t -v -X)-U[unsorted]' '(--sort -f -S -t -v -X)-U[unsorted]'
'(--sort -S -t -U -X)-v[sort by version (filename treated numerically)]' '(--sort -f -S -t -U -X)-v[sort by version (filename treated numerically)]'
'(--sort -S -t -U -v)-X[sort by extension]' '(--sort -f -S -t -U -v)-X[sort by extension]'
'(-S -t -U -v -X)--sort=[specify sort key]:sort key:(size time none version 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)' '--color=-[control use of color]:color:(never always auto)'
"*--hide=[like -I, but overridden by -a or -A]:pattern: " "*--hide=[like -I, but overridden by -a or -A]:pattern: "

View file

@ -1,43 +1,45 @@
#compdef mktemp gmktemp #compdef mktemp gmktemp
local variant 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=( args=(
'(-d --directory)'{-d,--directory}'[make directory instead of file]' '(-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]' '(-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]' '(-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) case $variant in
if [[ $variant == *busybox* ]]; then # See also: _busybox ^(dragonfly|darwin)*)
args=( ${args:#((#s)|*\))(\*|)--^help*} ) args+=( '(-p --tmpdir)'{-p+,--tmpdir=}'[make relative to specified directory]: :_directories' )
elif [[ $variant != gnu ]]; then ;|
args=( ${args:#((#s)|*\))(\*|)--*} ) gnu)
fi args+=(
'--suffix=[append specified suffix to template]:template suffix'
[[ $variant == gnu ]] || { '(: -)'{-V,--version}'[display version information]'
# BusyBox, OpenBSD, and Solaris have -p, but -t doesn't take an argument )
if [[ $variant == *busybox* ]] || [[ $OSTYPE == (openbsd|solaris)* ]]; then ;|
args=( ${args:#((#s)|*\))(\*|)-t*} ) # Most variants don't support long options (except BusyBox's --help)
args+=( '-t[generate template relative to temp dir]' ) ^(gnu|freebsd*))
# Dragonfly, FreeBSD, and Darwin take an argument to -t and support any number args=( ${args:#((#s)|*\))(\*|)--*} )
# of template files. These OSes do not have -p and -V. ;|
else gnu|*busybox*)
args=( ${args:#((#s)|*\))(1:*|(\*|)-[ptV]*)} ) 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+=( args+=(
'-t[generate template relative to temp dir using specified prefix]:template prefix' '-t[generate template relative to temp dir using specified prefix]:template prefix'
'*: :_guard "^-*" "template name"' '*: :_guard "^-*" "template name"'
) )
fi ;;
} esac
_arguments -s -S : $args _arguments -s -S : $args

View file

@ -302,6 +302,9 @@ case $OSTYPE in
memory+=( $Xopt) statistics+=( $Xopt ) memory+=( $Xopt) statistics+=( $Xopt )
pcb+=( $Mopts $popt ) pcb+=( $Mopts $popt )
;; ;;
freebsd<14->.*)
args+=( '-j+[run inside a jail]:jail:_jails' )
;&
freebsd<13->.*) freebsd<13->.*)
sockets+=( sockets+=(
'-c[show TCP stack used for each session]' '-c[show TCP stack used for each session]'

View file

@ -47,7 +47,7 @@ case $OSTYPE in
'-q[be quiet: suppress display of starting and ending lines]' '-q[be quiet: suppress display of starting and ending lines]'
'(-a -r -k)-d[suppress sleeps when playing back a session]' '(-a -r -k)-d[suppress sleeps when playing back a session]'
'(-a -r -k -t)-p[play back a recorded 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*) netbsd*|openbsd*)
@ -60,7 +60,9 @@ case $OSTYPE in
;| ;|
freebsd*) freebsd*)
args+=( args+=(
'-e[return exit status of the child process]'
'-f[use filemon(4)]' '-f[use filemon(4)]'
'(-a -r -k -t)-T[play back a recorded session, reporting only timestamps]: :_date_formats'
) )
;| ;|
darwin*|dragonfly*|freebsd*) darwin*|dragonfly*|freebsd*)
@ -71,8 +73,6 @@ case $OSTYPE in
'*:::arguments: _normal $service' '*:::arguments: _normal $service'
) )
;| ;|
darwin*|freebsd*)
;|
*) *)
args+=( args+=(
'(-p -d)-a[append output]' '(-p -d)-a[append output]'

View file

@ -10,8 +10,11 @@ zstyle -T ":completion:${ctx}" tag-order && \
zstyle ":completion:${ctx}" tag-order init zstyle ":completion:${ctx}" tag-order init
case $OSTYPE in case $OSTYPE in
freebsd<14->.*)
args=( '-E+[set environment variable before executing the rc.d script]:variable:_parameters -g "*export*~*readonly*" -S=' )
;&
freebsd<11->.*) freebsd<11->.*)
args=( '-j+[perform actions in specified jail]:jail:_jails' ) args+=( '-j+[perform actions in specified jail]:jail:_jails' )
;& ;&
freebsd*|dragonfly*) freebsd*|dragonfly*)
actions=( actions=(

View file

@ -8,7 +8,7 @@ _pick_variant -r variant gnu=GNU $OSTYPE --version
args=( args=(
'-a+[generate suffixes of specified length]:length [2]' \ '-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' \ '(-b -p -n)-l+[put specified number of lines/records in each output file]:lines' \
'1:file:_files' \ '1:file:_files' \
'2: :_guard "^-*" "prefix [x]"' '2: :_guard "^-*" "prefix [x]"'
@ -19,8 +19,8 @@ case $variant in
args=( -C args=( -C
'(H -a --suffix-length)'{-a+,--suffix-length=}'[generate suffixes of specified length]:length [2]' '(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)--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)'{-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]: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]: :_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 --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 -x --hex-suffixes)--numeric-suffixes=-[use numeric suffixes]::start value [0]'
'(H -d --numeric-suffixes --hex-suffixes)-x[use hex suffixes starting at 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' '(-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 esac
_arguments -s -S $args && ret=0 _arguments -s -S $args && ret=0

View file

@ -57,7 +57,7 @@ _ssh () {
"-N[don't execute a remote command]" \ "-N[don't execute a remote command]" \
'-n[redirect stdin from /dev/null]' \ '-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))' \ '-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' \ '-p+[specify port on remote host]:port number on remote host' \
'(-v)*-q[quiet operation]' \ '(-v)*-q[quiet operation]' \
'*-R+[specify remote port forwarding]:remote port forwarding:->forward' \ '*-R+[specify remote port forwarding]:remote port forwarding:->forward' \

View file

@ -28,6 +28,12 @@ case $OSTYPE in
'(- :)'{-V,--version}'[display version info and exit]' \ '(- :)'{-V,--version}'[display version info and exit]' \
'*:sysctl variable:_files -W /proc/sys' '*: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->.*) freebsd<11->.*)
args+=( args+=(
'-B[specify buffer size for reading]:buffer size' '-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]' \ '-d[print the description of the variable instead of its value]' \
'(-N -n)-e[separate name and value with =]' \ '(-N -n)-e[separate name and value with =]' \
"-i[silently exit if variable doesn't exist]" \ "-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]' \ '(-N)-n[show only variable values]' \
'(-x)-o[show opaques as well (values suppressed)]' \ '(-x)-o[show opaques as well (values suppressed)]' \
'-q[suppress some warnings]' \ '-q[suppress some warnings]' \

View file

@ -1,6 +1,6 @@
#autoload #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 local -a args
cmd="$1" cmd="$1"
@ -26,6 +26,8 @@ _diff_palette() {
} }
if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12->.* ]]; then if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12->.* ]]; then
(( $#words > 2 )) && ign='!'
# output formats # output formats
of="-y --side-by-side -n --rcs -e -f --ed -q --brief -c -C --context -u -U \ 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 \ --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" --unchanged-group-format"
if [[ $variant = gnu ]]; then if [[ $variant = gnu ]]; then
(( $#words > 2 )) || args+=(
'(-v --version)'{-v,--version}'[display version information]'
'--help[display usage information]'
)
args+=( args+=(
'(-H --speed-large-files)'{-H,--speed-large-files}'[assume large files and many small changes]' '(-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]' '(-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]' '(-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]" "($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)--old-group-format=[set old group format]:old group format"
"($ofwg $ouc $oss)--new-group-format=[set new group format]:new 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" "($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' \ '(--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' \ '(--from-file)--to-file=[compare all operands to specified file]:to file:_files'
'--color=-[use colors in output]::when [auto]:(never always auto)' '--color=-[use colors in output]::when [auto]:(never always auto)'
'--palette=[specify colors to use]:color:_diff_palette' '--palette=[specify colors to use]:color:_diff_palette'
"${ign}(1 2)-v[display version information]"
) )
else else
args+=( '!--speed-large-files' ) 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]" \ "($of $oss)-u[output a unified diff]" \
"($ofwuc $oss)*"{-L+,--label=}'[set label to use instead of file name and timestamp]:label' \ "($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 -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)"{-q,--brief}'[output only whether files differ]' \
"($of $ouc $oss -e --ed)"{--ed,-e}'[output an ed script]' \ "($of $ouc $oss -e --ed)"{--ed,-e}'[output an ed script]' \
"!($of $ouc $oss)--normal" \ "!($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]' \ "($of $ouc)"{-y,--side-by-side}'[output in two columns]' \
"($ofwy $ouc)--suppress-common-lines[don't output common lines]" \ "($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' \ "($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 else
of='-c -e -f' of='-c -e -f'