1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 22:11:54 +02:00

53326: completion updates for core Linux utils

This commit is contained in:
Oliver Kiddle 2025-01-27 23:06:16 +01:00
parent 87aba4d437
commit f3b865b915
24 changed files with 72 additions and 28 deletions

View file

@ -1,5 +1,19 @@
2025-01-27 Oliver Kiddle <opk@zsh.org> 2025-01-27 Oliver Kiddle <opk@zsh.org>
* 53326: Completion/Linux/Command/_findmnt,
Completion/Linux/Command/_free, Completion/Linux/Command/_losetup,
Completion/Linux/Command/_lsblk, Completion/Linux/Command/_pidof,
Completion/Linux/Command/_slabtop, Completion/Linux/Command/_wipefs,
Completion/Unix/Command/_awk, Completion/Unix/Command/_chmod,
Completion/Unix/Command/_chown, Completion/Unix/Command/_cmp,
Completion/Unix/Command/_find, Completion/Unix/Command/_hexdump,
Completion/Unix/Command/_last, Completion/Unix/Command/_mv,
Completion/Unix/Command/_objdump, Completion/Unix/Command/_pgrep,
Completion/Unix/Command/_ping, Completion/Unix/Command/_ps,
Completion/Unix/Command/_readelf, Completion/Unix/Command/_strip,
Completion/Unix/Command/_uptime, Completion/Unix/Command/_w:
completion updates for core Linux utils
* 53325: Completion/BSD/Command/_acpiconf, * 53325: Completion/BSD/Command/_acpiconf,
Completion/BSD/Command/_bsdconfig, Completion/BSD/Command/_pkgin, Completion/BSD/Command/_bsdconfig, Completion/BSD/Command/_pkgin,
Completion/BSD/Command/_procstat, Completion/BSD/Command/_sockstat, Completion/BSD/Command/_procstat, Completion/BSD/Command/_sockstat,

View file

@ -8,6 +8,7 @@
# #
local curcontext=$curcontext state state_descr line ret=1 local curcontext=$curcontext state state_descr line ret=1
typeset -A opt_args typeset -A opt_args
local -a suf dedup
_arguments -s -C \ _arguments -s -C \
'(H -A --all)'{-A,--all}'[print all filesystems]' \ '(H -A --all)'{-A,--all}'[print all filesystems]' \
@ -45,6 +46,7 @@ _arguments -s -C \
'(H)2:: :->targets' \ '(H)2:: :->targets' \
+ '(format)' \ + '(format)' \
'(H)'{-D,--df}'[imitate the output of df command]' \ '(H)'{-D,--df}'[imitate the output of df command]' \
'(H)'{-I,--dfi}'[imitate the output of df with -i option]' \
'(H)'{-J,--json}'[use JSON output format]' \ '(H)'{-J,--json}'[use JSON output format]' \
'(H)'{-l,--list}'[use list output format]' \ '(H)'{-l,--list}'[use list output format]' \
'(H)'{-P,--pairs}'[use key="value" output format]' \ '(H)'{-P,--pairs}'[use key="value" output format]' \
@ -55,6 +57,7 @@ _arguments -s -C \
'(H)'{-N+,--task=}'[search /proc/<pid>/mountinfo]: :_pids' \ '(H)'{-N+,--task=}'[search /proc/<pid>/mountinfo]: :_pids' \
'(H)'{-s,--fstab}'[search in /etc/fstab]' \ '(H)'{-s,--fstab}'[search in /etc/fstab]' \
+ '(H)' \ + '(H)' \
'(* -)'{-H,--list-columns}'[list available columns]' \
'(- :)'{-h,--help}'[display help text and exit]' \ '(- :)'{-h,--help}'[display help text and exit]' \
'(- :)'{-V,--version}'[display version and exit]' \ '(- :)'{-V,--version}'[display version and exit]' \
&& ret=0 && ret=0
@ -66,13 +69,16 @@ __findmnt_mountpoints () {
case $state in case $state in
columns) columns)
dedup=( ${(Ms.,.)${PREFIX#+}##*,} ${(Ms.,.)SUFFIX%%,*} )
suf=( -qS , )
compset -S ',*' && suf=()
compset -P '+' || _describe -t list-prefixes prefix \ compset -P '+' || _describe -t list-prefixes prefix \
'( +:"not replace but extend the list" )' -S '' && ret=0 '( +:"not replace but extend the list" )' -S '' && ret=0
compset -P '*,'
local -a columns=( local -a columns=(
${${${(f)"$(_call_program columns findmnt -h)"}[(r)Available*,-2]}[2,-1]} ${${${${(f)"$(_call_program columns findmnt --list-columns)"}## #}//:/\\:}/ <[^>]#> #/:}
) )
columns=( ${${${${${${columns## #}//:/\\:}//\[/\\[}//]/\\]}/ /[}/%/]} ) _describe -t fields column columns -M 'm:{a-z}={A-Z}' $suf -F dedup && ret=0
_values -s , -M 'm:{a-z}={A-Z}' column $columns && ret=0
;; ;;
*) # call "findmnt $opts" to get possible sources/targets *) # call "findmnt $opts" to get possible sources/targets
local opts='-lnve' local opts='-lnve'

View file

@ -2,6 +2,7 @@
_arguments -s \ _arguments -s \
'(-l --lohi)'{-l,--lohi}'[show detailed low and high memory statistics]' \ '(-l --lohi)'{-l,--lohi}'[show detailed low and high memory statistics]' \
'(-L --line)'{-L,--line}'[show output on a single line]' \
'(-t --total)'{-t,--total}'[show total for RAM + swap]' \ '(-t --total)'{-t,--total}'[show total for RAM + swap]' \
'(-v --committed)'{-v,--committed}'[show committed memory and commit limit]' \ '(-v --committed)'{-v,--committed}'[show committed memory and commit limit]' \
'(-w --wide)'{-w,--wide}'[wide mode]' \ '(-w --wide)'{-w,--wide}'[wide mode]' \

View file

@ -18,7 +18,7 @@ _arguments -s -S \
- 'info' \ - 'info' \
'(-v --verbose)'{-v,--verbose}'[verbose mode]' \ '(-v --verbose)'{-v,--verbose}'[verbose mode]' \
'(-o --offset -a --all)'{-a,--all}'[show the status of all loop devices]' \ '(-o --offset -a --all)'{-a,--all}'[show the status of all loop devices]' \
'(-O --output --output-all)'{-O+,--output=}'[specify columns to be printed with --list]:column:_sequence -s , compadd - name autoclear back-file back-ino back-maj\:min maj\:min offset partscan ro sizelimit dio log-sec' \ '(-O --output --output-all)'{-O+,--output=}'[specify columns to be printed with --list]:column:_sequence -s , compadd -M "B\:+=" - name autoclear back-file back-ino back-maj\:min back-maj back-min maj\:min maj min offset partscan ref ro sizelimit dio log-sec' \
'(-O --output)--output-all[output all columns]' \ '(-O --output)--output-all[output all columns]' \
'(-J --json --raw -O --output -n --noheadings)'{-J,--json}'[use JSON --list output format]' \ '(-J --json --raw -O --output -n --noheadings)'{-J,--json}'[use JSON --list output format]' \
'(-l --list)'{-l,--list}'[list currently used loop devices]' \ '(-l --list)'{-l,--list}'[list currently used loop devices]' \
@ -33,6 +33,7 @@ _arguments -s -S \
{-D,--detach-all}'[detach all associated loop devices]' \ {-D,--detach-all}'[detach all associated loop devices]' \
- 'create' \ - 'create' \
'--direct-io[open backing file with O_DIRECT]::enable:(on off)' \ '--direct-io[open backing file with O_DIRECT]::enable:(on off)' \
'--loop-ref=[specify loop device reference]:string' \
'(-f --find 1)'{-f,--find}'[find the first unused loop device]' \ '(-f --find 1)'{-f,--find}'[find the first unused loop device]' \
'(-L --nooverlap)'{-L,--nooverlap}'[avoid possible conflict between devices]' \ '(-L --nooverlap)'{-L,--nooverlap}'[avoid possible conflict between devices]' \
'(-P --partscan)'{-P,--partscan}'[scan the partition table of newly created loop devices]' \ '(-P --partscan)'{-P,--partscan}'[scan the partition table of newly created loop devices]' \

View file

@ -8,6 +8,10 @@ typeset -A opt_args
_arguments -C -s -S \ _arguments -C -s -S \
'(H -A --noempty)'{-A,--noempty}"[don't print empty devices]" \ '(H -A --noempty)'{-A,--noempty}"[don't print empty devices]" \
'(H -E --dedup)'{-E+,--dedup=}'[de-duplicate output by specified column]:column:->columns' \ '(H -E --dedup)'{-E+,--dedup=}'[de-duplicate output by specified column]:column:->columns' \
'(H -Q --filter)'{-Q+,--filter=}'[only print lines matching expression]:expression' \
'(H)--highlight=[color lines matching expression]:expression' \
'(H)*--ct-filter=[restrict the next counter]:expression' \
'(H)*--ct=[define a custom counter]:name\:param\:func' \
'(H -a --all)'{-a,--all}'[print all devices]' \ '(H -a --all)'{-a,--all}'[print all devices]' \
'(H -b --bytes)'{-b,--bytes}'[print size in bytes rather than in human readable format]' \ '(H -b --bytes)'{-b,--bytes}'[print size in bytes rather than in human readable format]' \
'(H -d --nodeps)'{-d,--nodeps}"[don't print slaves or holders]" \ '(H -d --nodeps)'{-d,--nodeps}"[don't print slaves or holders]" \
@ -40,6 +44,7 @@ _arguments -C -s -S \
'(H)'{-P,--pairs}'[use key="value" output format]' \ '(H)'{-P,--pairs}'[use key="value" output format]' \
'(H)'{-r,--raw}'[use raw output format]' \ '(H)'{-r,--raw}'[use raw output format]' \
+ 'H' \ + 'H' \
'(* -)'{-H,--list-columns}'[list the available columns]' \
'(* -)'{-h,--help}'[display help information]' \ '(* -)'{-h,--help}'[display help information]' \
'(* -)'{-V,--version}'[display version information]' && ret=0 '(* -)'{-V,--version}'[display version information]' && ret=0
@ -56,7 +61,7 @@ case $state in
;| ;|
column*) column*)
values=( values=(
${${${${(f)"$(_call_program columns lsblk -h)"}[(r)Available*,-2]## #}[2,-1]//:/\\:}/ /:} ${${${${(f)"$(_call_program columns lsblk --list-columns)"}## #}//:/\\:}/ <[^>]#> #/:}
) )
_describe -t fields column values -M 'm:{a-z}={A-Z}' $suf -F dedup && ret=0 _describe -t fields column values -M 'm:{a-z}={A-Z}' $suf -F dedup && ret=0
;; ;;

View file

@ -17,6 +17,7 @@ case $variant in
'(-w --with-workers)'{-w,--with-workers}'[show kernel workers too]' \ '(-w --with-workers)'{-w,--with-workers}'[show kernel workers too]' \
"(-x $exargs)"-x'[include shells running named scripts]' \ "(-x $exargs)"-x'[include shells running named scripts]' \
"($exargs)"\*{-o+,--omit-pid=}'[omit processes with PIDs]:pids:_sequence -s , _pids' \ "($exargs)"\*{-o+,--omit-pid=}'[omit processes with PIDs]:pids:_sequence -s , _pids' \
'(-t --lightweight)'{-t,--lightweight}'[list threads too]' \
'(-S --separator)'{-S+,--separator=}'[specify separator put between PIDs]:separator' \ '(-S --separator)'{-S+,--separator=}'[specify separator put between PIDs]:separator' \
'*:process:->procnames' \ '*:process:->procnames' \
&& return 0 && return 0

View file

@ -1,5 +1,4 @@
#compdef slabtop #compdef slabtop
# based on procps-ng-3.3.15
local -a criteria=( local -a criteria=(
'a:number of active objects' 'a:number of active objects'
@ -18,5 +17,6 @@ _arguments -s \
'(-d --delay -o --once)'{-d+,--delay=}'[specify the delay between updates]:seconds: ' \ '(-d --delay -o --once)'{-d+,--delay=}'[specify the delay between updates]:seconds: ' \
'(-s --sort)'{-s+,--sort=}'[specify the sort criteria]:criteria:(($criteria))' \ '(-s --sort)'{-s+,--sort=}'[specify the sort criteria]:criteria:(($criteria))' \
'(-d --delay -o --once)'{-o,--once}'[display the output once and exit]' \ '(-d --delay -o --once)'{-o,--once}'[display the output once and exit]' \
'--human[show human-readable output]' \
'(-)'{-V,--version}'[display version information and exit]' \ '(-)'{-V,--version}'[display version information and exit]' \
'(-)'{-h,--help}'[display usage information and exit]' '(-)'{-h,--help}'[display usage information and exit]'

View file

@ -2,7 +2,8 @@
_arguments -s -S \ _arguments -s -S \
'(H -a --all)'{-a,--all}'[wipe all magic strings]' \ '(H -a --all)'{-a,--all}'[wipe all magic strings]' \
'(H -b --backup)'{-b,--backup}'[create a signature backup in $HOME]' \ '(H --backup)-b[create a signature backup in $HOME]' \
'(H -b)--backup=-[create a signature backup in $HOME]::path [$HOME]:_directories' \
'(H -f --force)'{-f,--force}'[force erasure]' \ '(H -f --force)'{-f,--force}'[force erasure]' \
'(H -i --no-headings -J --json -p --parsable)'{-i,--no-headings}"[don't print headings]" \ '(H -i --no-headings -J --json -p --parsable)'{-i,--no-headings}"[don't print headings]" \
'(H -J --json -i --no-headings -p --parsable)'{-J,--json}'[use JSON output format]' \ '(H -J --json -i --no-headings -p --parsable)'{-J,--json}'[use JSON output format]' \

View file

@ -51,6 +51,7 @@ case $variant in
{-g,--gen-pot}'[scan awk program and generate .po file on stdout]' {-g,--gen-pot}'[scan awk program and generate .po file on stdout]'
'*'{-i+,--include}'[load source library]:library file:->script' '*'{-i+,--include}'[load source library]:library file:->script'
{-I,--trace}'[print internal byte code names as they are executed]' {-I,--trace}'[print internal byte code names as they are executed]'
'(-k --csv)'{-k,--csv}'[enable CSV special processing]'
'*'{-l+,--load}'[load dynamic extension]:extension:->extension' '*'{-l+,--load}'[load dynamic extension]:extension:->extension'
{-M,--bignum}'[select arbitrary-precision arithmetic on numbers]' {-M,--bignum}'[select arbitrary-precision arithmetic on numbers]'
{-o-,--pretty-print=-}'[pretty-print awk program]::output file:_files' {-o-,--pretty-print=-}'[pretty-print awk program]::output file:_files'

View file

@ -19,6 +19,13 @@ case "$variant" in
'*: :->files' '*: :->files'
) )
;; ;;
gnu|freebsd*|openbsd*|netbsd*|darwin*|dragonfly*)
args+=(
'(-H -L -P)-L[follow all symlinks]'
'(-H -L -P)-H[follow symlinks on the command line]'
'(-H -L -P)-P[do not follow symlinks (default)]'
)
;|
gnu) gnu)
aopts=() aopts=()
args+=( args+=(
@ -49,13 +56,6 @@ case "$variant" in
'-h[operate on symlinks themselves]' '-h[operate on symlinks themselves]'
) )
;| ;|
freebsd*|openbsd*|netbsd*|darwin*|dragonfly*)
args+=(
'(-H -L -P)-L[follow all symlinks]'
'(-H -L -P)-H[follow symlinks on the command line]'
'(-H -L -P)-P[do not follow symlinks (default)]'
)
;|
darwin*) darwin*)
args+=( args+=(
'(1)-C[return false if any specified files have ACLs]' '(1)-C[return false if any specified files have ACLs]'

View file

@ -13,6 +13,7 @@ case "$variant" in
'(-h --no-dereference)--dereference[dereference symlinks]' '(-h --no-dereference)--dereference[dereference symlinks]'
'(-h --no-dereference --dereference)'{-h,--no-dereference}'[operate on symlinks themselves]' '(-h --no-dereference --dereference)'{-h,--no-dereference}'[operate on symlinks themselves]'
'(-f --silent --quiet)'{-f,--silent,--quiet}"[don't report errors]" '(-f --silent --quiet)'{-f,--silent,--quiet}"[don't report errors]"
'--from=[restrict changes to files by current ownership]: :->owner'
'--preserve-root[fail to operate recursively on /]' '--preserve-root[fail to operate recursively on /]'
'--reference=[copy ownership of specified file]:file:_files' '--reference=[copy ownership of specified file]:file:_files'
'(-R --recursive)'{-R,--recursive}'[change files and directories recursively]' '(-R --recursive)'{-R,--recursive}'[change files and directories recursively]'
@ -22,8 +23,6 @@ case "$variant" in
'(- : *)--help[display help information]' '(- : *)--help[display help information]'
'(- : *)--version[display version information]' '(- : *)--version[display version information]'
) )
[[ $service = chown ]] &&
args+=( '--from=[restrict changes to files by current ownership]: :->owner' )
;; ;;
*) *)
args=( args=(

View file

@ -15,7 +15,7 @@ case $variant in
units=":_numbers -u bytes offset K M G T P E Z Y" units=":_numbers -u bytes offset K M G T P E Z Y"
;| ;|
gnu) gnu)
args=( args+=(
'(- *)'{-v,--version}'[display version information]' '(- *)'{-v,--version}'[display version information]'
'(- *)--help[display help information]' '(- *)--help[display help information]'
) )

View file

@ -109,7 +109,6 @@ case $variant in
'-regextype:regexp syntax:(help findutils-default awk egrep ed emacs gnu-awk grep posix-awk posix-basic posix-egrep posix-extended posix-minimal-basic sed)' '-regextype:regexp syntax:(help findutils-default awk egrep ed emacs gnu-awk grep posix-awk posix-basic posix-egrep posix-extended posix-minimal-basic sed)'
'*-warn' '*-warn'
'*-nowarn' '*-nowarn'
'*-xautofs'
'*-used:access after inode change (days)' '*-used:access after inode change (days)'
'*-executable' '*-executable'
'*-readable' '*-readable'

View file

@ -25,6 +25,7 @@ if [[ $OSTYPE = linux* ]]; then
'(- *)'{-h,--help}'[display usage information]' '(- *)'{-h,--help}'[display usage information]'
'(- *)'{-V,--version}'[display version information]' '(- *)'{-V,--version}'[display version information]'
) )
fmts+=( {--one-byte-hex,-X}'[one-byte hexadecimal display]' )
else else
# strip long options by taking every second element # strip long options by taking every second element
print -v fmts -f '%2$s' -- "$fmts[@]" print -v fmts -f '%2$s' -- "$fmts[@]"

View file

@ -41,6 +41,7 @@ case $OSTYPE in
'(-R --nohostname)'{-R,--nohostname}'[suppress display of hostname field]' '(-R --nohostname)'{-R,--nohostname}'[suppress display of hostname field]'
'(-s --since)'{-s+,--since=}'[display lines since the specified time]:time (YYYYMMDDhhmmss)' '(-s --since)'{-s+,--since=}'[display lines since the specified time]:time (YYYYMMDDhhmmss)'
'(-t --until)'{-t+,--until=}'[display lines until the specified time]:time (YYYYMMDDhhmmss)' '(-t --until)'{-t+,--until=}'[display lines until the specified time]:time (YYYYMMDDhhmmss)'
'(-T --tab-separated)'{-T,--tab-separated}'[use tabs as delimiters]'
'(-p --present)'{-p+,--present=}'[display who were present at the specified time]:time (YYYYMMDDhhmmss)' '(-p --present)'{-p+,--present=}'[display who were present at the specified time]:time (YYYYMMDDhhmmss)'
'(-w --fullnames)'{-w,--fullnames}'[show full user and domain names]' '(-w --fullnames)'{-w,--fullnames}'[show full user and domain names]'
'(-x --system)'{-x,--system}'[display shutdown/runlevel entries]' '(-x --system)'{-x,--system}'[display shutdown/runlevel entries]'

View file

@ -14,6 +14,7 @@ case $variant; in
{simple,never}"[always make simple backups]"' {simple,never}"[always make simple backups]"'
'(-b --backup -n --no-clobber)-b[make a backup of each existing destination file]' '(-b --backup -n --no-clobber)-b[make a backup of each existing destination file]'
'(-v)--debug[explain how a file is copied]' '(-v)--debug[explain how a file is copied]'
'--exchange[exchange source and destination]'
'(-f --force -i --interactive -n --no-clobber)'{-f,--force}"[don't prompt before overwriting]" '(-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)'{-i,--interactive}'[prompt before overwriting existing file]'
'(-f --force -i --interactive -n --no-clobber)'{-n,--no-clobber}"[don't overwrite existing file]" '(-f --force -i --interactive -n --no-clobber)'{-n,--no-clobber}"[don't overwrite existing file]"
@ -22,7 +23,7 @@ case $variant; in
'(-S --suffix)'{-S+,--suffix=}'[specify the backup suffix]:backup suffix [~]' '(-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 --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]' '(-T --no-target-directory)'{-T,--no-target-directory}'[treat final argument as a normal file]'
'(-u)--update=-[move only when destination file is older or missing]::update files [older]:(all none older)' '(-u)--update=-[move only when destination file is older or missing]::update files [older]:(all none none-fail older)'
'(--update)-u[move only when destination file is older or missing]' '(--update)-u[move only when destination file is older or missing]'
'(-v --verbose)'{-v,--verbose}'[show file names after they are moved]' '(-v --verbose)'{-v,--verbose}'[show file names after they are moved]'
'(- *)--help[display usage information]' '(- *)--help[display usage information]'

View file

@ -32,6 +32,7 @@ case $variant in
'(-D --disassemble-all)'{-D,--disassemble-all}'[display assembler contents of all sections]' '(-D --disassemble-all)'{-D,--disassemble-all}'[display assembler contents of all sections]'
'(-S --source)'{-S,--source}'[intermix source code with disassembly]' '(-S --source)'{-S,--source}'[intermix source code with disassembly]'
'--source-comment=-[prefix lines of source code with specified text]::text prefix [# ]' '--source-comment=-[prefix lines of source code with specified text]::text prefix [# ]'
'(-Z --decompress)'{-Z,--decompress}'[decompress section(s) before displaying their contents]'
'(-g --debugging)'{-g,--debugging}'[display debug information in object file]' '(-g --debugging)'{-g,--debugging}'[display debug information in object file]'
'(-e --debugging-tags)'{-e,--debugging-tags}'[display debug information using ctags style]' '(-e --debugging-tags)'{-e,--debugging-tags}'[display debug information using ctags style]'
'(-G --stabs)'{-G,--stabs}'[display (in raw form) any STABS info in the file]' '(-G --stabs)'{-G,--stabs}'[display (in raw form) any STABS info in the file]'
@ -176,13 +177,14 @@ case "$state" in
'O[str-offsets]' \ 'O[str-offsets]' \
"o[loc]" "R[ranges]" "t[pubtypes]" "U[trace_info]" "u[trace_abbrev]" \ "o[loc]" "R[ranges]" "t[pubtypes]" "U[trace_info]" "u[trace_abbrev]" \
"T[trace_aranges]" "g[gdb_index]" "A[addr]" "c[cu_index]" "k[links]" \ "T[trace_aranges]" "g[gdb_index]" "A[addr]" "c[cu_index]" "k[links]" \
"K[follow-links]" && ret=0 "K[follow-links]" "D[use-debuginfod]" "E[do-not-use-debuginfod]" && ret=0
;; ;;
dwarf-names) dwarf-names)
_sequence _wanted dwarf-sections expl "dwarf section" compadd - \ _sequence _wanted dwarf-sections expl "dwarf section" compadd - \
rawline decodedline info abbrev pubnames aranges macro frames \ rawline decodedline info abbrev pubnames aranges macro frames \
frames-interp str str-offsets loc Ranges pubtypes gdb_index trace_info \ frames-interp str str-offsets loc Ranges pubtypes gdb_index trace_info \
trace_abbrev trace_aranges addr cu_index links follow-links && ret=0 trace_abbrev trace_aranges addr cu_index links follow-links \
use-debuginfod do-not-use-debuginfod && ret=0
;; ;;
bfdnames) bfdnames)
_wanted targets expl target compadd - \ _wanted targets expl target compadd - \

