mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-05-20 23:41:27 +02:00
52217: update completions for FreeBSD 14
This commit is contained in:
parent
4878c2b130
commit
985952e2f6
21 changed files with 213 additions and 124 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,5 +1,18 @@
|
|||
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
|
||||
them to be UTF-8 encoded
|
||||
|
||||
|
|
|
@ -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' \
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)"$(</etc/protocols)"}##[a-z0-9]*}}; do
|
||||
case $proto in
|
||||
|
|
|
@ -1,23 +1,29 @@
|
|||
#compdef cmp gcmp
|
||||
|
||||
local args variant
|
||||
local args variant units
|
||||
_pick_variant -r variant gnu=GNU $OSTYPE --version
|
||||
|
||||
case $variant in
|
||||
gnu)
|
||||
freebsd*|gnu)
|
||||
args=(
|
||||
'(-b --print-bytes)'{-b,--print-bytes}'[print differing bytes]'
|
||||
'(-i --ignore-initial)'{-i+,--ignore-initial}'[skip specified number of bytes]:bytes'
|
||||
'(-l --verbose -s --silent --quiet)'{-l,--verbose}'[output all differences]'
|
||||
'(-n --bytes)'{-n+,--bytes=}'[specify maximum bytes to compare]:bytes'
|
||||
'(-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]'
|
||||
'(- *)--help[display help information]'
|
||||
)
|
||||
units+=" kB MB GB TB PB EB ZB YB"
|
||||
;;
|
||||
netbsd*) args+=( "-c[don't use mmap]" ) ;|
|
||||
freebsd*|openbsd*)
|
||||
args=(
|
||||
args+=(
|
||||
"-h[don't follow symbolic links]"
|
||||
'-x[hexadecimal output and zero based offset index]'
|
||||
'-z[compare file sizes first]'
|
||||
|
@ -31,4 +37,4 @@ case $variant in
|
|||
;;
|
||||
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"
|
||||
|
|
|
@ -76,8 +76,8 @@ else
|
|||
;|
|
||||
openbsd*|netbsd*) args+=( '-a[gradually skew]' )
|
||||
;|
|
||||
openbsd*)
|
||||
args+=( '-z[specify timezone for output]:time zone:_time_zone')
|
||||
freebsd<14->.*|openbsd*)
|
||||
args+=( '-z+[specify timezone for output]:time zone:_time_zone')
|
||||
;|
|
||||
netbsd*)
|
||||
args+=( '-d[output date specified by string]:time string:' )
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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'
|
||||
;;
|
||||
|
|
|
@ -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]' )
|
||||
;;
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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: "
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]'
|
||||
|
|
|
@ -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]'
|
||||
|
|
|
@ -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=(
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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' \
|
||||
|
|
|
@ -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]' \
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue