diff options
Diffstat (limited to 'Completion/Unix')
24 files changed, 159 insertions, 131 deletions
diff --git a/Completion/Unix/Command/_attr b/Completion/Unix/Command/_attr index 2030064dc..d8d4ed260 100644 --- a/Completion/Unix/Command/_attr +++ b/Completion/Unix/Command/_attr @@ -39,6 +39,7 @@ case $service in '(-v --value)'{-v+,--value=}'[specify value for the attribute]' \ '(-x --remove)'{-x+,--remove=}'[remove specified extended attribute]' \ '(-n --name -v --value)--restore[restore extended attributes from dump file]:dump file:_files' \ + '--raw[attribute value is not encoded]' \ '(-h --no-dereference)'{-h,--no-dereference}"[don't follow symbolic links]" \ '(* -)--version[display version information]' \ '(* -)--help[display help information]' \ diff --git a/Completion/Unix/Command/_cmp b/Completion/Unix/Command/_cmp index bcede8b0b..6d7bfb1b7 100644 --- a/Completion/Unix/Command/_cmp +++ b/Completion/Unix/Command/_cmp @@ -15,6 +15,7 @@ case $variant in '(- *)--help[display help information]' ) ;; + netbsd*) args+=( "-c[don't use mmap]" ) ;| freebsd*|openbsd*) args=( "-h[don't follow symbolic links]" diff --git a/Completion/Unix/Command/_dhclient b/Completion/Unix/Command/_dhclient index 57a5061c2..beaab5e2d 100644 --- a/Completion/Unix/Command/_dhclient +++ b/Completion/Unix/Command/_dhclient @@ -54,6 +54,7 @@ case $OSTYPE in '(--no-pid)-pf[pid file]:pid file:_files' '(-pf)--no-pid[disable writing pid files]' '-cf[config file]:config file:_files' + '-df[duid file]:duid file:_files' '-sf[script file]:script file:_files' '-4o6[DHCPv4 over DHCPv6 protocol]:port' "-nc[don't drop capabilities]" diff --git a/Completion/Unix/Command/_dig b/Completion/Unix/Command/_dig index 5feb71fef..18e9a0dbd 100644 --- a/Completion/Unix/Command/_dig +++ b/Completion/Unix/Command/_dig @@ -26,6 +26,7 @@ local -a alts args '*+noedns[clear EDNS options to be sent]' '*+'{no,}'expire[send an EDNS Expire option]' '*+'{no,}'header-only[send query without a question section]' + '*+'{no,}'idnin[set processing of IDN domain names on input]' '*+'{no,}'idnout[set conversion of IDN puny code on output]' '*+'{no,}'keepopen[keep TCP socket open between queries]' '*+'{no,}'mapped[allow mapped IPv4 over IPv6 to be used]' diff --git a/Completion/Unix/Command/_entr b/Completion/Unix/Command/_entr index a8d43fc5e..e1ba7cf2b 100644 --- a/Completion/Unix/Command/_entr +++ b/Completion/Unix/Command/_entr @@ -6,6 +6,7 @@ typeset -A opt_args _arguments -s -S \ '-c[execute clear before invoking utility]' \ '-d[track directories and exit if a new file is added]' \ + "-n[non-interactive mode; don't access TTY]" \ '-p[postpone first execution of the utility]' \ '-r[reload a persistent child process]' \ '(*)-s[evaluate the first argument using interpreter specified by $SHELL]' \ diff --git a/Completion/Unix/Command/_env b/Completion/Unix/Command/_env index 96e96bd7b..99fc513d7 100644 --- a/Completion/Unix/Command/_env +++ b/Completion/Unix/Command/_env @@ -1,16 +1,19 @@ #compdef env genv -local context state line variant args ret=1 +local context state line variant args ign ret=1 _pick_variant -r variant gnu=Free\ Soft $OSTYPE --version case $variant in gnu) + (( $#words > 2 )) && ign='!' args=( '(-)'{-i,--ignore-environment}'[start with empty environment]' '(--ignore-environment -i --help --version)*'{-u+,--unset=}'[remove variable from the environment]:env var to remove:_parameters -g "*export*"' '(-C --chdir)'{-C+,--chdir=}'[change working directory]:directory:_directories' - '(- *)--help[display help information]' - '(- *)--version[display version information]' + '(-S --split-string)'{-S+,--split-string=}'[perform word splitting]:string to split' + '(-v --debug)'{-v,--debug}'[print verbose information for each processing step]' + "${ign}(- *)--help[display help information]" + "${ign}(- *)--version[display version information]" ) ;; freebsd*) diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index eac0c8476..2cae4c82f 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -738,11 +738,11 @@ _git-describe () { '--all[use any ref found in "$GIT_DIR/refs/"]' \ '--tags[use any ref found in "$GIT_DIR/refs/tags"]' \ '(--tags)--contains[find the tag after the commit instead of before]' \ - '(--long)--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length' \ + '--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length' \ '( --exact-match)--candidates=[consider up to given number of candidates]: :__git_guard_number "number of candidates"' \ '(--candidates )--exact-match[only output exact matches, same as --candidates=0]' \ '--debug[display information about the searching strategy]' \ - '(--abbrev)--long[always show full format, even for exact matches]' \ + '--long[always show full format, even for exact matches]' \ '*--match=[only consider tags matching glob pattern]:pattern' \ "*--exclude=[don't consider tags matching glob pattern]:pattern" \ '--always[show uniquely abbreviated commit object as fallback]' \ @@ -3607,15 +3607,7 @@ _git-remote () { '(-m --master)'{-m,--master=}'[set HEAD of remote to point to given master branch]: :__git_branch_names' \ '--mirror[do not use separate remotes]::mirror type:(fetch pull)' \ ':name:__git_remotes' \ - ':repository:->repository' && ret=0 - case $state in - (repository) - _alternative \ - 'local-repositories::__git_local_repositories' \ - 'remote-repositories::__git_remote_repositories' \ - 'urls::_urls' && ret=0 - ;; - esac + ':repository:__git_repositories_or_urls' && ret=0 ;; (get-url) _arguments -S -s \ @@ -3644,14 +3636,13 @@ _git-remote () { '*: :__git_branch_names' && ret=0 ;; (set-url) - # TODO: Old URL should be one of those defined for the remote. - _arguments -S -s \ - '(3)--push[manipulate push URLs instead of fetch URLs]' \ - '--add[add URL to those already defined]' \ - '(3)--delete[delete all matching URLs]' \ - ': :__git_remotes' \ - ':new url:_urls' \ - ':old url:_urls' && ret=0 + _arguments -S \ + '--push[manipulate push URLs instead of fetch URLs]' \ + '(3)--add[add URL to those already defined]' \ + '(2)--delete[delete all matching URLs]' \ + '1: :__git_remotes' \ + '2:new url:__git_repositories_or_urls' \ + '3:old url: __git_current_remote_urls ${(k)opt_args[--push]} $line[1]' && ret=0 ;; (show) _arguments -S \ @@ -6971,6 +6962,21 @@ __git_local_repositories () { _wanted local-repositories expl 'local repositories' _directories } +(( $+functions[__git_repositories_or_urls] )) || +__git_repositories_or_urls () { + _alternative \ + 'repositories::__git_repositories' \ + 'urls::_urls' +} + +(( $+functions[__git_current_remote_urls] )) || +__git_current_remote_urls () { + local expl + _description remote-urls expl 'current url' + compadd "$expl[@]" -M 'r:|/=* r:|=*' - ${(f)"$(_call_program remote-urls + git remote get-url "$@" --all)"} +} + (( $+functions[__git_any_repositories] )) || __git_any_repositories () { # TODO: should also be $GIT_DIR/remotes/origin diff --git a/Completion/Unix/Command/_gnutls b/Completion/Unix/Command/_gnutls index 2cd559843..1c14de791 100644 --- a/Completion/Unix/Command/_gnutls +++ b/Completion/Unix/Command/_gnutls @@ -54,13 +54,14 @@ case "$service" in gnutls-cli) args+=( '--tofu[enable trust on first use authentication]' '!--no-tofu' - '--strict-tofu[fail to connect if a known certificate has changed]' '!--no-strict-tofu' + '--strict-tofu[fail to connect if a certificate is unknown or has changed]' '!--no-strict-tofu' '--dane[enable DANE certificate verification (DNSSEC)]' '!--no-dane' '--local-dns[use the local DNS server for DNSSEC resolving]' '!--no-local-dna' '--no-ca-verification[disable CA certificate verification]' '!--ca-verification' '--ocsp[enable OCSP certificate verification]' '!--no-oscp' '(-r --resume)'{-r,--resume}'[establish a session and resume]' '(-e --rehandshake)'{-e,--rehandshake}'[connect, establish a session and rehandshake immediately]' + "--verify-hostname-str=[specify server's hostname to use for validation]:hostname" '(-s --starttls)'{-s,--starttls}'[start TLS on EOF or SIGALRM]' '--crlf[send CR LF instead of LF]' '--fastopen[enable TCP Fast Open]' @@ -75,7 +76,6 @@ case "$service" in '--pskusername[specify PSK username to use]:username' '--pskkey[specify PSK key to use]:key' "--insecure[don't require server cert validation]" - '--ranges[use length-hiding padding to prevent traffic analysis]' '--benchmark-ciphers[benchmark individual ciphers]' '--benchmark-soft-ciphers[benchmark individual software ciphers]' '--benchmark-tls-kx[benchmark TLS key exchange methods]' @@ -84,7 +84,8 @@ case "$service" in '*--alpn=[enable application layer protocol]:string' '--recordsize=[specify maximum record size to advertize]:record size' "--disable-sni[don't send a Server Name]" - '--disable-extensions[disable all the TLS extensions]' + '--single-key-share[send a single key share under TLS1.3]' + '--post-handshake-auth[enable post-handshake authentication under TLS1.3]' '--inline-commands[inline commands of the form ^<cmd>^]' '--inline-commands-prefix=[change delimiter used for inline commands]:delimiter [^]' '--fips140-mode[report status of FIPS140-2 mode in gnutls library]' @@ -96,20 +97,22 @@ case "$service" in '--sni-hostname-fatal[send fatal alert on sni-hostname mismatch]' '*--alpn=[specify ALPN protocol to be enabled by the server]:protocol' '--alpn-fatal[send fatal alert on non-matching ALPN name]' + "--nocookie[don't require cookie on DTLS sessions]" '(-g --generate)'{-g,--generate}'[generate Diffie-Hellman parameters]' '(-q --quiet)'{-q,--quiet}'[suppress some messages]' "--nodb[don't use a resumption database]" '--http[act as an HTTP server]' '--echo[act as an Echo server]' - '(-a --disable-client-cert)'{-a,--disable-client-cert}"[don't request a client certificate]" - '(-r --require-client-cert)'{-r,--require-client-cert}'[require a client certificate]' + '(-a --disable-client-cert -r --require-client-cert)'{-a,--disable-client-cert}"[don't request a client certificate]" + '(-a --disable-client-cert -r --require-client-cert)'{-r,--require-client-cert}'[require a client certificate]' '--verify-client-cert[if a client certificate is sent then verify it]' '--dhparams=[specify DH params file to use]:file:_files' '--srppasswd=[specify SRP password file to use]:file:_files' '--srppasswdconf=[specify SRP password configuration file to use]:file:_files' '--pskpasswd=[specify PSK password file to use]:file:_files' '--pskhint=[specify PSK identity hint to use]:string' - '--ocsp-response=[specify OCSP response to send to client]:file:_files' + '*--ocsp-response=[specify OCSP response to send to client]:string:_files' + '--ignore-ocsp-response-errors[ignore any errors when setting the OCSP response]' ) ;; @@ -158,7 +161,6 @@ case "$service" in '--empty-password[enforce an empty password]' '--key-type=[specify the key type to use on key generation]:key type' '(-i --certificate-info)'{-i,--certificate-info}'[print information on a certificate]' - '--certificate-pubkey[print certificate public key]' '(-l --crl-info)'{-l,--crl-info}'[print information on a CRL]' '--crq-info[print information on a certificate request]' "--no-crq-extensions[don't use extensions in certificate requests]" diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg index 4b88ce4ea..7b72605b3 100644 --- a/Completion/Unix/Command/_hg +++ b/Completion/Unix/Command/_hg @@ -192,13 +192,9 @@ _hg_tags() { # likely merge candidates _hg_mergerevs() { typeset -a heads - local myrev - - heads=(${(f)"$(_hg_cmd heads --template '{rev}\\n')"}) - # exclude own revision - myrev=$(_hg_cmd log -r . --template '{rev}\\n') - heads=(${heads:#$myrev}) + local revset='sort(head() and not ., -rev)' + heads=(${(f)"$(_hg_cmd log -r '$revset' --template '{rev}\\n')"}) (( $#heads )) && _describe -t heads 'heads' heads } @@ -571,7 +567,7 @@ _hg_cmd_diff() { if [[ $state == 'diff_files' ]] then - if [[ -n $opt_args[-r] ]] + if [[ -n ${opt_args[(I)-r|--rev]} ]] then _hg_files && ret=0 else @@ -799,7 +795,7 @@ _hg_cmd_revert() { if [[ $state == 'diff_files' ]] then - if [[ -n $opt_args[-r] ]] + if [[ -n ${opt_args[(I)-r|--rev]} ]] then _hg_files && ret=0 else diff --git a/Completion/Unix/Command/_iostat b/Completion/Unix/Command/_iostat index e95d62f80..8909ae311 100644 --- a/Completion/Unix/Command/_iostat +++ b/Completion/Unix/Command/_iostat @@ -38,6 +38,7 @@ case $OSTYPE:l in args+=( '-D[display alternate disk statistics]' '-x[show extended disk statistics]' + '-y[report data on waiting and active requests]' '*:drives:( $(sysctl -n hw.disknames) )' ) ;; @@ -114,6 +115,7 @@ case $OSTYPE:l in args=( '-c[display CPU utilization report]' '-d[display device utilization report]' + '--dec=-[specify the number of decimal places to use]:decimal places [2]:(0 1 2)' '*-g[display statistics for a group of devices]:group name' '-H[only display global statistics for group]' '(--human)-h[human readable device utilization report]' diff --git a/Completion/Unix/Command/_ln b/Completion/Unix/Command/_ln index 764dc8f99..3c1dcac76 100644 --- a/Completion/Unix/Command/_ln +++ b/Completion/Unix/Command/_ln @@ -52,16 +52,12 @@ else ;| darwin*|dragonfly*|freebsd*|netbsd*) args+=( - '(-f)-i[prompt before removing destination files]' - '-v[print name of each linked file]' - ) - ;| - darwin*|dragonfly*|freebsd*) - args+=( '-F[remove existing destination directories]' + '(-f)-i[prompt before removing destination files]' + '-v[print name of each linked file]' ) ;| - dragonfly*|freebsd*|openbsd*) + dragonfly*|freebsd*|netbsd*|openbsd*) args+=( '(-L)-P[create hard links directly to symbolic links]' '(-P)-L[create hard links to symbolic link references]' diff --git a/Completion/Unix/Command/_md5sum b/Completion/Unix/Command/_md5sum index 8e93fbbac..3dfcd6322 100644 --- a/Completion/Unix/Command/_md5sum +++ b/Completion/Unix/Command/_md5sum @@ -7,7 +7,7 @@ # # @todo Support BusyBox? -local type +local type ign local -a args case $service in @@ -17,16 +17,18 @@ case $service in esac # General options -args+=( +(( $#words > 2 )) && ign='!' +args=( '(: -)--help[display help information]' '(: -)--version[display version information]' ) # Summing options -args+=( +args=( ${ign}${^args} + sum '(chk)--tag[create BSD-style checksums]' '(chk -b -t --binary --text)'{-b,--binary}'[read in binary mode]' '(chk -b -t --binary --text)'{-t,--text}'[read in text mode]' + '(chk -z --zero)'{-z,--zero}'[end each output line with NUL and disable filename escaping]' ) # This is the only option that differs amongst all of these tools [[ $service == *b2* ]] && args+=( diff --git a/Completion/Unix/Command/_mount b/Completion/Unix/Command/_mount index 03cc01f8d..301b9e58e 100644 --- a/Completion/Unix/Command/_mount +++ b/Completion/Unix/Command/_mount @@ -931,7 +931,7 @@ devordir) esac ;; udevordir) - _umountable + _umountable && ret=0 ;; labels) _wanted labels expl 'disk label' compadd /dev/disk/by-label/*(:t) && ret=0 diff --git a/Completion/Unix/Command/_ps b/Completion/Unix/Command/_ps index 72e711227..98dcd1cd0 100644 --- a/Completion/Unix/Command/_ps +++ b/Completion/Unix/Command/_ps @@ -110,10 +110,16 @@ case $OSTYPE in bsdarg+=( '*G[select processes by real group]' ) ;| freebsd*|dragonfly*) - bsd+=( 'f[show command and environment for swapped out processes]' ) ;| + bsd+=( 'f[show command and environment for swapped out processes]' ) + ;| netbsd*|openbsd*) bsdarg+=( 'W[extract swap information from specified file]' ) ;| + freebsd*|netbsd*) + bsd+=( + 'd[show process hierarchy]' + ) + ;| darwin*) bsd+=( 'd[select all processes except session leaders]' @@ -140,7 +146,6 @@ case $OSTYPE in ;; freebsd*) bsd+=( - 'd[show process hierarchy]' '*J[select processes by jail ID]' 'Z[show mac label]' ) diff --git a/Completion/Unix/Command/_route b/Completion/Unix/Command/_route index f8426874c..06cca8d99 100644 --- a/Completion/Unix/Command/_route +++ b/Completion/Unix/Command/_route @@ -81,7 +81,7 @@ case $OSTYPE in '-llinfo:validly translate proto addr to link addr' ) ;| - (open|free)bsd*|darwin*|dragonfly*) + (net|open|free)bsd*|darwin*|dragonfly*) args+=( "-d[debug-only mode: don't update routing table]" '-t[test-only mode: /dev/null used instead of a socket]' @@ -89,7 +89,7 @@ case $OSTYPE in ;| netbsd*|solaris*) args+=( '-f[remove all routes first]' ) - ;; + ;| (netbsd|darwin|dragonfly)*) modifiers+=( '-proxy:make entry a link level proxy' ) ;| @@ -121,8 +121,10 @@ case $OSTYPE in netbsd*) subcmds+=( flushall 'remove all routes including the default gateway' ) args+=( + "-L[don't show link layer entries in routing table]" '-S[print a space when a flag is missing to align flags]' '-s[suppress all output from get except for the gateway]' + '-T[show tags in the route display]' ) modifiers+=( '-tag' diff --git a/Completion/Unix/Command/_service b/Completion/Unix/Command/_service index 50e8607bf..1216f57a8 100644 --- a/Completion/Unix/Command/_service +++ b/Completion/Unix/Command/_service @@ -5,24 +5,28 @@ # _sub_command happy # we are interested in init service only -local args ctx="${curcontext}argument-1:" +local args actions ctx="${curcontext}argument-1:" zstyle -T ":completion:${ctx}" tag-order && \ zstyle ":completion:${ctx}" tag-order init case $OSTYPE in + freebsd<11->.*) + args=( '-j+[perform actions in specified jail]:jail:_jails' ) + ;& freebsd*|dragonfly*) - args=( - '(-)-r[show the results of boot time rcorder]' - '(-)-R[restart all enabled local services]' + actions=( + '(*)-r[show the results of boot time rcorder]' + '(*)-R[restart all enabled local services]' ) ;& netbsd*) _arguments -s $args \ - '(-)-e[show services that are enabled]' \ - '(-)-l[list all scripts in /etc/rc.d and the local startup directory]' \ '(-e -R)-v[verbose]' \ - ':service name:_services' \ - '*::service argument:_init_d' + '*::service argument:_init_d' \ + + '(actions)' $actions \ + '(*)-e[show services that are enabled]' \ + '(*)-l[list all scripts in /etc/rc.d and the local startup directory]' \ + ':service name:_services' ;; *) _arguments -s \ diff --git a/Completion/Unix/Command/_sort b/Completion/Unix/Command/_sort index c81e6f856..dfd43ce55 100644 --- a/Completion/Unix/Command/_sort +++ b/Completion/Unix/Command/_sort @@ -4,8 +4,8 @@ local args variant local ordering='(-d --dictionary-order -g --general-numeric-sort -M --month-sort -h --human-numeric-sort -n --numeric-sort --sort -V --version-sort --help --version)' args=( - "(-c --check -C)-c[check whether input is sorted; don't sort]" - '(-m --merge)'{-m,--merge}"[merge already sorted files; don't sort]" + "(-c --check -C -m --merge -s --stable)-c[check whether input is sorted; don't sort]" + '(-c --check -C -m --merge)'{-m,--merge}"[merge already sorted files; don't sort]" '(-o --output)'{-o+,--output=}'[write result to file instead of standard output]:output file:_files' \*{-T+,--temporary-directory=}'[specify directory for temporary files]:directory:_directories' '(-u --unique)'{-u,--unique}'[with -c, check for strict ordering; without -c, output only the first of an equal run]' @@ -26,7 +26,7 @@ case $variant in '(-s --stable)'{-s,--stable}'[preserve original order of lines with the same key]' ) ;| - openbsd*|freebsd*|gnu|solaris2.<11->) + netbsd*|openbsd*|freebsd*|gnu|solaris2.<11->) args+=( "(-c --check -C)-C[check whether input is sorted silently; don't sort]" ) diff --git a/Completion/Unix/Command/_split b/Completion/Unix/Command/_split index 25b5aec2d..c5ab0dc9b 100644 --- a/Completion/Unix/Command/_split +++ b/Completion/Unix/Command/_split @@ -42,12 +42,12 @@ case $variant in (free|net)bsd*) args+=( '(-b -l -p)-n+[generate specified number of output files]:output files' ) ;| - freebsd*) + darwin*|freebsd*) args+=( - '-d[use numeric suffixes]' '(-b -l -n)-p+[split the file whenever a line matches specified pattern]:pattern' ) - ;; + ;| + freebsd*) args+=( '-d[use numeric suffixes]' ) ;; esac _arguments -s -S $args && ret=0 diff --git a/Completion/Unix/Command/_strings b/Completion/Unix/Command/_strings index b13366dd2..af95af52f 100644 --- a/Completion/Unix/Command/_strings +++ b/Completion/Unix/Command/_strings @@ -39,7 +39,7 @@ if _pick_variant -r variant binutils=GNU elftoolchain=elftoolchain elfutils=elfu '(-a --all -d --data)'{-d,--data}'[only print strings from file data sections]' '(-w --include-all-whitespace)'{-w,--include-all-whitespace}'[include all whitespace as valid string characters]' '(-T --target)'{-T+,--target=}'[specify binary file format]:format:compadd - ${(z)${(M)${(f)"$(_call_program targets strings --help)"}##* supported targets*}##*\: }' - '(-s --output-separator)'{-s+,--output-separator=}'[specify string used to separate strings in output]' + '(-s --output-separator)'{-s+,--output-separator=}'[specify string used to separate strings in output]:separator' ) ;; elfutils) diff --git a/Completion/Unix/Command/_tar b/Completion/Unix/Command/_tar index 3e44b98f7..727fbd6b5 100644 --- a/Completion/Unix/Command/_tar +++ b/Completion/Unix/Command/_tar @@ -1,4 +1,4 @@ -#compdef tar gtar star +#compdef tar gtar star bsdtar # Tar completion. Features: # - Tries to collect tar commands from second position, single letter diff --git a/Completion/Unix/Command/_top b/Completion/Unix/Command/_top index 8f81e9526..f9d2733fc 100644 --- a/Completion/Unix/Command/_top +++ b/Completion/Unix/Command/_top @@ -72,7 +72,8 @@ case $OSTYPE in '-m+[specify statistic type]:type:(( cpu\:default io ))' '-P[per-cpu CPU usage statistics]' '(1 -)-v[write version number and exit]' - '-z[do not display system idle process]' + '-w[display approximate swap usage]' + "-z[don't display system idle process]" '-J+[show processes owned by the specified jail]:jail:_jails -0' '-U+[show processes owned by the specified username]: :_users' );; diff --git a/Completion/Unix/Command/_zsh b/Completion/Unix/Command/_zsh index a5414670b..e6292a636 100644 --- a/Completion/Unix/Command/_zsh +++ b/Completion/Unix/Command/_zsh @@ -1,9 +1,12 @@ #compdef zsh -local curcontext=$curcontext state state_descr line expl +local curcontext=$curcontext state state_descr line expl not='!' typeset -A opt_args +[[ $CURRENT = 2 ]] && not='' + _arguments -S -s : \ + ${not}'--emulate[specify emulation mode]:mode:(zsh sh ksh csh)' \ '*-o+[set named option]:option:_options' \ '*+o+[unset named option]:option:_options' \ '(1 -s --shinstdin)'{-s,--shinstdin}'[read commands from standard input]' \ diff --git a/Completion/Unix/Type/_diff_options b/Completion/Unix/Type/_diff_options index 55ddecd2a..4fd27442e 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 +local of ofwuc ouc oss ofwy ofwg ofwl cmd variant local -a args cmd="$1" @@ -25,16 +25,16 @@ _diff_palette() { return ret } -if _pick_variant -c $cmd gnu=GNU unix -v; then +if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12->.* ]]; then # 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 \ --unchanged-group-format --line-format --old-line-format --new-line-format \ - --unchanged-line-format --normal -D --ifdef" + --unchanged-line-format -D --ifdef" # output formats w/o unified and context ofwuc="-y --side-by-side -n --rcs -e -f --ed -q --brief --old-group-format \ - --new-group-format --changed-group-format --unchanged-group-format --normal \ + --new-group-format --changed-group-format --unchanged-group-format \ --line-format --old-line-format --new-line-format --unchanged-line-format \ -D --ifdef" @@ -48,26 +48,50 @@ if _pick_variant -c $cmd gnu=GNU unix -v; then ofwy="-n --rcs -e -f --ed -q --brief -c -C --context -u -U --unified \ --old-group-format --new-group-format --changed-group-format \ --unchanged-group-format --line-format --old-line-format \ - --new-line-format --unchanged-line-format --normal -D --ifdef" + --new-line-format --unchanged-line-format -D --ifdef" # output formats w/o group format - ofwg="-n --rcs -e -f --ed -q --brief -c -C --context -u -U --unified --normal \ + ofwg="-n --rcs -e -f --ed -q --brief -c -C --context -u -U --unified \ --line-format --old-line-format --new-line-format --unchanged-line-format -D --ifdef" # output formats w/o line format ofwl="-n --rcs -e -f --ed -q --brief -c -C --context -u -U --unified \ - --old-group-format --new-group-format --changed-group-format --normal \ + --old-group-format --new-group-format --changed-group-format \ --unchanged-group-format" - _arguments -s \ + 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 --width -W)"{--width=,-W+}'[set size of line]:number of characters per line' + "($ofwy $ouc)--left-column[output only left column of common lines]" + "($ofwy $ouc)--suppress-common-lines[do not output 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' \ + '--color=-[use colors in output]::when [auto]:(never always auto)' + '--palette=[specify colors to use]:color:_diff_palette' + "($of $ouc)--side-by-side[output in two columns]" + "($of $ouc)-y[output in two columns]" + ) + else + args+=( '!--speed-large-files' ) + fi + + _arguments -s $args \ '(-i --ignore-case)'{-i,--ignore-case}'[case insensitive]' \ - '(--no-ignore-file-name-case)--ignore-file-name-case[ignore case when comparing file names]' \ - '(--ignore-file-name-case)--no-ignore-file-name-case[consider case when comparing file names]' \ - '(-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]' \ + '--ignore-file-name-case[ignore case when comparing file names]' \ + '!(--ignore-file-name-case)--no-ignore-file-name-case' \ '(-b --ignore-space-change)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \ - '(--ignore-all-space -w)'{--ignore-all-space,-w}'[ignore all white space]' \ '(-B --ignore-blank-lines)'{-B,--ignore-blank-lines}'[ignore lines that are all blank]' \ '(-I --ignore-matching-lines)'{-I+,--ignore-matching-lines=}'[ignore lines that match regex]:line exclusion regex:' \ '--strip-trailing-cr[strip trailing carriage return on input]' \ @@ -78,30 +102,18 @@ if _pick_variant -c $cmd gnu=GNU unix -v; then "($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)--brief[output only whether files differ]" \ - "($of $ouc $oss)-q[output only whether files differ]" \ + "($of $ouc $oss)"{-q,--brief}'[output only whether files differ]' \ "($of $ouc $oss -e --ed)"{--ed,-e}'[output an ed script]' \ - "($of $ouc $oss)--normal[output a normal diff]" \ - "($of $ouc $oss)--forward-ed[output a reversed ed script]" \ - "($of $ouc $oss)-f[output a reversed ed script]" \ - "($of $ouc $oss)--rcs[RCS format diff]" \ - "($of $ouc $oss)-n[RCS format diff]" \ - "($of $ouc)--side-by-side[output in two columns]" \ - "($of $ouc)-y[output in two columns]" \ - "($ofwy $ouc --width -W)"{--width=,-W+}'[set size of line]:number of characters per line' \ - "($ofwy $ouc)--left-column[output only left column of common lines]" \ - "($ofwy $ouc)--suppress-common-lines[do not output common lines]" \ - "($of $oss)"{-D,--ifdef=}'[output merged file with preprocessor directives]:preprocessor symbol' \ - "($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" \ + "!($of $ouc $oss)--normal" \ + "($of $ouc $oss)"{-f,--forward-ed}'[output a reversed ed script]' \ + "($of $ouc $oss)"{-n,--rcs}'[output an RCS format diff]' \ + "($of $oss)"{-D+,--ifdef=}'[output merged file with preprocessor directives]:preprocessor symbol' \ "($ofwg $ouc $oss)--changed-group-format=[set changed group format]:changed group format" \ "($ofwg $ouc $oss)--unchanged-group-format=[set unchanged group format]:unchanged group format" \ "($ofwl $ouc $oss)--line-format=[set line format]:line format" \ "($ofwl $ouc $oss)--old-line-format=[set old line format]:old line format" \ "($ofwl $ouc $oss)--new-line-format=[set new line format]:new line format" \ - "($ofwl $ouc $oss)--unchanged-line-format=[set unchanged line format]:unchanged line format" \ - '(-l --paginate)'{-l,--paginate}'[output through pr]' \ + '(-l --paginate)'{-l,--paginate}'[long output format (paginate with pr(1))]' \ '(-t --expand-tabs)'{-t,--expand-tabs}'[expand tabs to spaces]' \ '(-T --initial-tab)'{-T,--initial-tab}'[prepend a tab]' \ '--tabsize=[specify width of tab]:width [8]' \ @@ -111,66 +123,55 @@ if _pick_variant -c $cmd gnu=GNU unix -v; then '(-P --unidirectional-new-file)'{-P,--unidirectional-new-file}'[treat absent first files as empty]' \ '(-s --report-identical-files)'{-s,--report-identical-files}'[report when two files are the same]' \ \*{-x+,--exclude=}'[exclude files matching pattern]:exclusion pattern' \ - '(-X --exclude-from)'{-X+,--exclude-from=}'[exclude files matching pattern in file]:exclude file:_files' \ + \*{-X+,--exclude-from=}'[exclude files matching pattern in file]:exclude file:_files' \ '(-S --starting-file)'{-S+,--starting-file=}'[set first file in comparison]:start with 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' \ '--horizon-lines=[set number of lines to keep in prefix and suffix]:number of horizon lines' \ '(-d --minimal)'{-d,--minimal}'[try to find a smaller set of changes]' \ - '(-H --speed-large-files)'{-H,--speed-large-files}'[assume large files and many small changes]' \ - '--color=-[use colors in output]::when [auto]:(never always auto)' \ - '--palette=[specify colors to use]:color:_diff_palette' \ - '(-v --version)'{-v,--version}'[display version info]' \ - '--help[display help info]' \ "$@" else of='-c -e -f' case $OSTYPE in - solaris2.<9->) + openbsd*|solaris2.<9->) of+=' -u -U' - args=( + args+=( "($of)-u[output a unified diff]" - "($of)-U[output a unified diff]:lines of context" + "($of)-U+[output a unified diff]:lines of context" ) - ;& - solaris*) - of+=' -C -h -n -D' + ;| + openbsd*|solaris*) args+=( + "($of)-C+[output a context diff]:lines of context" + "($of)-D+[output merged file with preprocessor directives]:preprocessor symbol" '-i[case insensitive]' - '-t[expand tabs to spaces]' + '-l[long output format (paginate with pr(1))]' + '-s[report on identical files]' + '-t[expand tabs in output lines]' + ) + ;| + solaris*) + of+=' -h -n' + args+=( '-w[ignore all white space]' - "($of)-C+[output a context diff]:lines of context" "($of)-h[do a fast, half-hearted job]" - "($of)-n[reversed ed script]" - "($of)-D[output merged file with preprocessor directives]:preprocessor symbol" - '-l[output through pr]' - '-s[report on identical files]' + "($of)-n[output a reversed ed script]" '-S+[set first file in comparison]:start with file:_files' ) ;; openbsd*) of+=' -n -q -u -C -D -U' args=( - "($of)-n[produce an rcsdiff(1)-compatible diff]" + "($of)-n[output an rcsdiff(1)-compatible diff]" "($of)-q[only print a line when the files differ; does not produce a list of changes]" - "($of)-u[produce a unified diff with 3 lines of context]" - "($of)-C+[produce a context diff]:number of lines of context" - "($of)-D[produce a merged file with preprocessor directives]:preprocessor symbol" - "($of)-U+[produce a unified diff]:number of lines of context" '-a[treat all files as ASCII text]' '-d[try to produce the smallest diff possible]' '-I[ignore changes whose lines match the extended regular expression]:extended regular expression pattern' - '-i[ignore case]' '*-L[print a label instead of the file name and time]:label' - '-l[long output format (paginate with pr(1))]' '-p[show characters from the last line before the context]' '-T[consistently align tabs]' - '-t[expand tabs in output lines]' '-w[like -b, but totally ignore whitespace]' '-N[treat absent files in either directory as if they were empty]' '-P[treat absent files in the second directory as if they were empty]' '-S[start a directory diff from a file name]:file name:_files' - '-s[report files that are the same]' '*-X[exclude files and subdirectories whose basenames match lines in a file]:file name:_files' '-x[exclude files and subdirectories whose basenames match a pattern]:pattern' ) diff --git a/Completion/Unix/Type/_umountable b/Completion/Unix/Type/_umountable index 2b2567478..7ffce5bb4 100644 --- a/Completion/Unix/Type/_umountable +++ b/Completion/Unix/Type/_umountable @@ -41,4 +41,4 @@ dev_tmp=( "${(@)dev_tmp:#/*}" ) _alternative \ 'device-labels:device label:compadd -a dev_tmp' \ 'device-paths: device path:_canonical_paths -A dpath_tmp -N -M "r:|/=* r:|=*" device-paths device\ path' \ - 'directories:mount point:_canonical_paths -A mp_tmp -N -M "r:|/=* r:|=*" directories mount\ point' && ret=0 + 'directories:mount point:_canonical_paths -A mp_tmp -N -M "r:|/=* r:|=*" directories mount\ point' |