diff options
Diffstat (limited to 'Completion/Linux/Command')
26 files changed, 558 insertions, 273 deletions
diff --git a/Completion/Linux/Command/_alsa-utils b/Completion/Linux/Command/_alsa-utils new file mode 100644 index 000000000..91bb0b86c --- /dev/null +++ b/Completion/Linux/Command/_alsa-utils @@ -0,0 +1,54 @@ +#compdef aplay arecord +# Copyright (c) 2019 Sebastian Gniazdowski + +setopt localoptions warncreateglobal typesetsilent + +local -a opts +opts=( + '(- : *)'{-h,--help}'[print help message]' + '(- : *)'--version'[print current version]' + # -l/--list-devices doesn't benefit from -v/--verbose + '(- : *)'{-l,--list-devices}'[list all soundcards and digital audio devices]' + + '(-L --list-pcms)'{-L,--list-pcms}'[list device names]' + '(-D --device)'{-D+,--device=}'[select PCM by name]' + '(-q --quiet)'{-q,--quiet}'[quiet mode]' + '(-t --file-type)'{-t+,--file-type=}'[file type (voc, wav, raw or au)]' + '(-c --channels)'{-c+,--channels=}'[channels]' + '(-r --rate)'{-r+,--rate=}'[sample rate]' + '(-f --format)'{-f+,--format=}'[sample format (case insensitive)]' + '(-d --duration)'{-d+,--duration=}'[interrupt after # seconds]' + '(-s --samples)'{-s+,--samples=}'[interrupt after # samples per channel]' + '(-M --mmap)'{-M,--mmap}'[mmap stream]' + '(-N --nonblock)'{-N,--nonblock}'[nonblocking mode]' + '(-F --period-time)'{-F+,--period-time=}'[distance between interrupts is # microseconds]' + '(-B --buffer-time)'{-B+,--buffer-time=}'[buffer duration is # microseconds]' + --period-size='[distance between interrupts is # frames]' + --buffer-size='[buffer duration is # frames]' + '(-A --avail-min)'{-A+,--avail-min=}'[min available space for wakeup is # microseconds]' + '(-R --start-delay)'{-R+,--start-delay=}'[delay for automatic PCM start is # microseconds]' + '(-T --stop-delay)'{-T+,--stop-delay=}'[delay for automatic PCM stop is # microseconds from xrun]' + '*'{-v,--verbose}'[show PCM structure and setup (accumulative)]' + '(-V --vumeter)'{-V+,--vumeter=}'[enable VU meter (TYPE: mono or stereo)]' + '(-I --separate-channels)'{-I,--separate-channels}'[file for each channel]' + '(-i --interactive)'{-i,--interactive}'[allow interactive operation from stdin]' + '(-m --chmap)'{-m+,--chmap=}'[give the channel map to override or follow]' + --disable-resample'[disable automatic rate resample]' + --disable-channels'[disable automatic channel conversions]' + --disable-format'[disable automatic format conversions]' + --disable-softvol'[disable software volume control (softvol)]' + --test-position'[test ring buffer position]' + --test-coef='[test coefficient for ring buffer position (default 8)]' + --test-nowait'[do not wait for ring buffer - eats whole CPU]' + --max-file-time='[start another output file when the old file has recorded]' + --process-id-file='[write the process ID here]' + --use-strftime'[apply the strftime facility to the output file name]' + --dump-hw-params'[dump hw_params of the device]' + --fatal-errors'[treat all errors as fatal]' + + '*:sound file:_files' +) + +_arguments -s -S $opts + +# The return value passes through diff --git a/Completion/Linux/Command/_brctl b/Completion/Linux/Command/_brctl index 6e65d122c..4d053d5cb 100644 --- a/Completion/Linux/Command/_brctl +++ b/Completion/Linux/Command/_brctl @@ -13,7 +13,7 @@ if (( CURRENT == 2 )); then hairpin:toggle\ hairpin\ mode\ on\ a\ port showmacs:show\ a\ list\ of\ learned\ MAC\ addresses setageing:set\ MAC\ address\ ageing\ time - setgcint:set\ grabage\ collection\ interval + setgcint:set\ garbage\ collection\ interval stp:control\ use\ of\ spanning\ tree\ protocol showstp:show\ bridge\ stp\ info setbridgeprio:set\ bridge\ priority diff --git a/Completion/Linux/Command/_btrfs b/Completion/Linux/Command/_btrfs index 3ecebe62a..eb31580ad 100644 --- a/Completion/Linux/Command/_btrfs +++ b/Completion/Linux/Command/_btrfs @@ -109,16 +109,16 @@ while (( $#state )); do '(-u --uuid)'{-u,--uuid}'[uuid of the subvolume]' '1:subvolume path:_directories' ) - ;; + ;| subvolume:sync) args+=( '-s[sleep between checks]:delay (seconds) [1]' );; subvolume:find-new) args+=( '1:subvol:_files -/' '2:lastgen: _message "last gen"' );; - (device|filesystem|qgroup):(df|du|show|usage)) + (device|filesystem|qgroup|subvolume):(df|du|show|usage)) args+=( '--iec[use 1024 as a base]' '--si[use 1000 as a base]' ) ;| - (device|filesystem):(df|usage)) + (device|filesystem):(df|usage)|subvolume:show) args+=( '(-b --raw)'{-b,--raw}'[output raw numbers in bytes]' '(-h --human-readable -H)'{-h,--human-readable}'[output human friendly numbers, base 1024]' @@ -172,11 +172,17 @@ while (( $#state )); do ) [[ ${${(P)group}[cmd]} == add ]] && args+=( - {-K,--nodiscard}"[don't perform discard]" + {-K,--nodiscard}"[don't perform whole device TRIM]" {-f,--force}'[force overwrite of existing filesystem]' ) ;; - device:scan) args+=( '(1 -)'{-d,--all-devices}'[scan all devices in /dev]' '1:device:_files -g "*(-%)"' );; + device:scan) + args+=( + '(-)'{-u,--forget}'[unregister all stale devices or a given device]' + '(1 -)'{-d,--all-devices}'[enumerate and register all devices]' + '1:device:_files -g "*(-%)"' + ) + ;; device:stats) args+=( '(-c --check)'{-c,--check}'[return non-zero if any stat counter is not zero]' @@ -214,7 +220,7 @@ while (( $#state )); do '(-d -s)-m+[act on metadata chunks]:filter:->filters' '(-d -m)-s+[act on system chunks (only under -f)]:filters:->filters' '-v[verbose mode]' - '-f[force reducing of metadata integrity]' + '-f[force a reduction of metadata integrity]' "--full-balance[don't print warning and don't delay start]" '(--background --bg)'{--background,--bg}'[run balance operation asynchronously in the background]' '1:path:_files -/' @@ -227,7 +233,7 @@ while (( $#state )); do property:list) args+=( '-t[specify object type]:object type:(subvol filesystem inode device)' - '1:object' + '1: : _guard "^-*" object' ) ;; quota:(enable|disable)) args+=( '1:path:_files -/' );; @@ -241,7 +247,7 @@ while (( $#state )); do qgroup:(assign|remove)) args+=( '1:source path:_files -/' '2:destination path:_files -/' '3:path:_files -/' );| qgroup:assign) args+=( \!--rescan - "--no-rescan[don't do a rescan, even if the assignment will make the quotas inconsitent]" ) + "--no-rescan[don't do a rescan, even if the assignment will make the quotas inconsistent]" ) ;; qgroup:(create|destroy)) args+=( '1:qgroupid:' '2:path:_files -/' );; qgroup:show) @@ -286,9 +292,10 @@ while (( $#state )); do '(-r --roots)'{-r,--roots}'[print only short root node info]' '(-R --backups)'{-R,--backups}'[same as --roots plus print backup root info]' '(-u --uuid)'{-u,--uuid}'[print only the uuid tree]' - '(-b --block)'{-b,--block}'[print info from the specified block only]:block' + \*{-b,--block}'[print info from the specified block only]:block number' '(-t --tree)'{-t,--tree}'[print only tree with the given id (string or number)]:tree id' '--follow[use with -b, to show all children tree blocks of the block]' + "--noscan[don't scan devices from the filesystem, use only the listed ones]" ) ;; inspect*:dump-super) @@ -337,7 +344,7 @@ while (( $#state )); do '--init-csum-tree[create a new CRC tree]' '--init-extent-tree[create a new extent tree]' '--clear-space-cache[clear space cache for v1 or v2]:version:(v1 v2)' - '--check-data-csum[verify checkums of data blocks]' + '--check-data-csum[verify checksums of data blocks]' '(-Q --qgroup-report)'{-Q,--qgroup-report}'[verify qgroup accounting and compare against filesystem accounting]' '(-E --subvol-extents)'{-E,--subvol-extents}'[show extent state for the given subvolume]:subvolume id' '(-p --progress)'{-p,--progress}'[indicate progress at various checking phases]' @@ -366,6 +373,9 @@ while (( $#state )); do '2:path:_files -/' ) ;; + send|receive) + args+=( '(-q --quiet)'{-q,--quiet}'[suppress all messages except errors]' ) + ;| send) args+=( '*-v[verbose mode]' @@ -375,7 +385,6 @@ while (( $#state )); do '-f[specify output file]:file:_files' '--no-data[send in NO_FILE_DATA mode]' '(-v --verbose)'{-v,--verbose}'[enable verbose output]' - '(-q --quiet)'{-q,--quiet}'[suppress all messages except errors]' '1:subvolume:_files -/' ) ;; @@ -391,7 +400,11 @@ while (( $#state )); do '1:mount:->mounts' ) ;; - h(|e(|l(|p)))) args+=( '--full[display detailed help]' );; + h(|e(|l(|p)))) args+=( + '--full[display detailed help on every command]' + '--box[show list of built-in tools (busybox style)]' + ) + ;; *) args+=( '*: :_default' );; # fallback for unknown subcommands esac if ! (( shift )); then diff --git a/Completion/Linux/Command/_chcon b/Completion/Linux/Command/_chcon new file mode 100644 index 000000000..2d523f287 --- /dev/null +++ b/Completion/Linux/Command/_chcon @@ -0,0 +1,24 @@ +#compdef chcon + +local ign + +(( $#words > 2 )) && ign='!' +_arguments -C -s -S \ + '(-h --no-dereference)--dereference[dereference symlinks]' \ + '(-h --no-dereference --dereference)'{-h,--no-dereference}'[operate on symlinks themselves]' \ + '(1 -u --user -r --role -l --range -t --type)--reference=[copy security context of specified file]:file:_files' \ + '(1 --reference -u --user)'{-u+,--user=}'[set user in the target security context]: :_selinux_users' \ + '(1 --reference -r --role)'{-r+,--role=}'[set role in the target security context]: :_selinux_roles' \ + '(1 --reference -t --type)'{-t+,--type=}'[set type in the target security context]: :_selinux_types' \ + '(1 --reference -l --range)'{-l+,--range=}'[set range in the target security context]:selinux range' \ + '(--recursive -R)'{--recursive,-R}'[recurse subdirectories]' \ + '(-v --verbose)'{-v,--verbose}'[output a diagnostic for every file processed]' \ + '(-H -L -P)-H[follow symlinks on the command line]' \ + '(-H -L -P)-L[follow all symlinks]' \ + "(-H -L -P)-P[don't follow symlinks (default)]" \ + '!(--preserve-root)--no-preserve-root' \ + "--preserve-root[fail to operate recursively on '/']" \ + '(--reference -u --user -r --role -l --range -t --type)1:security context:_selinux_contexts' \ + "${ign}--help[display help information]" \ + "${ign}--version[display version information]" \ + '*:file:_files' diff --git a/Completion/Linux/Command/_cpupower b/Completion/Linux/Command/_cpupower index 6713323cb..ae1f1d3d1 100644 --- a/Completion/Linux/Command/_cpupower +++ b/Completion/Linux/Command/_cpupower @@ -44,7 +44,7 @@ case $state in {-l,--hwlimits}'[show min/max frequency allowed]' {-d,--driver}'[show the kernel driver in use]' {-p,--policy}'[show the current cpufreq policy]' - {-g,--governors}'[show available governers]' + {-g,--governors}'[show available governors]' {-r,--related-cpus}'[show cpus that run at the same frequency]' {-a,--affected-cpus}'[show software controlled cpus]' {-s,--stats}'[show cpufreq statistics]' diff --git a/Completion/Linux/Command/_cryptsetup b/Completion/Linux/Command/_cryptsetup index ddb2ad3a9..45159d0be 100644 --- a/Completion/Linux/Command/_cryptsetup +++ b/Completion/Linux/Command/_cryptsetup @@ -6,7 +6,8 @@ local -a actions state line expl (( $#words > 2 )) && ign='!' _arguments -s \ '(-v --verbose)'{-v,--verbose}'[enable verbose mode]' \ - '--debug[enable debug mode]' \ + '--debug[show debug messages]' \ + '--debug-json[show debug messages including JSON metadata]' \ '(-c --cipher)'{-c+,--cipher=}'[set cipher]:cipher specification' \ '(-h --hash)'{-h+,--hash=}'[hash algorithm]:hash algorithm' \ '(-y --verify-passphrase)'{-y,--verify-passphrase}'[query for password twice]' \ @@ -48,6 +49,7 @@ _arguments -s \ '--perf-same_cpu_crypt[use dm-crypt same_cpu_crypt performance compatibility option]' \ '--perf-submit_from_crypt_cpus[use dm-crypt submit_from_crypt_cpus performance compatibility option]' \ '--deferred[device removal is deferred until the last user closes it]' \ + '--serialize-memory-hard-pbkdf[use global lock to serialize memory]' \ '--pbkdf=[specify PBKDF algorithm for LUKS2]:algorithm:(argon2i argon2id pbkdf2)' \ '--pbkdf-memory=[specify PBKDF memory cost limit]:limit (kilobytes)' \ '--pbkdf-parallel=[specify PBKDF parallel cost]:threads' \ @@ -67,6 +69,19 @@ _arguments -s \ '--subsystem=[set subsystem label for the LUKS2 device]:subsystem' \ '--unbound[create unbound (no assigned data segment) LUKS2 keyslot]' \ '--json-file=[read or write token to json file]:json file:_files -g "*.json(-.)"' \ + '--luks2-metadata-size=[specify LUKS2 header metadata area size]:size (bytes)' \ + '--luks2-keyslots-size=[specify LUKS2 header keyslots area size]:size (bytes)' \ + '--refresh[refresh (reactivate) device with new parameters]' \ + '--keyslot-key-size=[specify size of the encryption key]:size (bits)' \ + '--keyslot-cipher=[specify cipher used for LUKS2 keyslot encryption]:cipher' \ + '--encrypt[Encrypt LUKS2 device (in-place encryption)]' \ + '--decrypt[decrypt LUKS2 device (remove encryption)]' \ + '--init-only[initialize LUKS2 reencryption in metadata only]' \ + '--reduce-device-size=[reduce data device size (move data offset)]:size (bytes)' \ + '--hotzone-size=[specify maximal reencryption hotzone size]:size (bytes)' \ + '--resilience=[specify reencryption hotzone resilience type]:resilience type:(checksum journal none)' \ + '--resilience-hash=[specify reencryption hotzone checksums hash]:string' \ + '--active-name=[override device autodetection of dm device to be reencrypted]:string' \ "${ign}(- : *)--version[show version information]" \ "${ign}(- : *)"{-\?,--help}'[display help information]' \ "${ign}(- : *)--usage[display brief usage]" \ @@ -82,6 +97,7 @@ case $state in 'resize:resize an active mapping' 'benchmark:benchmark cipher' 'repair:try to repair on-disk metadata' + 'reencrypt:reencrypt LUKS2 device' 'erase:erase all keyslots' 'convert:convert LUKS from/to LUKS2 format' 'config:set permanent configuration options for LUKS2' @@ -114,7 +130,7 @@ case $state in benchmark) args=( '--cipher=:cipher' );; luksKillSlot) args=( $device ':key slot number' );; remove|status|resize|*lose|luksSuspend|luksResume) args=( $mapping );; - erase|convert|config|repair|(luks(AddKey|Erase|RemoveKey|DelKey|UUID|Dump)|isLuks)) + erase|convert|config|repair|reencrypt|(luks(AddKey|Erase|RemoveKey|DelKey|UUID|Dump)|isLuks)) args=( $device ) ;; luks(Format|AddKey|RemoveKey|ChangeKey|ConvertKey)) diff --git a/Completion/Linux/Command/_ethtool b/Completion/Linux/Command/_ethtool index 33b7681dc..dccda4684 100644 --- a/Completion/Linux/Command/_ethtool +++ b/Completion/Linux/Command/_ethtool @@ -48,7 +48,8 @@ _arguments -C \ '--get-phy-tunable[get PHY tunable]' \ '--reset[reset hardware components]' \ '--show-fec[query device for forward error correction support]' \ - '--set-fec[configure forward error correction for device]' && return + '--set-fec[configure forward error correction for device]' \ + {-Q,--per-queue}'[apply per-queue command]' && return if [[ -n $state ]]; then case $words[CURRENT-1] in @@ -61,7 +62,7 @@ if [[ -n $state ]]; then _wanted onoff expl 'enabled' compadd off on fi ;; - autoneg|adaptive-[rt]x|raw|hex|sg|tso|ufo|gso|lro|eee|tx-lpi|downshift) + autoneg|adaptive-[rt]x|raw|hex|sg|tso|ufo|gso|lro|eee|tx-lpi|downshift|fast-link-down) _wanted onoff expl 'enabled' compadd off on ;; rx-usecs|rx-frames|rx-usecs-irq|rx-frames-irq|tx-usecs|tx-frames) ;& @@ -70,7 +71,7 @@ if [[ -n $state ]]; then rx-frames-high|tx-usecs-high|tx-frames-high|sample-interval|dmac|rx-mini) ;& rx-jumbo|offset|length|magic|value|phyad|proto|tos|tclass|l4proto|src-port) ;& dst-port|spi|l4data|vlan-etype|vlan|user-def|action|vf|queue|loc) ;& - other|combined|tx-timer|count) + other|combined|tx-timer|count|msecs) _message -e numbers 'number' ;; speed) @@ -279,10 +280,10 @@ if [[ -n $state ]]; then _wanted behaviours expl behaviour compadd -F line - eee advertise tx-lpi tx-timer ;; --set-phy-tunable) - _wanted options expl tunable compadd -F line - downshift count + _wanted options expl tunable compadd -F line - downshift count fast-link-down msecs ;; --get-phy-tunable) - _wanted options expl tunable compadd downshift + _wanted options expl tunable compadd downshift fast-link-down ;; --reset) _wanted components expl component compadd flags dedicated all \ @@ -295,6 +296,13 @@ if [[ -n $state ]]; then _wanted encodings expl encoding compadd -F line auto off rs baser fi ;; + -Q|--pre-queue) + if (( CURRENT == 4 )); then + _wanted options expl option compadd - queue_mask + elif (( CURRENT == 6)); then + _wanted options expl option compadd -c --show-coalescing -C --coalesce + fi + ;; esac ;; esac diff --git a/Completion/Linux/Command/_findmnt b/Completion/Linux/Command/_findmnt new file mode 100644 index 000000000..9f13e695f --- /dev/null +++ b/Completion/Linux/Command/_findmnt @@ -0,0 +1,114 @@ +#compdef findmnt +# +# Note for customization: +# Options -N -k -m -s are in a group 'S' and need be specified as +# 'S-option-N' etc. in the context for zstyle. For example, if you want +# all PIDs to be completed for 'findmnt -N<TAB>', then +# zstyle ':completion:*:findmnt:S-option-N-1:processes' command 'ps -A' +# +local curcontext=$curcontext state state_descr line ret=1 +typeset -A opt_args + +_arguments -s -C \ + '(H -A --all)'{-A,--all}'[print all filesystems]' \ + '(H -a --ascii)'{-a,--ascii}'[use ascii characters for tree formatting]' \ + '(H -b --bytes)'{-b,--bytes}'[print SIZE etc. in bytes]' \ + '(H -c --nocanonicalize)'{-c,--nocanonicalize}'[do not canonicalize path]' \ + '(H -d --direction)'{-d+,--direction=}'[specify the search direction]:direction:(forward backward)' \ + '(H -e --evaluate)'{-e,--evaluate}'[convert LABEL/UUID/PARTLABEL/PARTUUID to the device name]' \ + '(H -F --tab-file)*'{-F+,--tab-file=}'[search in the specified tab file]:tab file:_files' \ + '(H -f --first-only)'{-f,--first-only}'[print the first matching filesystem only]' \ + '(H -i --invert)'{-i,--invert}'[invert the sense of matching]' \ + '(H -M --mountpoint :)'{-M+,--mountpoint=}'[specify the mountpoint]: :->targets' \ + '(H -n --noheadings)'{-n,--noheadings}'[do not print a header line]' \ + '(H -O --options)'{-O+,--options=}'[only print the filesystems with the specified options]:list of options: ' \ + '(H -o --output)'{-o+,--output=}'[specify output columns]: :->columns' \ + '(H -p --poll)'{-p+,--poll=}'[monitor changes in /proc/self/mountinfo]::action:(mount umount remount move)' \ + '(H -R --submounts)'{-R,--submounts}'[print recursively all submounts]' \ + '(H -S --source :)'{-S+,--source=}'[specify the mount source]: :->sources' \ + '(H -T --target :)'{-T+,--target=}'[specify the mount target]:target:_files' \ + '(H -t --types)'{-t+,--types=}'[specify the type of filesystems]:filesystem types:_sequence -s , _file_systems' \ + '--tree[use tree-like output if possible]' \ + '(H -U --uniq)'{-U,--uniq}'[ignore filesystems with duplicated mount targets]' \ + '(H -u --notruncate)'{-u,--notruncate}'[do not truncate text in columns]' \ + '(H -v --nofsroot)'{-v,--nofsroot}'[do not print \[/dir\] in the SOURCE column]' \ + '(H -w --timeout)'{-w+,--timeout}'[specify timeout for --poll]:milliseconds: ' \ + '(H -x --verify)'{-x,--verify}'[check mount table content]' \ + '(H)--verbose[print more information]' \ + '(H)1: :->sources_targets' \ + '(H)2:: :->targets' \ + + '(format)' \ + '(H)'{-D,--df}'[imitate the output of df command]' \ + '(H)'{-J,--json}'[use JASON output format]' \ + '(H)'{-l,--list}'[use list output format]' \ + '(H)'{-P,--pairs}'[use key="value" output format]' \ + '(H)'{-r,--raw}'[use raw output format]' \ + + '(S)' \ + '(H)'{-k,--kernel}'[search in /proc/self/mountinfo (default)]' \ + '(H)'{-m,--mtab}'[search in /etc/mtab]' \ + '(H)'{-N+,--task=}'[search /proc/<pid>/mountinfo]: :_pids' \ + '(H)'{-s,--fstab}'[search in /etc/fstab]' \ + + '(H)' \ + '(- :)'{-h,--help}'[display help text and exit]' \ + '(- :)'{-V,--version}'[display version and exit]' \ + && ret=0 + +__findmnt_mountpoints () { + compadd "$@" \ + ${(f)"$(_call_program mount-points findmnt $opts -oTARGET)"} +} + +case $state in + columns) + compset -P '+' || _describe -t list-prefixes prefix \ + '( +:"not replace but extend the list" )' -S '' && ret=0 + local -a columns=( + ${${${(f)"$(_call_program columns findmnt -h)"}[(r)Available*,-2]}[2,-1]} + ) + columns=( ${${${${${${columns## #}//:/\\:}//\[/\\[}//]/\\]}/ /[}/%/]} ) + _values -s , -M 'm:{a-z}={A-Z}' column $columns && ret=0 + ;; + *) # call "findmnt $opts" to get possible sources/targets + local opts='-lnve' + if [[ -n $opt_args[(I)S-(-m|--mtab)] ]]; then + opts+=' -m' + elif [[ -n $opt_args[(I)S-(-s|--fstab)] ]]; then + opts+=' -s' + elif [[ -n $opt_args[(I)S-(-N|--task)] ]]; then + opts+=" -N${(v)opt_args[(I)S-(-N|--task)]}" + fi + ;| + sources*) # 'sources' or 'sources_targets' + local -a val + if compset -P 'LABEL='; then + val=( ${(f)"$(_call_program labels findmnt $opts -oLABEL)"} ) + _describe -t labels 'LABEL' val && ret=0 + elif compset -P 'PARTLABEL='; then + val=( ${(f)"$(_call_program labels findmnt $opts -oPARTLABEL)"} ) + _describe -t labels 'PARTLABEL' val && ret=0 + elif compset -P 'UUID='; then + val=( ${(f)"$(_call_program uuids findmnt $opts -oUUID)"} ) + _describe -t uuids 'UUID' val && ret=0 + elif compset -P 'PARTUUID='; then + val=( ${(f)"$(_call_program uuids findmnt $opts -oPARTUUID)"} ) + _describe -t uuids 'PARTUUID' val && ret=0 + else + local -a alts=( + 'devices:device:compadd \ + $(_call_program devices findmnt $opts -oSOURCE)' + 'device-numbers:major-minor:compadd \ + ${$(_call_program device-numbers findmnt $opts -oMAJ:MIN)// /}' + 'prefixes:prefix:compadd -S "" LABEL= UUID= PARTLABEL= PARTUUID=' + ) + [[ $state = sources_targets ]] && + alts+=( 'mount-points:moutpoint:__findmnt_mountpoints' ) + _alternative $alts && ret=0 + fi + ;; + targets) + local expl + _wanted mount-points expl 'mountpoint' __findmnt_mountpoints && ret=0 + ;; +esac + +return ret diff --git a/Completion/Linux/Command/_free b/Completion/Linux/Command/_free new file mode 100644 index 000000000..cc5bcf3bd --- /dev/null +++ b/Completion/Linux/Command/_free @@ -0,0 +1,25 @@ +#compdef free +# based on procps-ng-3.3.15 + +_arguments -s \ + '(-l --lohi)'{-l,--lohi}'[show detailed low and high memory statistics]' \ + '(-t --total)'{-t,--total}'[show total for RAM + swap]' \ + '(-w --wide)'{-w,--wide}'[wide mode]' \ + '(-s --seconds)'{-s,--seconds}'[specify the delay between display]:seconds: ' \ + '(-c --count)'{-c+,--count=}'[specify the display count]:count: ' \ + '--si[use power of 1000 instead of power of 1024]' \ + '(-)--help[print help and exit]' \ + '(-)'{-V,--version}'[print version information and exit]' \ + + '(unit)' \ + {-b,--bytes}'[display the amount of memory in bytes]' \ + {-k,--kibi}'[display the amount of memory in kibibytes (default)]' \ + {-m,--mebi}'[display the amount of memory in mebibytes]' \ + {-g,--gibi}'[display the amount of memory in gibibytes]' \ + '--tebi[display the amount of memory in tebibytes]' \ + '--pebi[display the amount of memory in pebibytes]' \ + '(--si)--kilo[display the amount of memory in kilobytes]' \ + '(--si)--mega[display the amount of memory in megabytes]' \ + '(--si)--giga[display the amount of memory in gigabytes]' \ + '(--si)--tera[display the amount of memory in terabytes]' \ + '(--si)--peta[display the amount of memory in petabytes]' \ + {-h,--human}'[automatically select unit]' diff --git a/Completion/Linux/Command/_iptables b/Completion/Linux/Command/_iptables index ae8d66ea4..27c801da1 100644 --- a/Completion/Linux/Command/_iptables +++ b/Completion/Linux/Command/_iptables @@ -47,7 +47,7 @@ case ${prev[${prev[(I)-p|--protocol]}+1]}; in esac case ${prev[${prev[(I)-j|--jump]}+1]}; in - DNAT) args+=( '(--to --to-destination)'{--to,--to-destination}':address:_users-ports' ) ;; + DNAT) args+=( '(--to --to-destination)'{--to,--to-destination}':address' ) ;; DSCP) args+=( '--set-dscp[set the DSCP field]:value' @@ -67,7 +67,7 @@ case ${prev[${prev[(I)-j|--jump]}+1]}; in MARK) args+=( '--set-mark[set fwmark in packet]:number' ) ;; REDIRECT|MASQUERADE) args+=( '--to-ports[port (range) to map to]:port range:_ports' ) ;; REJECT) args+=( '--reject-with[drop packet and send reply]:reject type:->reject-types' ) ;; - SNAT) args+=( '(--to --to-source)*'{--to,--to-source}'[specify address to map source to]:address:_users-ports' ) ;; + SNAT) args+=( '(--to --to-source)*'{--to,--to-source}'[specify address to map source to]:address' ) ;; TCPMSS) args+=( '--set-mss[explicitly set MSS option]:value' @@ -102,7 +102,7 @@ while '--ctreplsrc[match reply source address]:*^!:network:_hosts' '--ctrepldst[match reply destination address]:*^!:network:_hosts' '--ctstatus[match internal conntrack states]:state:(NONE EXPECTED SEEN_REPLY ASSURED)' - '--ctexpire[match remaing lifetime]:time' + '--ctexpire[match remaining lifetime]:time' ) ;; dscp) diff --git a/Completion/Linux/Command/_kpartx b/Completion/Linux/Command/_kpartx index 8f09c416d..79a8dd8a7 100644 --- a/Completion/Linux/Command/_kpartx +++ b/Completion/Linux/Command/_kpartx @@ -1,11 +1,11 @@ #compdef kpartx _arguments -s -S : \ - '-a[add partition mappings]' \ + '(-d -u -l)-a[add partition mappings]' \ '-r[read-only partition mappings]' \ - '-d[delete partition mappings]' \ - '-u[update partition mappings]' \ - '-l[list partition mappings]' \ + '(-a -u -l)-d[delete partition mappings]' \ + '(-a -d -l)-u[update partition mappings]' \ + '(-a -d -u)-l[list partition mappings]' \ '-p[set device name-partition number delimiter]' \ '-f[force creation of mappings]' \ '-g[force GUID partition table]' \ diff --git a/Completion/Linux/Command/_losetup b/Completion/Linux/Command/_losetup index d826e8d51..54debe19e 100644 --- a/Completion/Linux/Command/_losetup +++ b/Completion/Linux/Command/_losetup @@ -1,4 +1,4 @@ -#lcompdef losetup -value-,LOOPDEV_DEBUG,-default- +#compdef losetup -value-,LOOPDEV_DEBUG,-default- if [[ $service = *LOOPDEV_DEBUG* ]]; then local expl diff --git a/Completion/Linux/Command/_lsblk b/Completion/Linux/Command/_lsblk index 1a3687c45..8a9bc18bf 100644 --- a/Completion/Linux/Command/_lsblk +++ b/Completion/Linux/Command/_lsblk @@ -1,11 +1,12 @@ #compdef lsblk local sep ret=1 -local -a values dedup suf=( -qS , ) +local -a values dedup suf local curcontext="$curcontext" state line expl typeset -A opt_args _arguments -C -s -S \ + '(H -E --dedup)'{-E+,--dedup=}'[de-duplicate output by specified column]:column:->columns' \ '(H -a --all)'{-a,--all}'[print all devices]' \ '(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]" \ @@ -30,7 +31,7 @@ _arguments -C -s -S \ '(H)'{-i,--ascii}'[output ascii characters only]' \ '(H)'{-J,--json}'[use JSON output format]' \ '(H)'{-l,--list}'[use list format output]' \ - '(H)'{-t,--tree}'[use tree format output]' \ + '(H)'{-T+,--tree=}'[use tree format output]:column:->columns' \ '(H)'{-P,--pairs}'[use key="value" output format]' \ '(H)'{-r,--raw}'[use raw output format]' \ + 'H' \ @@ -38,14 +39,19 @@ _arguments -C -s -S \ '(* -)'{-V,--version}'[display version information]' && ret=0 case $state in + columnlist) + compset -P '+' || _describe -t list-prefixes prefix \ + '( +:"not replace but extend the list" )' -S '' && ret=0 + ;| *list) dedup=( ${(Ms.,.)PREFIX##*,} ${(Ms.,.)SUFFIX%%,*} ) + suf=( -qS , ) compset -S ',*' && suf=() compset -P '*,' ;| column*) values=( - ${${${${(f)"$(_call_program columns lsblk -h)"}[(r)Available*,-3]## #}[2,-1]//:/\\:}/ /:} + ${${${${(f)"$(_call_program columns lsblk -h)"}[(r)Available*,-2]## #}[2,-1]//:/\\:}/ /:} ) _describe -t fields column values -M 'm:{a-z}={A-Z}' $suf -F dedup && ret=0 ;; diff --git a/Completion/Linux/Command/_ltrace b/Completion/Linux/Command/_ltrace index e48d8ec98..b60f8c355 100644 --- a/Completion/Linux/Command/_ltrace +++ b/Completion/Linux/Command/_ltrace @@ -5,7 +5,7 @@ local root hlp="-h --help -V --version" (( EUID )) && root='!' _arguments -s -S $args \ - "(-c -a --align $hlp)"{-a+,--align=}"[align return values in a secific column]:column [$((COLUMNS*5/8))]" \ + "(-c -a --align $hlp)"{-a+,--align=}"[align return values in a specific column]:column [$((COLUMNS*5/8))]" \ "(-c $hlp)-A+[specify maximum number of array elements to print]:elements" \ "(-c -b --no-signals $hlp)"{-b,--no-signals}"[don't print signals]" \ "(-a --align -A -b --no-signals -i -n --indent -r -s -t -tt -ttt -T $hlp)-c[count time and calls, and report a summary on exit]" \ diff --git a/Completion/Linux/Command/_modutils b/Completion/Linux/Command/_modutils index 9a37fcae1..ff6844f41 100644 --- a/Completion/Linux/Command/_modutils +++ b/Completion/Linux/Command/_modutils @@ -10,138 +10,146 @@ _modules_caching_policy() } _modutils() { - local curcontext="$curcontext" expl state line modules ign args ret=1 - local -r modules_dir=/lib/modules - - local update_policy - zstyle -s ":completion:*:*:$service:*" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:*:*:$service:*" cache-policy _modules_caching_policy - fi - - args=( - '(-)'{-V,--version}'[print version]' - '(-)'{-h,--help}'[print help text]' - ) - - case "$service" in - lsmod) _arguments -s "$args[@]" && return ;; - - modinfo) - _arguments -s -C "$args[@]" \ - '(-)'{-a,--author}"[display the module's author]" \ - '(-)'{-d,--description}"[display the module's description]" \ - '(-)'{-l,--license}"[display the module's license]" \ - '(-)'{-n,--filename}"[display the module's filename]" \ - '(-)'{-p,--parameters}'[display the typed parameters that a module may support]' \ - '(-)'{-F,--field}"[display only selected module's information]:module_field:(alias author depends description filename license parm)" \ - '(-)-k[use modules from a different kernel version]:kernel_version:($(echo $modules_dir/*(/\:t)))' \ - '1:module file:->all_modules' && ret=0 - ;; - - modprobe) - ign='-h --help -V --version -c --showconfig' - _arguments -s -C "$args[@]" \ - "(-a --all $ign)"{-a,--all}'[load all matching modules]' \ - '(-)'{-c,--showconfig}'[show current configuration]' \ - "(-d --debug $ign)"{-d,--debug}'[print debug info]' \ - "(-k --autoclean $ign)"{-k,--autoclean}'[set autoclean]' \ - "(-n --show $ign)"{-n,--show}"[don't actually perform action]" \ - "(-q --quiet $ign)"{-q,--quiet}"[don't complain about insmod failures]" \ - "(-s --syslog $ign)"{-s,--syslog}'[report via syslog instead of stderr]' \ - "(* -t --type $ign)"{-t,--type}'[module type]:module type' \ - "(-v --verbose $ign)"{-v,--verbose}'[print all commands as executed]' \ - '(-C --config)'{-C,--config}'[specify config file]:config file:_files' \ - "(-r --remove -l --list -t --type -a --all $ign)"{-r,--remove}'[remove module (stacks)]' \ - "(-l --list -t --type -a --all $ign)"{'-i[ignore install/remove commands in config file]','--ignore-install[ignore install commands in config file]','--ignore-remove[ignore remove commands in config file]'} \ - "(* -l --list -r --remove $ign)"{-l,--list}'[list matching modules]' \ - "(-c $ign)1:modules:->loadable_modules" \ - "(-c -l --list -t --type $ign)*:params:->params" && ret=0 - - [[ -n $state ]] && (( $+opt_args[-r] )) && state=loaded_modules - ;; - - rmmod) - _arguments -s -C "$args[@]" \ - '(-a --all)'{-a,--all}'[remove all unused autocleanable modules]' \ - '(-e --persist)'{-e,--persist}'[save persistent data]' \ - '(-r --stacks)'{-r,--stacks}'[remove a module stack]' \ - '(-s --syslog)'{-s,--syslog}'[output to syslog]' \ - '(-v --verbose)'{-v,--verbose}'[be verbose]' \ - '*:loaded module:->loaded_modules' && ret=0 - ;; - - insmod) - _arguments \ - '1:module file:_files' \ - '*:module parameters:' && ret=0 - ;; - esac - - case "$state" in - loaded_modules|loadable_modules) - if [[ -r /proc/modules ]]; then - loaded_modules=(${${(f)"$(</proc/modules)"}%% *}) - elif [[ -x /sbin/lsmod ]]; then - loaded_modules=(${${(f)"$(/sbin/lsmod)"}[2,-1]%% *}) - else - return 1 - fi - - if [[ $state = loaded_modules ]]; then - _wanted modules expl 'loaded module' compadd -a loaded_modules \ - && return - return ret - fi - ;& - - all_modules) - local kver - integer kver_idx - if (( kver_idx=${words[(I)-k]} )); then - kver=${words[kver_idx+1]} - else - kver=$(uname -r) - fi - - if _cache_invalid modules-$kver || ! _retrieve_cache modules-$kver; - then - # 2011-01-02 gi1242: Do we need .o files? Or is .ko enough? - modules=( $modules_dir/$kver/(*~(source|build))/**/*.(o|ko|ko.gz|ko.xz)(.:t:r:r) ) - _store_cache modules-$kver modules - fi - - if [[ $state = loadable_modules ]]; then - modules=( ${modules:#(${(j:|:)~${=loaded_modules//_/-}})} ) - fi - - _tags files modules - while _tags; do - _requested files expl "module file" _files -g '*.ko(-.)' && ret=0 - _requested modules expl module compadd -a modules && ret=0 - (( ret )) || break - done - ;; - - params) - if compset -P 1 '*='; then - _message -e value 'parameter value' - else - local params - params=( ${${(M)${(f)"$(_call_program module_parameter /sbin/modinfo "$words[2]" 2>/dev/null)"}:#parm:*}##parm:[[:space:]]##} ) - if [[ $#params -eq 0 ]]; then - _message -e parameter "This modules doesn't have parameters" - else - typeset -A val_args - - _values -S = -C -w 'module parameter' \ - ${${${(M)params:#*(:bool|\(bool\))}/:/[}/(bool| \(bool\))/]} ${^${params:#*(:bool|\(bool\))}/:/[}"]:auto added argument: " && ret=0 - fi - fi - ;; - esac - - return ret + local curcontext="$curcontext" expl state line modules modaliases ign args ret=1 + local -A opt_args + local -r modules_dir=/lib/modules + + local update_policy + zstyle -s ":completion:*:*:$service:*" cache-policy update_policy + if [[ -z "$update_policy" ]]; then + zstyle ":completion:*:*:$service:*" cache-policy _modules_caching_policy + fi + + args=( + '(-)'{-V,--version}'[display version information]' + '(-)'{-h,--help}'[display usage information]' + ) + + case "$service" in + lsmod) _arguments -s "$args[@]" && return ;; + + modinfo) + _arguments -s -C "$args[@]" \ + '(-)'{-k+,--set-version=}'[use modules from a different kernel version]:kernel_version:($(echo $modules_dir/*(/\:t)))' \ + {-b+,--basedir=}'[use specified directory as filesystem root]:path:_directories' \ + '1:module file:->all-modules' \ + + '(field)' \ + {-a,--author}"[display the module's author]" \ + {-d,--description}"[display the module's description]" \ + {-l,--license}"[display the module's license]" \ + {-n,--filename}"[display the module's filename]" \ + {-p,--parameters}'[display the typed parameters that a module may support]' \ + {-F+,--field}"[display only selected module's information]:module_field:(alias author depends description filename intree license name parm sig_hashalgo sig_key signat signer srcversion vermagic)" \ + {-0,--null}'[use a null instead of newline in output]' && ret=0 + ;; + + modprobe) + ign='-h --help -V --version -c --showconfig --show-config' + _arguments -s -C "$args[@]" \ + "(-a --all $ign)"{-a,--all}'[load all matching modules]' \ + "(-n --show $ign)"{-n,--show}"[don't actually perform action]" \ + "(-q --quiet $ign)"{-q,--quiet}"[don't complain about insmod failures]" \ + "(-s --syslog $ign)"{-s,--syslog}'[report via syslog instead of stderr]' \ + "(-v --verbose $ign)"{-v,--verbose}'[print all commands as executed]' \ + '(-C --config)'{-C+,--config=}'[specify config file]:config file:_files' \ + "(-r --remove -a --all $ign)"{-r,--remove}'[remove module (stacks)]' \ + '--remove-dependencies[also remove modules depending on it]' \ + '(* -R --resolve-alias)'{-R,--resolve-alias}'[only lookup and print alias and exit]' \ + '--first-time[fail if module already inserted or removed]' \ + "(-a --all $ign)"{'-i[ignore install/remove commands in config file]','--ignore-install[ignore install commands in config file]','--ignore-remove[ignore remove commands in config file]'} \ + '(-b --use-blacklist)'{-b,--use-blacklist}'[apply blacklist to resolved alias]' \ + '(-f --force --force-modversions --force-vermagic)'{-f,--force}'[force module insertion or removal]' \ + "(-f --force)--force-modversion[ignore module's version]" \ + "(-f --force)--force-vermagic[ignore module's version magic]" \ + '(-D --show-depends)'{-D,--show-depends}'[only print module dependencies and exit]' \ + '(-)'{-c,--showconfig,--show-config}'[show current configuration]' \ + --{show,dump}'-modversions[dump module symbol version and exit]' \ + {-d+,--dirname=}'[use specified directory as filesystem root]:path:_directories' \ + {-S+,--set-version=}'[use modules from a different kernel version]:kernel_version:($(echo $modules_dir/*(/\:t)))' \ + '--show-exports[only print module exported symbol versions and exit]' \ + '(-n --dry-run --show)'{-n,--dry-run,--show}"[don't execute operations, just print]" \ + "(-c $ign)1:modules:->loadable-modules" \ + "(-c $ign)*:params:->params" && ret=0 + + [[ -n $state && -n ${opt_args[(i)(-r|--remove)]} ]] && state=loaded-modules + ;; + + rmmod) + _arguments -s -C "$args[@]" \ + '(-f --force)'{-f,--force}'[allow modules that are in use to be removed]' \ + '(-s --syslog)'{-s,--syslog}'[send errors to syslog]' \ + '(-v --verbose)'{-v,--verbose}'[be verbose]' \ + '*:loaded module:->loaded-modules' && ret=0 + ;; + + insmod) + _arguments "$args[@]" \ + '1:module file:_files' \ + '*:module parameters' && ret=0 + ;; + esac + + case "$state" in + loaded-modules|loadable-modules) + if [[ -r /proc/modules ]]; then + loaded_modules=(${${(f)"$(</proc/modules)"}%% *}) + elif [[ -x /sbin/lsmod ]]; then + loaded_modules=(${${(f)"$(/sbin/lsmod)"}[2,-1]%% *}) + else + return 1 + fi + + if [[ $state = loaded-modules ]]; then + _wanted modules expl 'loaded module' compadd -a loaded_modules && ret=0 + return ret + fi + ;& + + all-modules) + local kver=${opt_args[(i)(-S|-k|--set-version)]:-$(uname -r)} + + if _cache_invalid modules-$kver || ! _retrieve_cache modules-$kver; + then + modules=( $modules_dir/$kver/(*~(source|build))/**/*.(o|ko|ko.gz|ko.xz)(.:t:r:r) ) + modaliases=( ${${${(M)${(f)"$(<$modules_dir/$kver/modules.alias)"}:#alias*}#alias }%% *} ) + _store_cache modules-$kver modules modaliases + fi + + if (( ${+opt_args[(k)(-R|--resolve-alias)]} )); then + _tags module-aliases + else + _tags files modules module-aliases + fi + if [[ $state = loadable-modules ]]; then + modules=( ${modules:#(${(j:|:)~${=loaded_modules//_/-}})} ) + fi + + while _tags; do + _requested modules expl module compadd -a modules && ret=0 + _requested module-aliases expl 'module alias' compadd -a modaliases && ret=0 + _requested files expl "module file" _files -g '*.ko(-.)' && ret=0 + (( ret )) || break + done + ;; + + params) + if compset -P 1 '*='; then + _message -e value 'parameter value' + else + local params + params=( ${${(M)${(f)"$(_call_program module-parameters /sbin/modinfo "$words[2]" 2>/dev/null)"}:#parm:*}##parm:[[:space:]]##} ) + compset -S '=*' + if (( $#params )); then + _values -S = -w 'module parameter' \ + ${${${(M)params:#*(:bool|\(bool\))}/:/[}/(bool| \(bool\))/]} ${^${params:#*(:bool|\(bool\))}/:/[}"]:auto added argument: " && ret=0 + else + _message -e parameter "module doesn't take parameters" + fi + fi + ;; + esac + + return ret } _modutils "$@" diff --git a/Completion/Linux/Command/_networkmanager b/Completion/Linux/Command/_networkmanager index fa9301971..c9b09d145 100644 --- a/Completion/Linux/Command/_networkmanager +++ b/Completion/Linux/Command/_networkmanager @@ -4,6 +4,7 @@ _networkmanager() { local curcontext="$curcontext" state line + local nmcli="$words[1]" _arguments -C \ '(-o -overview)-o'{,verview}'[overview mode (hide default values)]' \ @@ -107,10 +108,22 @@ _nm_connection_down() { } _nm_connection_modify() { - # TODO: add support for options and properties - _arguments \ + local curcontext="$curcontext" ret=1 + local -a state line expl properties + + _arguments -A "-*" \ "--temporary" \ - "1:connection:_nm_connection_specs" + "1:connection:_nm_connection_specs" \ + '2:option:->properties' \ + '3:value' && ret=0 + + if [[ -n "$state" ]]; then + properties=( ${${(f)"$(_call_program properties $nmcli -t connection show $line[1])"}%%:*} ) + _description properties expl property + _multi_parts "$expl[@]" . properties && ret=0 + fi + + return ret } _nm_connection_clone() { @@ -245,6 +258,7 @@ _nm_device_wifi() { _nm_device_wifi_list() { # TODO: support bssid on its own _arguments \ + '--rescan[force or disable network scan]:network scan:(yes no auto)' \ "1: :(ifname)" \ "2:interface:_nm_device_ifnames" \ "3: :(bssid)" \ diff --git a/Completion/Linux/Command/_pmap b/Completion/Linux/Command/_pmap new file mode 100644 index 000000000..ba3321531 --- /dev/null +++ b/Completion/Linux/Command/_pmap @@ -0,0 +1,20 @@ +#compdef pmap +# based on procps-ng-3.3.15 + +_arguments -s \ + '(exit -A --range)'{-A+,--range}'[limit results to the specified address range]:low,high: ' \ + '(exit -q --quiet)'{-q,--quiet}'[do not display some header or footer lines]' \ + '(exit -p --show-path)'{-p,--show-path}'[show full path to files in the mapping column]' \ + '(exit)*: :_pids' \ + + '(format)' \ + '(exit)'{-d,--device}'[show the device format]' \ + '(exit)'{-x,--extended}'[show the extended format]' \ + '(exit)-X[show even more details than -x option]' \ + '(exit)-XX[show everything the kernel provides]' \ + '(exit)'{-c,--read-rc}'[read the default configuration]' \ + '(exit)'{-C+,--read-rc-from=}'[read the configuration from the specified file]: :_files' \ + + '(exit)' \ + '(- *)'{-n,--create-rc}'[create new default configuration and exit]' \ + '(- *)'{-N+,--create-rc-to=}'[create new configuration to the specified file and exit]: :_files' \ + '(- *)'{-h,--help}'[display help text and exit]' \ + '(- *)'{-V,--version}'[display version information and exit]' diff --git a/Completion/Linux/Command/_rpmbuild b/Completion/Linux/Command/_rpmbuild deleted file mode 100644 index 74d4464d8..000000000 --- a/Completion/Linux/Command/_rpmbuild +++ /dev/null @@ -1,53 +0,0 @@ -#compdef rpmbuild - -local -a cmds b_cmds t_cmds options b_options - -cmds=(--rebuild --recompile) -b_cmds=(-ba -bb -bp -bc -bi -bl -bs) -t_cmds=(-ta -tb -tp -tc -ti -tl -ts) -options=(--quiet -v -vv --verbose --rcfile --pipe --dbpath -r --root --buildroot --clean --nobuild --nodeps --nodigest --nosignature --macros - --rmsource --rmspec --short-circuit --sign --target -D --define -E --eval --with --without --debug --bcond --install-build-tree) -b_options=(--clean --nobuild --nodeps --nodigest --nosignature --rmsource --rmspec --short-circuit --sign --target --debug --with --without) - -_arguments \ - "($cmds $b_cmds $t_cmds)"{-ba,-ta}'[build binary and source packages]' \ - "($cmds $b_cmds $t_cmds)"{-bb,-tb}'[build a binary package]' \ - "($cmds $b_cmds $t_cmds)"{-bp,-tp}'[execute the "%prep" stage]' \ - "($cmds $b_cmds $t_cmds)"{-bc,-tc}'[do the "%build" stage]' \ - "($cmds $b_cmds $t_cmds)"{-bi,-ti}'[do the "%install" stage]' \ - "($cmds $b_cmds $t_cmds)"{-bl,-tl}'[do a "list check"]' \ - "($cmds $b_cmds $t_cmds)"{-bs,-ts}'[build just the source package]' \ - "($cmds $b_cmds $t_cmds * $b_options $options)"{-\?,--help}'[show help message]' \ - "($cmds $b_cmds $t_cmds * $b_options $options)"--querytags'[display known query tags]' \ - "($cmds $b_cmds $t_cmds * $b_options)"--showrc'[display final rpmrc and macro configuration]' \ - "($cmds $b_cmds $t_cmds * $b_options $options)"--usage'[display brief usage message]' \ - "($cmds $b_cmds $t_cmds * $b_options $options)"--version'[print the version of rpm being used]' \ - "(-v --verbose -vv)"--quiet'[print as little as possible]' \ - "(-v --verbose --quiet)"{-v,--verbose}'[print verbose information]' \ - "(-v --verbose --quiet)"-vv'[print lots of ugly debugging information]' \ - --rcfile'[RC files]:RC files:_files -S\:' \ - --macros'[macros files]:macros files:_files -S\:' \ - --pipe'[command to pipe the output of rpm to]:command' \ - --dbpath'[set database directory]:database directory:_files -/' \ - "(-r --root)"{-r,--root}'[root file system tree]:chroot directory:_files -/' \ - --buildroot'[override the BuildRoot]:BuildRoot directory:_files -/' \ - --clean'[remove the build tree after the packages are made]' \ - --nobuild'[do not execute any build stages (for spec testing purposes]' \ - --nodeps'[do not verify build dependencies]' \ - --nodigest"[don't verify package digest(s)]" \ - --nosignature"[don't verify package signature(s)]" \ - --rmsource'[remove the sources after the build]' \ - --rmspec'[remove the spec file after the build]' \ - --short-circuit'[skip straight to specified stage (-bc, -bi or -bb in PLD Linux]' \ - --sign'[embed a GPG signature]' \ - --target='[set target platform]:arch-vendor-os:' \ - {'*-D','*--define='}'[define MACRO with value EXPR]:MACRO EXPR' \ - {'*-E','*--eval='}'[print macro expansion of EXPR]:EXPR' \ - '*--with[enable configure option for build]:option' \ - '*--without[disable configure option for build]:option' \ - "($cmds $b_cmds $t_cmds * $b_options)"--bcond'[find all --with/--without values]' \ - --debug'[build packages with debug information]' \ - "($cmds $b_cmds $t_cmds * $b_options)"--install-build-tree'[make all needed dirs for building binary rpms]' \ - "(--clean $b_cmds $t_cmds --rebuild)"--recompile'[recompile source package]' \ - "(--clean $b_cmds $t_cmds --recompile)"--rebuild'[rebuild source package]' \ - "*:file:_files -g '(#i)*.(spec|srpm|tgz|tar|tar.gz|tar.bz2)(-.)'" && ret=0 diff --git a/Completion/Linux/Command/_setsid b/Completion/Linux/Command/_setsid index a8107e582..d248925aa 100644 --- a/Completion/Linux/Command/_setsid +++ b/Completion/Linux/Command/_setsid @@ -1,12 +1,9 @@ #compdef setsid -[[ $service == setsid ]] && precommands+=( setsid ) - _arguments -s -S -A '-*' : \ '(: * -)'{-h,--help}'[display help information]' \ '(: * -)'{-V,--version}'[display version information]' \ '(-c --ctty)'{-c,--ctty}'[set controlling terminal to current one]' \ '(-f --fork)'{-f,--fork}'[always fork]' \ '(-w --wait)'{-w,--wait}'[wait for program to exit, and use same return code]' \ - '1: :_path_commands' \ - '*:: : _normal' + '*:: : _normal -p $service' diff --git a/Completion/Linux/Command/_slabtop b/Completion/Linux/Command/_slabtop new file mode 100644 index 000000000..5c8919d12 --- /dev/null +++ b/Completion/Linux/Command/_slabtop @@ -0,0 +1,22 @@ +#compdef slabtop +# based on procps-ng-3.3.15 + +local -a criteria=( + 'a:number of active objects' + 'b:objects per slab' + 'c:cache size' + 'l:number of slabs' + 'v:number of active slabs' + 'n:name' + 'o:number of objects' + 'p:page per slab' + 's:object size' + 'u:cache utilization' +) + +_arguments -s \ + '(-d --delay -o --once)'{-d+,--delay=}'[specify the delay between updates]:seconds: ' \ + '(-s --sort)'{-s+,--sort=}'[specify the sort criteria]:criteria:(($criteria))' \ + '(-d --delay -o --once)'{-o,--once}'[display the output once and exit]' \ + '(-)'{-V,--version}'[display version information and exit]' \ + '(-)'{-h,--help}'[display usage information and exit]' diff --git a/Completion/Linux/Command/_ss b/Completion/Linux/Command/_ss index b1bfa207c..2a1cfcb78 100644 --- a/Completion/Linux/Command/_ss +++ b/Completion/Linux/Command/_ss @@ -20,6 +20,7 @@ _arguments -C -s \ "($info -i --info)"{-i,--info}'[show internal TCP information]' \ "($info)--tipcinfo[show internal tipc socket information]" \ "($info -s --summary)"{-s,--summary}'[print summary statistics]' \ + "($info)--tos[show tos and priority information]" \ "($info -b --bpf)"{-b,--bpf}'[show bpf filter socket information]' \ "($info -E --events)"{-E,--events}'[continually display sockets as they are destroyed]' \ "($info -Z --context)"{-Z,--context}'[display process SELinux security contexts]' \ @@ -35,10 +36,12 @@ _arguments -C -s \ "($info -w --raw)"{-w,--raw}'[display RAW sockets]' \ "($info -x --unix)"{-x,--unix}'[display Unix domain sockets]' \ "($info)--tipc[display only TIPC sockets]" \ + "($info)--xdp[display only XDP sockets]" \ "($info)--vsock[display only vsock sockets]" \ - "($info -f --family)"{-f+,--family=}'[display sockets of specified type]:family:(unix inet inet6 link netlink unix vsock tipc)' \ + "($info -f --family)"{-f+,--family=}'[display sockets of specified type]:family:(inet inet6 link unix netlink vsock tipc xdp help)' \ "($info -K --kill)"{-K,--kill}'[forcibly close sockets, display what was closed]' \ "($info -H --no-header)"{-H,--no-header}'[suppress header line]' \ + "($info -O --oneline)"{-O,--oneline}"[print socket's data on a single line]" \ "($info -A --query --socket)"{-A+,--query=,--socket=}'[specify socket tables to show]: :_values -s , socket\ table all inet tcp udp raw unix packet netlink unix_dgram unix_stream unix_seqpacket packet_raw packet_dgram vsock_stream vsock_dgram tipc' \ "($info -D)"{-D+,--diag=}'[dump raw info to file]:file:_files' \ "($info -F)"{-F+,--filter=}'[read filter information from a file]:file:_files' \ diff --git a/Completion/Linux/Command/_sshfs b/Completion/Linux/Command/_sshfs index 6e889cf49..3363ecdc0 100644 --- a/Completion/Linux/Command/_sshfs +++ b/Completion/Linux/Command/_sshfs @@ -12,7 +12,7 @@ _arguments -C -S : \ '-C[enable compression]' \ '-F[specify ssh config file]:file:_files' \ '*-o[specify mount options]:options:->options' \ - '(-f)-d[enable debug output]' \ + '(-d --debug -f)'{-d,--debug}'[enable debug output]' \ '-f[foreground]' \ '-s[disable multithreaded operation]' \ ':remote directory:_user_at_host -S:' \ @@ -20,14 +20,14 @@ _arguments -C -S : \ if [[ $state == options ]]; then _values -s , "sshfs or fuse or mount options" \ - debug reconnect delay_connect sshfs_sync no_readahead sync_readdir sshfs_debug \ - 'cache:cache setting:(yes no)' \ - 'cache_max_size:size [10000]' \ - 'cache_timeout:timeout (seconds) [20]' \ - cache_{stat,dir,link}_timeout:'timeout (seconds)' \ - 'cache_clean_interval:interval [60]' \ - 'cache_min_clean_interval:interval [5]' \ - 'workaround:workaround:(none all rename delaysrv truncate nobuflimit)' \ + reconnect delay_connect sshfs_sync no_readahead sync_readdir \ + 'dir_cache:cache setting:(yes no)' \ + 'dcache_max_size:size [10000]' \ + 'dcache_timeout:timeout (seconds) [20]' \ + dcache_{stat,dir,link}_timeout:'timeout (seconds)' \ + 'dcache_clean_interval:interval [60]' \ + 'dcache_min_clean_interval:interval [5]' \ + 'workaround:workaround:(none all rename renamexdev delaysrv truncate nobuflimit fstat createmode)' \ 'idmap:user/group mapping:(none user file)' \ uidfile:file:_files \ gidfile:file:_files \ diff --git a/Completion/Linux/Command/_strace b/Completion/Linux/Command/_strace index 83ccc6afb..7d4595a33 100644 --- a/Completion/Linux/Command/_strace +++ b/Completion/Linux/Command/_strace @@ -19,15 +19,18 @@ _arguments -C -s \ '(-c)-T[show the time spent in system calls]' \ '(-xx)-x[print all non-ASCII strings in hexadecimal string format]' \ '(-x)-xx[print all strings in hexadecimal string format]' \ + '-X+[set the format for printing of named constants and flags]:format:(raw abbrev verbose)' \ '(-c -yy)-y[print paths associated with file descriptor arguments]' \ '(-c -y)-yy[print protocol specific information associated with socket file descriptors]' \ '(-C -i -k -r -ff -t -tt -ttt -T -y -yy)-c[count time, calls, and errors for each system call and report a summary]' \ '(-c)-C[count time, calls, and errors for each system call and report a summary in addition to regular output]' \ '-O+[overhead for tracing system calls]:overhead (microseconds)' \ - '-S+[sort the output of the histogram (-c option) by the specified criterion]:sort criterion:(time calls name nothing)' \ + '-S+[sort the output of the histogram (-c option) by the specified criterion]:sort criterion [time]:(time calls errors name nothing)' \ '-w[summarise syscall latency]' \ '*-e+[select events to trace or how to trace]:system call:->expressions' \ '*-P+[trace only system calls accessing given path]:path:_files' \ + '(-Z)-z[trace only system calls that return success]' \ + '(-z)-Z[trace only system calls that return an error]' \ '-b+[detach from process on specified syscall]:syscall:(execve)' \ '-f[trace child processes as they are created by currently traced processes]' \ '(-c -C)-ff[write each process trace to <filename>.<pid> (when using -o <filename>]' \ @@ -36,6 +39,7 @@ _arguments -C -s \ '*-E+[set or remove exported environment variable]:variable:->envars' \ "${root}-u+[run as specified user]:user:_users" \ '(:)*-p+[attach to the process with specified process ID and begin tracing]:process ID:_pids' \ + '--seccomp-bpf[enable seccomp-bpf filtering]' \ '-d[show debug output of strace itself on standard error]' \ '-v[print unabbreviated versions of environment, stat, termios, etc. calls]' \ '(- 1 *)-h[display help information]' \ @@ -56,25 +60,44 @@ case $state in 'write[perform a full hex and ASCII dump of all the data written to listed file descriptors]:file descriptor:_sequence _file_descriptors' \ 'fault[perform syscall fault injection]:system call:_sys_calls -a -n' \ 'inject[perform syscall tampering]:system call:_sys_calls -a -n' \ + 'status[trace system calls with given return status]:status:->status' \ 'kvm[print the exit reason of kvm vcpu]: :(vcpu)' && ret=0 - if [[ $words[CURRENT] != *=* || $state = syscalls ]]; then + if [[ $state = status ]]; then + _values -s , 'return status [all]' \ + all successful failed \ + "unfinished[system calls that don't return]" \ + 'unavailable[system calls that return but strace fails to fetch the error]' \ + 'detached[system calls where strace detaches before the return]' && ret=0 + elif [[ $words[CURRENT] != *=* || $state = syscalls ]]; then local dedup sets suf="-qS," compset -P '!' dedup=( ${(Ms.,.)PREFIX##*,} ${(Ms.,.)SUFFIX%%,*} ) compset -S ',*' || suf="" compset -P '*,' - sets=( - 'file:trace all system calls which take a file name as an argument' - 'process:trace all system calls which involve process management' - 'network:trace all the network related system calls' - 'signal:trace all signal related system calls' - 'ipc:trace all IPC related system calls' - 'desc:trace all file descriptor related system calls' - 'memory:trace all memory mapping related system calls' - ) - _alternative \ - "related system call:sets: _describe -t traces 'related system call' sets -F dedup $suf" \ - "system call:syscalls:_sys_calls -a -n $suf -F dedup" && ret=0 + if compset -P /; then + _wanted syscalls expl "system call (regex)" _sys_calls -a -n $suf -F dedup && ret=0 + else + sets=( + {%,}'file:trace all system calls which take a file name as an argument' + {%,}'process:trace all system calls which involve process management' + {%net,{%,}network}':trace all the network related system calls' + {%,}'signal:trace all signal related system calls' + {%,}'ipc:trace all IPC related system calls' + {%,}'desc:trace all file descriptor related system calls' + {%,}'memory:trace all memory mapping related system calls' + '%stat:trace variants of stat' + '%lstat:trace variants of lstat' + '%fstat:trace variants of fstat and fstatat' + '%%stat:trace variants of all syscalls used for requesting file status' + '%statfs:trace variants of statfs' + '%fstatfs:trace variants of fstatfs' + '%%statfs:trace variants of all syscalls used for file system statistics' + '%pure:trace syscalls that always succeed and have no arguments' + ) + _alternative \ + "sets:related system call: _describe -t traces 'related system call' sets -F dedup $suf" \ + "syscalls:system call:_sys_calls -a -n $suf -F dedup" && ret=0 + fi fi ;; file-pipe) diff --git a/Completion/Linux/Command/_tload b/Completion/Linux/Command/_tload new file mode 100644 index 000000000..29fddfc3d --- /dev/null +++ b/Completion/Linux/Command/_tload @@ -0,0 +1,9 @@ +#compdef tload +# based on procps-ng-3.3.15 + +_arguments -s \ + '(-s --scale)'{-s+,--scale=}'[specify the vertical scale]:number of characters between tics: ' \ + '(-d --delay)'{-d+,--delay=}'[specify the delay between updates]:seconds: ' \ + '(- *)'{-h,--help}'[display help and exit]' \ + '(- *)'{-V,--version}'[display version information and exit]' \ + '1: :_ttys -o' diff --git a/Completion/Linux/Command/_tpconfig b/Completion/Linux/Command/_tpconfig deleted file mode 100644 index 62f216107..000000000 --- a/Completion/Linux/Command/_tpconfig +++ /dev/null @@ -1,24 +0,0 @@ -#compdef tpconfig - -_arguments \ - '--help' \ - '(-D --debug)'{-D,--debug=}':debug level:(1 2 3)' \ - '(-d --device)'{-d,--device=}':mouse device:_files' \ - '--version' \ - '(-i --info)'{-i,--info}'[display current touchpad config]' \ - '(-x --reset)'{-x,--reset}'[perform a software reset on the touchpad]' \ - '(-q --quiet --silent)'{-q,--quiet,--silent}'[suppress verbose output]' \ - '-a::packet mode:(0 1)' \ - '--absolute[set packet mode to absolute]' \ - '--relative[set packet mode to relative]' \ - '-r::reporting rate:(0 1)' \ - '-t::tapping mode:(0 1 2 3)' \ - '-s::sleep mode:(0 1)' \ - '(-2 --two-button)'{-2,--two-button}'[set two-button mode]' \ - '(-3 --three-button)'{-3,--three-button}'[set three-button mode]' \ - '(-c --corner)'{-c,--corner=}'::corner-tap mode:(0 1)' \ - '(-e --edgemode)'{-e,--edgemode=}'::edge motion:(0 1 3)' \ - '-m[display which mouse button is simulated by corner taps]' \ - '--middle-button[make corner taps simulate the middle mouse button]' \ - '--right-button[make corner taps simulate the right mouse button]' \ - '(-z --zthreshold)'{-z,--zthreshold=}'::tap sensitivity:' diff --git a/Completion/Linux/Command/_valgrind b/Completion/Linux/Command/_valgrind index 21b7d88c7..4a710e7f7 100644 --- a/Completion/Linux/Command/_valgrind +++ b/Completion/Linux/Command/_valgrind @@ -39,6 +39,8 @@ common_report_errors=( '--exit-on-first-error=-[exit on the first error]:enable:(yes no)' \ '--error-exitcode=-[exit code to return if errors found]:exit code' \ '--error-markers=-[add lines with begin/end markers before/after]:markers (begin,end)' \ + '(--show-error-list)-s[show detected errors list and suppression counts at exit]' \ + '--show-error-list=-[show detected errors list and suppression counts at exit]:enable [no]:(yes no)' '--keep-debuginfo=-[keep symbols etc for unloaded code]:enable:(yes no)' \ '--show-below-main=-[continue stack traces below main()]:enable [no]:(yes no)' \ '--default-suppression=-[load default suppressions]:enable [yes]:(yes no)' \ @@ -84,6 +86,7 @@ args_addrcheck=( args_drd=( $common_own_malloc $common_read_varinfo + $common_report_errors '--check-stack-var=-[detect data races on stack variables]:enable [no]:(yes no)' '--exclusive-threshold=-[print an error if any mutex or writer lock is held longer than specified time]:time (ms)' '--first-race-only=-[report only the first detected data race]:enable [no]:(yes no)' @@ -111,6 +114,7 @@ args_drd=( args_memcheck=( $args_addrcheck $common_read_varinfo + $common_report_errors ) args_cachegrind=( @@ -125,6 +129,7 @@ args_cachegrind=( args_helgrind=( $common_own_malloc $common_read_varinfo + $common_report_errors '--free-is-write=-[treat heap frees as writes]:enable [no]:(yes no)' '--track-lockorders=-[show lock ordering errors]:enable [yes]:(no yes)' '--history-level=-[specify amount of history to show for data races]:level [full]:(( @@ -186,6 +191,7 @@ args_exp_dhat=( args_exp_sgcheck=( $common_partial + $common_report_errors '--enable-sg-checks=-[enable stack & global array checking]:enable [yes]:(yes no)' ) |