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 --- 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 ++++++------ 16 files changed, 109 insertions(+), 64 deletions(-) (limited to 'Completion/Unix') diff --git a/Completion/Unix/Command/_cmp b/Completion/Unix/Command/_cmp index 6d7bfb1b7..20d309e32 100644 --- a/Completion/Unix/Command/_cmp +++ b/Completion/Unix/Command/_cmp @@ -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" diff --git a/Completion/Unix/Command/_date b/Completion/Unix/Command/_date index 9add1a9bc..a15d30b21 100644 --- a/Completion/Unix/Command/_date +++ b/Completion/Unix/Command/_date @@ -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:' ) 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 1.4.1