View file

@ -48,6 +48,7 @@ arguments=(
'--cgroup=[match by cgroup v2 names]:cgroup' '--cgroup=[match by cgroup v2 names]:cgroup'
'--ns=[match only on same namespaces as specified PID]: :_pids' '--ns=[match only on same namespaces as specified PID]: :_pids'
'--nslist=[match only on specified namespaces (with --ns)]:namespace:(ipc mnt net pid user uts)' '--nslist=[match only on specified namespaces (with --ns)]:namespace:(ipc mnt net pid user uts)'
'*--env=[match on environment variable]:var[=value]:_parameters -g "*export*" -qS='
'(: * -)'{-V,--version}'[display version information]' '(: * -)'{-V,--version}'[display version information]'
'-z+[match only on specified zone IDs]:zone:_sequence _zones' '-z+[match only on specified zone IDs]:zone:_sequence _zones'
) )

View file

@ -196,6 +196,7 @@ case ${variant}:${${service#ping}:-4} in
;; ;;
iputils:*) iputils:*)
args+=( args+=(
'-3[RTT precision (do not round up the result time)]'
'-A[adaptive]' '-A[adaptive]'
'-b[allow pinging a broadcast address]' '-b[allow pinging a broadcast address]'
"-B[don't allow ping to change source address]" "-B[don't allow ping to change source address]"
@ -204,12 +205,14 @@ case ${variant}:${${service#ping}:-4} in
'-e+[define identifier for ping session]:identifier' '-e+[define identifier for ping session]:identifier'
'(-4)-F+[allocate and set 20-bit flow label]:flow label (hex)' '(-4)-F+[allocate and set 20-bit flow label]:flow label (hex)'
'(-)-h[show usage information]' '(-)-h[show usage information]'
'(-n)-H[force reverse DNS name resolution even for numeric destination]'
'-I+[specify source interface]:interface:_net_interfaces' '-I+[specify source interface]:interface:_net_interfaces'
'-m+[specify mark to tag outgoing packets]:mark' '-m+[specify mark to tag outgoing packets]:mark'
"-M+[specify path MTU discovery strategy]:strategy:(( "-M+[specify path MTU discovery strategy]:strategy:((
do\:prohibit\ fragmentation,\ even\ local\ one do\:prohibit\ fragmentation,\ even\ local\ one
want\:do\ PMTU\ discovery want\:do\ PMTU\ discovery
dont\:don\'t\ set\ DF\ flag))" dont\:don\'t\ set\ DF\ flag
probe\:set\ DF\ flag\ and\ bypass\ PMTU\ checks))"
'(-4)-N+[send ICMPv6 node information queries instead of echo request]:sub option' '(-4)-N+[send ICMPv6 node information queries instead of echo request]:sub option'
'-O[report outstanding ICMP ECHO reply before sending next packet]' '-O[report outstanding ICMP ECHO reply before sending next packet]'
'-Q+[set Quality of Service-related bits in ICMP datagrams]:QoS TOS bits' '-Q+[set Quality of Service-related bits in ICMP datagrams]:QoS TOS bits'

View file

@ -172,6 +172,7 @@ case $OSTYPE in
'--headers[repeat header lines, one per page of output]' '--headers[repeat header lines, one per page of output]'
'(--cols --columns --width)'{--cols,--columns,--width}'[set screen width]:width' '(--cols --columns --width)'{--cols,--columns,--width}'[set screen width]:width'
'(--lines --rows)'{--lines,--rows}'[set screen height]' '(--lines --rows)'{--lines,--rows}'[set screen height]'
'--signames[display signal masks using signal names]'
'--cumulative[include child process data with the parent]' '--cumulative[include child process data with the parent]'
'-n[set namelist file for WCHAN display]:file:_files' '-n[set namelist file for WCHAN display]:file:_files'
'(--no-headers --no-heading)'{--no-headers,--no-heading}'[suppress headers]' '(--no-headers --no-heading)'{--no-headers,--no-heading}'[suppress headers]'

View file

@ -19,8 +19,8 @@ args=(
'(-D --use-dynamic)'{-D,--use-dynamic}'[use dynamic section info when showing symbols]' '(-D --use-dynamic)'{-D,--use-dynamic}'[use dynamic section info when showing symbols]'
\*{-x,--hex-dump=}"[dump contents of specified section as bytes]:section:($sections)" \*{-x,--hex-dump=}"[dump contents of specified section as bytes]:section:($sections)"
\*{-p,--string-dump=}"[dump contents of specified section as strings]:section:($sections)" \*{-p,--string-dump=}"[dump contents of specified section as strings]:section:($sections)"
'-w+[show the contents of DWARF2 debug sections]::debug section:(a A r c L f F g i o m p t R l s O u T U k K N)' '*-w+[show the contents of DWARF2 debug sections]::debug section:(a A r c f F g i k K N D E l L m o O p r R s t T u U)'
'--debug-dump=[show the contents of DWARF2 debug sections]::section:(abbrev addr aranges cu_index decodedline frames frames-interp gdb_index info loc macro pubnames pubtypes Ranges rawline str str-offsets trace_abbrev trace_aranges trace_info links follow-links no-follow-links)' '*--debug-dump=[show the contents of DWARF2 debug sections]::section:(abbrev addr cu_index frames frames-interp gdb_index info links follow-links no-follow-links use-debuginfod do-not-use-debuginfod rawline decodedline macro loc str-offsets pubnames aranges Ranges str pubtype trace_aranges trace_abbrev trace_info)'
'(-P --process-links)'{-P,--process-links}'[display the contents of non-debug sections in separate debuginfo files]' '(-P --process-links)'{-P,--process-links}'[display the contents of non-debug sections in separate debuginfo files]'
'(-I --histogram)'{-I,--histogram}'[show histogram of bucket list lengths]' '(-I --histogram)'{-I,--histogram}'[show histogram of bucket list lengths]'
'(-W --wide)'{-W,--wide}'[allow output width to exceed 80 characters]' '(-W --wide)'{-W,--wide}'[allow output width to exceed 80 characters]'
@ -59,8 +59,11 @@ case $variant in
'--no-recurse-limit[disable demangling recursion limit]' '--no-recurse-limit[disable demangling recursion limit]'
'-U+[specify how to display unicode characters]:method:(d l e x h i)' '-U+[specify how to display unicode characters]:method:(d l e x h i)'
'--unicode=[specify how to display unicode characters]:method:(default locale escape hex highlight invalid)' '--unicode=[specify how to display unicode characters]:method:(default locale escape hex highlight invalid)'
'(-X --extra-sym-info)'{-X,--extra-sym-info}'[display extra information when showing symbols]'
'!(-X --extra-sym-info)--no-extra-sym-info'
'(-L --lint --enable-checks)'{-L,--lint,--enable-checks}'[display warning messages for possible problems]' '(-L --lint --enable-checks)'{-L,--lint,--enable-checks}'[display warning messages for possible problems]'
\*{-R,--relocated-dump=}"[dump contents of specified section as relocated bytes]:section:($sections)" \*{-R,--relocated-dump=}"[dump contents of specified section as relocated bytes]:section:($sections)"
\*{-j,--display-section=}'[display contents of specified section]:section'
"--dwarf-depth=[don't show DIEs at greater than specified depth]:depth" "--dwarf-depth=[don't show DIEs at greater than specified depth]:depth"
'--dwarf-start=[show DIEs starting at specified depth or deeper]:depth' '--dwarf-start=[show DIEs starting at specified depth or deeper]:depth'
'--ctf=[display compact C type format info from section]:section' '--ctf=[display compact C type format info from section]:section'

View file

@ -41,6 +41,7 @@ if _pick_variant -r variant gnu=GNU elftoolchain=elftoolchain $OSTYPE --version;
'(-D --enable-deterministic-archives -U --disable-deterministic-archives)'{-U,--disable-deterministic-archives}'[disable -D behavior]' '(-D --enable-deterministic-archives -U --disable-deterministic-archives)'{-U,--disable-deterministic-archives}'[disable -D behavior]'
'(-D --enable-deterministic-archives -U --disable-deterministic-archives)'{-D,--enable-deterministic-archives}'[produce deterministic output when stripping archives (zero file metadata)]' '(-D --enable-deterministic-archives -U --disable-deterministic-archives)'{-D,--enable-deterministic-archives}'[produce deterministic output when stripping archives (zero file metadata)]'
'--remove-relocations=[remove relocations from specified section]:section' '--remove-relocations=[remove relocations from specified section]:section'
'--strip-section-headers[strip section headers from the output]'
'--strip-dwo[remove all DWARF .dwo sections]' '--strip-dwo[remove all DWARF .dwo sections]'
'!(--no-merge-notes)'{-M,--merge-notes} '!(--no-merge-notes)'{-M,--merge-notes}
"--no-merge-notes[don't attempt to remove redundant notes]" "--no-merge-notes[don't attempt to remove redundant notes]"

View file

@ -9,9 +9,10 @@ case $variant in
_arguments -s -S : \ _arguments -s -S : \
'(: -)'{-h,--help}'[display help information]' \ '(: -)'{-h,--help}'[display help information]' \
'(: -)'{-V,--version}'[display version information]' \ '(: -)'{-V,--version}'[display version information]' \
+ '(excl)' \ '(-c --container)'{-c,--container}'[show container uptime]' \
{-p,--pretty}'[display uptime in pretty format]' \ '(-p --pretty -s --since -r --raw)'{-p,--pretty}'[display uptime in pretty format]' \
{-s,--since}'[display date/time of system boot]' '(-r --raw -p --pretty)'{-r,--raw}'[uptime values in raw format]' \
'(-s --since -p --pretty)'{-s,--since}'[display date/time of system boot]'
return return
;; ;;
gnu) gnu)

View file

@ -6,6 +6,7 @@ case $OSTYPE in
linux*) linux*)
args=( args=(
'(H -f --from)'{-f,--from}'[toggle display of remote hostname]' '(H -f --from)'{-f,--from}'[toggle display of remote hostname]'
'(-c --container)'{-c,--container}'[show container uptime]'
'(H -h)--no-header[suppress the heading]' '(H -h)--no-header[suppress the heading]'
'(H -i --ip-addr)'{-i,--ip-addr}'[display IP address instead of hostname]' '(H -i --ip-addr)'{-i,--ip-addr}'[display IP address instead of hostname]'
'(H -o --old-style -s --short)'{-o,--old-style}'[old style output format]' '(H -o --old-style -s --short)'{-o,--old-style}'[old style output format]'