From 22c0fe02a53bedb03f6aef5d0e476bbadc655995 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 12 Jan 2020 22:29:27 +0000 Subject: 45288: _git: Complete bisect/new as well as bisect/bad. Also, complete the bisect/old-$commithash ref names. --- Completion/Unix/Command/_git | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index be0c810cc..fa3d99f2f 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -6702,14 +6702,12 @@ __git_heads_local () { local f gitdir declare -a heads - heads=(${(f)"$(_call_program headrefs git for-each-ref --format='"%(refname:short)"' refs/heads 2>/dev/null)"}) + heads=(${(f)"$(_call_program headrefs git for-each-ref --format='"%(refname:short)"' refs/heads refs/bisect refs/stash 2>/dev/null)"}) gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) if __git_command_successful $pipestatus; then for f in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do [[ -f $gitdir/$f ]] && heads+=$f done - [[ -f $gitdir/refs/stash ]] && heads+=stash - [[ -f $gitdir/refs/bisect/bad ]] && heads+=bisect/bad fi __git_describe_commit heads heads-local "local head" "$@" -- cgit v1.2.3 From bcd78756c8d55b1bab3a9f6fa79eb58782d3000e Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 16 Jan 2020 16:42:20 +0000 Subject: 45313: _git: Support completion from outside of a worktree when --git-dir/--work-tree are specified on the command line Revised version of workers/41523. --- ChangeLog | 6 ++++++ Completion/Unix/Command/_git | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 675342647..8285bc49c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-01-17 Daniel Shahaf + + * 45313: Completion/Unix/Command/_git: Support completion from + outside of a worktree when --git-dir/--work-tree are specified + on the command line + 2020-01-16 Daniel Shahaf * 45304: Src/loop.c, Test/A01grammar.ztst: Do execute the always diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 8e0d57789..92b72b936 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -7075,21 +7075,23 @@ __git_files_relative () { (( $+functions[__git_files] )) || __git_files () { - local compadd_opts opts tag description gitcdup gitprefix files expl + local compadd_opts opts tag description gittoplevel gitprefix files expl zparseopts -D -E -a compadd_opts V+: J+: 1 2 o+: n f x+: X+: M+: P: S: r: R: q F: zparseopts -D -E -a opts -- -cached -deleted -modified -others -ignored -unmerged -killed x+: --exclude+: tag=$1 description=$2; shift 2 - gitcdup=$(_call_program gitcdup git rev-parse --show-cdup 2>/dev/null) + gittoplevel=$(_call_program toplevel git rev-parse --show-toplevel 2>/dev/null) __git_command_successful $pipestatus || return 1 + [[ -n $gittoplevel ]] && gittoplevel+="/" gitprefix=$(_call_program gitprefix git rev-parse --show-prefix 2>/dev/null) __git_command_successful $pipestatus || return 1 # TODO: --directory should probably be added to $opts when --others is given. - local pref=$gitcdup$gitprefix$PREFIX + local pref=${(Q)${~PREFIX}} + [[ $pref[1] == '/' ]] || pref=$gittoplevel$gitprefix$pref # First allow ls-files to pattern-match in case of remote repository files=(${(0)"$(_call_program files git ls-files -z --exclude-standard ${(q)opts} -- ${(q)${pref:+$pref\*}:-.} 2>/dev/null)"}) @@ -8131,7 +8133,8 @@ _git() { ;; (option-or-argument) curcontext=${curcontext%:*:*}:git-$words[1]: - (( $+opt_args[--git-dir] )) && local -x GIT_DIR=$opt_args[--git-dir] + (( $+opt_args[--git-dir] )) && local -x GIT_DIR=${(Q)${~opt_args[--git-dir]}} + (( $+opt_args[--work-tree] )) && local -x GIT_WORK_TREE=${(Q)${~opt_args[--work-tree]}} if ! _call_function ret _git-$words[1]; then if [[ $words[1] = \!* ]]; then words[1]=${words[1]##\!} -- cgit v1.2.3 From 359e0dae2bded75eebf7fe3b3cf919e1dd44c333 Mon Sep 17 00:00:00 2001 From: dana Date: Wed, 11 Mar 2020 16:26:41 -0500 Subject: 45424: completion: Add **/sbin to PATH when completing commands like sudo * Update _command_names to add **/sbin to PATH when not otherwise overridden and _comp_priv_prefix is set. This ensures that, on systems where unprivileged users don't have **/sbin in their PATHs, we can still complete those commands when they try to run them with e.g. sudo * Update functions for privilege-gaining commands to use the aforementioned mechanism * Fix some other minor issues in _pfexec and _doas Changes from the posted diff: * Fix a minor redundancy in _doas * Add _c_p_p=( '' ) hack to _su --- ChangeLog | 7 +++++++ Completion/Solaris/Command/_pfexec | 12 ++++++++---- Completion/Unix/Command/_doas | 21 +++++++++++---------- Completion/Unix/Command/_su | 6 ++++++ Completion/Unix/Command/_sudo | 14 +++++++++----- Completion/Zsh/Type/_command_names | 19 ++++++++++++++++--- 6 files changed, 57 insertions(+), 22 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 56934bc46..ed2a63b00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2020-03-11 dana + + * 45424 (tweaked): Completion/Solaris/Command/_pfexec, + Completion/Unix/Command/_doas, Completion/Unix/Command/_su, + Completion/Unix/Command/_sudo, Completion/Zsh/Type/_command_names: + Add **/sbin to PATH when completing commands like sudo + 2020-03-10 Romain Porte * 45524: Completion/Debian/Command/_dscverify: Add completion diff --git a/Completion/Solaris/Command/_pfexec b/Completion/Solaris/Command/_pfexec index 2519c3cdc..e90f33222 100644 --- a/Completion/Solaris/Command/_pfexec +++ b/Completion/Solaris/Command/_pfexec @@ -22,11 +22,15 @@ _privset() { } _pfexec() { + local cmd cpp local -a _comp_priv_prefix - _arguments \ - '-P[privileges to acquire]:privspec:_privset' \ - '(-):command name: _command_names -e' \ - '*::arguments:{ _comp_priv_prefix=( pfexec ${(kv)opt_args[-P]} ) ; _normal }' + local -A opt_args + cmd="$words[1]" + cpp='_comp_priv_prefix=( $cmd ${(kv)opt_args[(I)-P]} )' + _arguments \ + '-P+[privileges to acquire]:privspec:_privset' \ + "(-): :{ $cpp; _command_names -e }" \ + "*:: :{ $cpp; _normal }" } _pfexec "$@" diff --git a/Completion/Unix/Command/_doas b/Completion/Unix/Command/_doas index 94395557c..3ef036a88 100644 --- a/Completion/Unix/Command/_doas +++ b/Completion/Unix/Command/_doas @@ -1,7 +1,8 @@ #compdef doas -local environ e cmd +local environ e cmd cpp local -a _comp_priv_prefix +local -A opt_args zstyle -a ":completion:${curcontext}:" environ environ @@ -10,13 +11,13 @@ do local -x "$e" done cmd="$words[1]" +cpp='_comp_priv_prefix=( $cmd -n ${(kv)opt_args[(I)-u]} )' _arguments -s -S -A '-*' : \ - - optL \ - '-L[clear any persisted authorizations]' \ - - default \ - '-a+[specify authentication style]:authentication style' \ - '(-n -s)-C+[check config file and report on command matching]:config:_files' \ - '(-C)-n[non-interactive: fail rather than prompt for a password]' \ - '(-C *)-s[run a shell]' \ - '-u+[run command as specified user]:user:_users' \ - '*::arguments:{ _comp_priv_prefix=( $cmd -n ${(kv)opt_args[-u]} ) ; _normal }' + '(: * -)-L[clear any persisted authorizations]' \ + '(-L)-a+[specify authentication style]:authentication style' \ + '(-L -n -s)-C+[check config file and report on command matching]:config:_files' \ + '(-C -L)-n[non-interactive: fail rather than prompt for a password]' \ + '(-C -L *)-s[run a shell]' \ + '(-L)-u+[run command as specified user]: :_users' \ + "(-)1: :{ $cpp; _command_names -e }" \ + "*:: :{ $cpp; _normal }" diff --git a/Completion/Unix/Command/_su b/Completion/Unix/Command/_su index 032f867f4..066f5c3b6 100644 --- a/Completion/Unix/Command/_su +++ b/Completion/Unix/Command/_su @@ -63,6 +63,12 @@ if (( $words[(i)-] < CURRENT )); then norm=2 fi +# This is set so that _command_names will understand that we're completing for +# a privileged command, but _call_program won't actually prepend anything to +# commands if gain-privileges is enabled (which would be undesirable here since +# su always prompts for a password). We delay setting it until this point so it +# doesn't cause issues for the check above +local -a _comp_priv_prefix=( '' ) _arguments $args ${(e)first} "*:shell arguments:= ->rest" && return usr=${${(Q)line[norm]}/--/root} diff --git a/Completion/Unix/Command/_sudo b/Completion/Unix/Command/_sudo index 41e32cbae..e3d12d72f 100644 --- a/Completion/Unix/Command/_sudo +++ b/Completion/Unix/Command/_sudo @@ -2,9 +2,9 @@ setopt localoptions extended_glob -local environ e cmd -local -a args -local -a _comp_priv_prefix +local environ e cmd cpp +local -a args _comp_priv_prefix +local -A opt_args zstyle -a ":completion:${curcontext}:" environ environ @@ -42,6 +42,10 @@ if [[ $service = sudoedit ]] || (( $words[(i)-e] < $words[(i)^(*sudo|-[^-]*)] )) args=( -A "-*" $args '!(-V --version -h --help)-e' '*:file:_files' ) else cmd="$words[1]" + cpp='_comp_priv_prefix=( + $cmd -n + ${(kv)opt_args[(I)(-[ugHEP]|--(user|group|set-home|preserve-env|preserve-groups))]} + )' args+=( '(-e --edit 1 *)'{-e,--edit}'[edit files instead of running a command]' \ '(-s --shell)'{-s,--shell}'[run shell as the target user; a command may also be specified]' \ @@ -51,8 +55,8 @@ else '(-E -i --login -s --shell -e --edit)--preserve-env=-[preserve user environment when running command]::environment variable:_sequence _parameters -g "*export*"' \ '(-H --set-home -i --login -s --shell -e --edit)'{-H,--set-home}"[set HOME variable to target user's home dir]" \ '(-P --preserve-groups -i -login -s --shell -e --edit)'{-P,--preserve-groups}"[preserve group vector instead of setting to target's]" \ - '(-)1:command: _command_names -e' - '*::arguments:{ _comp_priv_prefix=( $cmd -n ${(kv)opt_args[(I)(-[ugHEP]|--(user|group|set-home|preserve-env|preserve-groups))]} ) ; _normal }' + "(-)1: :{ $cpp; _command_names -e }" + "*:: :{ $cpp; _normal }" ) fi diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names index cd630b7a4..b1c35f013 100644 --- a/Completion/Zsh/Type/_command_names +++ b/Completion/Zsh/Type/_command_names @@ -41,11 +41,24 @@ fi args=( "$@" ) local -a cmdpath -if zstyle -a ":completion:${curcontext}" command-path cmdpath && - [[ $#cmdpath -gt 0 ]] -then + +zstyle -a ":completion:${curcontext}" command-path cmdpath + +# Using the current PATH doesn't necessarily make sense when completing commands +# to tools like sudo, which might set a different one. A common issue is that +# /**/sbin appear in the PATH used by the tool, but not in the one used by the +# unprivileged user who calls it. To do the right thing in the most common +# cases, we'll simply ensure that the sbin variants always appear here when not +# otherwise overridden (bash-completion's _sudo does something similar) +if (( ! $#cmdpath && $#_comp_priv_prefix )); then + cmdpath=( $path ${path/%\/bin//sbin} ) + cmdpath=( ${(u)^cmdpath}(/-N) ) +fi + +if (( $#cmdpath )); then local -a +h path local -A +h commands path=( $cmdpath ) fi + _alternative -O args "$defs[@]" -- cgit v1.2.3 From 3f7b81e24e62d51b1af794c536bb6a97f5237625 Mon Sep 17 00:00:00 2001 From: dana Date: Fri, 13 Mar 2020 09:37:37 -0500 Subject: 45531: _sh: Complete options more accurately Committing without handling of +x option variants (line 10) pending resolution of workers/45422 --- ChangeLog | 3 +++ Completion/Unix/Command/_sh | 46 +++++++++++++++++++++++++++++++++------------ 2 files changed, 37 insertions(+), 12 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index ac59aa3e1..fddbe37c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2020-03-13 dana + * 45531: Completion/Unix/Command/_sh: Complete options more + accurately + * 45537 (tweaked per 45550, needs 45536): Test/E02xtrace.ztst: Fix inconsistent function-name encoding in preserves-xtrace test diff --git a/Completion/Unix/Command/_sh b/Completion/Unix/Command/_sh index 39d299c58..f0f18d4bb 100644 --- a/Completion/Unix/Command/_sh +++ b/Completion/Unix/Command/_sh @@ -1,14 +1,36 @@ #compdef sh ash csh dash ksh ksh88 ksh93 mksh oksh pdksh rc tcsh yash -if (( CURRENT == ${words[(i)-c]} + 1 )); then - _cmdstring -else - local n=${words[(b:2:i)[^-]*]} - if (( n <= CURRENT )); then - compset -n $n - _alternative \ - 'files:file:_files' \ - 'commands:command:_normal' && return 0 - fi - _default -fi +local bourne argv0 +local -a args all_opts=( -{{0..9},{A..Z},{a..z}} ) + +[[ $service == (csh|?csh|fish|rc) ]] || bourne=1 + +# Bourne-style shells support +x variants +# @todo Uncomment when workers/45422 is fixed +# (( bourne )) && all_opts+=( ${all_opts/#-/+} ) +# Bourne-style shells take argv[0] as the second argument to -c +(( bourne )) && argv0=':argv[0]:' + +# All of the recognised shells support at least these arguments +args=( + "(1 -)-c[execute specified command string]: :_cmdstring$argv0" + '-e[exit immediately on non-zero return]' + '-i[act as interactive shell]' + '-l[act as login shell]' + '-x[print command trace]' + '1:script file:_files' + '*:: :_files' +) +# Bourne-style shells support -o/+o option. Not all of them support -ooption in +# the same argument, but we'll allow it here for those that do +(( bourne )) && args+=( + '-o+[set specified option]:option:' + '+o+[unset specified option]:option:' +) +# Since this is a generic function we don't know what other options these shells +# support, but we don't want them to break the ones listed above, so we'll just +# ignore any other single-alphanumeric option. Obviously this doesn't account +# for long options +args+=( '!'${^${all_opts:#(${(~j<|>)${(@M)${(@M)args#(*[\*\)]|)[+-]?}%[+-]?}})}} ) + +_arguments -s -S -A '-*' : $args -- cgit v1.2.3 From cb7aadfd2a8b46b7eff4b615867183ecbdf08ac4 Mon Sep 17 00:00:00 2001 From: dana Date: Fri, 13 Mar 2020 09:34:52 -0500 Subject: 45535: _lz4: Order compression levels numerically --- ChangeLog | 3 +++ Completion/Unix/Command/_lz4 | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 39afdc7e3..2c96d98b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2020-03-13 dana + * 45535: Completion/Unix/Command/_lz4: Order compression levels + numerically + * 45534: Completion/Darwin/Command/_hdiutil: Update image-file extensions, image/disk formats, &c. diff --git a/Completion/Unix/Command/_lz4 b/Completion/Unix/Command/_lz4 index 2697c4d11..6676943c4 100644 --- a/Completion/Unix/Command/_lz4 +++ b/Completion/Unix/Command/_lz4 @@ -42,8 +42,8 @@ args=( '(b t -k --keep)--rm[remove source file]' '!(b t -c --stdout)--to-stdout' + b # Benchmark-mode options - "(C c d t)-b-[benchmark file using specified compression level]::compression level:(${(j< >)levels//-/})" - "(C c d t)-e-[specify upper compression level limit (with -b)]:compression level:(${(j< >)levels//-/})" + "(C c d t)-b-[benchmark file using specified compression level]:: :->levels" + "(C c d t)-e-[specify upper compression level limit (with -b)]: :->levels" '(C c d t)-i-[specify minimum evaluation time (with -b)]:evaluation time (seconds)' + c # Compress-mode options "(b d t ${(j< >)levels} -c0 -c1 -c2 -hc)"${^levels} @@ -98,6 +98,11 @@ case $state in _message 'no more arguments' && ret=0 fi ;; + levels) + _wanted levels expl 'compression level' \ + compadd -o numeric - ${levels/#-/} \ + && ret=0 + ;; esac return ret -- cgit v1.2.3 From 754658aff38e1bdf487c58bec6174cbecd019d11 Mon Sep 17 00:00:00 2001 From: dana Date: Fri, 13 Mar 2020 09:46:14 -0500 Subject: unposted: _git: Fix copy/paste error in earlier commit that broke `git stash drop` This was broken by workers/44923 (8aa84bd5fc44) --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 2c96d98b3..6fdaccb7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2020-03-13 dana + * unposted: Completion/Unix/Command/_git: Fix copy/paste error + in earlier commit that broke `git stash drop` + * 45535: Completion/Unix/Command/_lz4: Order compression levels numerically diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 8487ebc1a..9a44ddbbe 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1809,7 +1809,7 @@ _git-stash () { _nothing ;; (drop) - _arguments -S $endopt \_git-notes + _arguments -S $endopt \ '(-q --quiet)'{-q,--quiet}'[suppress all output]' \ ':: :__git_stashes' && ret=0 ;; -- cgit v1.2.3 From 174aedcf7f3db9a7838de5891e95ab41f2373db4 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 26 Mar 2020 00:53:30 +0000 Subject: 45622: _quilt: Categorize subcommands --- ChangeLog | 2 ++ Completion/Unix/Command/_quilt | 41 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 4 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index b82f1a070..147344812 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2020-03-26 Daniel Shahaf + * 45622: Completion/Unix/Command/_quilt: Categorize subcommands + * 45584, 45620: Test/B12limit.ztst: zsh/rlimits: Skip the tests for this module when it wasn't compiled in. diff --git a/Completion/Unix/Command/_quilt b/Completion/Unix/Command/_quilt index 76dda222f..d086da715 100644 --- a/Completion/Unix/Command/_quilt +++ b/Completion/Unix/Command/_quilt @@ -6,6 +6,8 @@ local verbose='(-h)-v[verbose, more user friendly output]' local color='(-h)--color=[use syntax coloring]:color:(always auto never)' local pstyle='(-h)-p+[select patch style]:patch style:((0\:exclude\ top-level\ directory 1\:use\ .orig\ on\ top-level\ directory ab\:use\ a\ or\ b\ as\ top-level\ directory))' local -a pform rcfile +local k + pform=( '(-U -c -C -h)-u[create a unified diff]' '(-u -c -C -h)-U+[create a unified diff with num lines of context]:lines' @@ -36,12 +38,43 @@ _arguments $help \ '--trace[run the command in bash trace mode]' \ '--quiltrc=[use the specified configuration file]:files:_files' \ '--version[print the version number and exit]' \ - ':quilt command:(add annotate applied delete diff edit files fold fork graph - grep header import mail new next patches pop previous push refresh remove - rename revert series setup snapshot top unapplied upgrade)' \ + ':quilt command:->cmd' \ '*:: :->subcmd' && return -[[ -z $state ]] && return 1 +case $state in + ('') + return 1 + ;; + + (cmd) + # Divide the subcommands to categories. The categorization is our own; + # it's not based on any preexisting categorization in the quilt docs. + local -a manip=( add delete edit fold fork import new refresh remove rename ) + local -a tree=( pop push revert ) + local -a other=( grep header mail setup snapshot upgrade ) + local -a interrogate=( annotate applied diff files graph next patches previous series top unapplied ) + local -A cmdtypes=( + [manip]='series manipulator commands' + [tree]='tree manipulator commands' + [other]='other commands' + [interrogate]='series interrogator commands' + ) + local -a expl=( ) + local ret=1 + _tags ${cmdtypes// /-} + while _tags; do + for k in ${(ok)cmdtypes}; do + _requested ${cmdtypes[$k]// /-} expl ${cmdtypes[$k]} \ + compadd -a - $k && ret=0 + done + done + return ret + ;; + + (subcmd) + ;; +esac + rcfile=( ${opt_args[--quiltrc]:+--quiltrc=${opt_args[--quiltrc]}} ) case $words[1] in add) -- cgit v1.2.3 From 36df1e4f78319072aa5e1fcf52789c68c9164cae Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 26 Mar 2020 00:53:31 +0000 Subject: 45623: _quilt: Add subcommand descriptions --- ChangeLog | 3 +++ Completion/Unix/Command/_quilt | 50 ++++++++++++++++++++++++++++++++++++------ 2 files changed, 46 insertions(+), 7 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 147344812..f53433443 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2020-03-26 Daniel Shahaf + * 45623: Completion/Unix/Command/_quilt: Add subcommand + descriptions + * 45622: Completion/Unix/Command/_quilt: Categorize subcommands * 45584, 45620: Test/B12limit.ztst: zsh/rlimits: Skip the tests diff --git a/Completion/Unix/Command/_quilt b/Completion/Unix/Command/_quilt index d086da715..8167bce1e 100644 --- a/Completion/Unix/Command/_quilt +++ b/Completion/Unix/Command/_quilt @@ -49,23 +49,59 @@ case $state in (cmd) # Divide the subcommands to categories. The categorization is our own; # it's not based on any preexisting categorization in the quilt docs. - local -a manip=( add delete edit fold fork import new refresh remove rename ) - local -a tree=( pop push revert ) - local -a other=( grep header mail setup snapshot upgrade ) - local -a interrogate=( annotate applied diff files graph next patches previous series top unapplied ) + local -a manip=( + add:'add files to a patch' + delete:'remove a patch from the series' + edit:'add files to the topmost patch and open them in $EDITOR' + fold:'integrate an external patch into the topmost patch' + fork:'replace the topmost patch with a copy' + import:'add external patches to the series' + new:'add an empty patch to the series' + refresh:'update a patch with in-tree edits' + remove:'remove files from a given patch' + rename:"change a patch's name" + ) + local -a tree=( + pop:'unapply a patch to the tree' + push:'apply a patch to the tree' + revert:'discard in-tree changes to files in a given patch' + ) + local -a other=( + grep:'print file lines matching pattern' + header:"print or change a patch's prologue" + mail:'send patches by email' + setup:'initialize a source tree' + snapshot:'save a snapshot of the tree to diff against' + upgrade:'upgrade quilt metadata' + ) + local -a interrogate=( + annotate:'show which patches modify which lines' + applied:'print the list of patches up to a given patch' + diff:'print differences between files' + files:'print the list of files that a given patch changes' + graph:'generate a patches dependency graph' + next:'print the name of the patch that follows a given patch' + patches:'print the list of patches that touch a given file' + previous:'print the name of the patch that precedes a given patch' + series:'print the list of all patches' + top:'print the name of the last applied patch' + unapplied:'print the list of patches following a given patch' + ) local -A cmdtypes=( [manip]='series manipulator commands' [tree]='tree manipulator commands' [other]='other commands' [interrogate]='series interrogator commands' ) - local -a expl=( ) local ret=1 _tags ${cmdtypes// /-} while _tags; do for k in ${(ok)cmdtypes}; do - _requested ${cmdtypes[$k]// /-} expl ${cmdtypes[$k]} \ - compadd -a - $k && ret=0 + if _requested ${cmdtypes[$k]// /-} + then + _describe -t ${cmdtypes[$k]// /-} ${cmdtypes[$k]} $k && + ret=0 + fi done done return ret -- cgit v1.2.3 From f306221674af05422c9fd60410f2ab054e123255 Mon Sep 17 00:00:00 2001 From: Gastón Haro Date: Tue, 21 Jan 2020 21:39:29 -0300 Subject: github #46: Better restrict git-restore(1) file completions Add support to the -S and -W options. Remove the facility for completing files from the tree specified by the --source argument since, upon testing in git 2.26.0, that doesn't seem to be correct behaviour. (Note git-restore(1) says the command is experimental and its semantics may change.) See discussion on the PR for details. --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 57a397ce1..05d228d62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-03-28 Gastón Haro + + * github #46: Completion/Unix/Command/_git: Better restrict + git-restore(1) file completions + 2020-03-28 Daniel Shahaf * 45644: Functions/VCS_Info/Backends/VCS_INFO_get_data_git: diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 9a44ddbbe..15280db70 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1567,13 +1567,17 @@ _git-restore() { case $state in pathspecs) - if [[ -z ${opt_args[(I)-s|--source|-S|--staged]} ]] && - # use index as a default base unless -S is specified - __git_ignore_line __git_modified_files + integer opt_S opt_W + [[ -n ${opt_args[(I)-S|--staged]} ]] && opt_S=1 + [[ -n ${opt_args[(I)-W|--worktree]} ]] && opt_W=1 + if (( opt_S && opt_W )) then - ret=0 + __git_ignore_line __git_changed_files && ret=0 + elif (( opt_S )) + then + __git_ignore_line __git_changed-in-index_files && ret=0 else - __git_ignore_line __git_tree_files ${PREFIX:-.} ${(Qv)opt_args[(i)-s|--source]:-HEAD} && ret=0 + __git_ignore_line __git_changed-in-working-tree_files && ret=0 fi ;; sources) -- cgit v1.2.3 From a6610c4a17637cde780f9088273929071b742ef8 Mon Sep 17 00:00:00 2001 From: Gastón Haro Date: Sat, 28 Mar 2020 17:01:05 -0300 Subject: github #46: _git-restore: Complete arguments to the --source option after a '=' sign --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 05d228d62..943bfe1d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-03-28 Gastón Haro + + * github #46: Completion/Unix/Command/_git: _git-restore: + Complete arguments to the --source option after a '=' sign + 2020-03-28 Gastón Haro * github #46: Completion/Unix/Command/_git: Better restrict diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 15280db70..9eeff6a49 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1548,7 +1548,7 @@ _git-restore() { local -A opt_args _arguments -C -s -S $endopt \ - '(-s --source)'{-s,--source}'[specify which tree-ish to checkout from]:source tree:->sources' \ + '(-s --source)'{-s,--source=}'[specify which tree-ish to checkout from]:source tree:->sources' \ '(-S --staged)'{-S,--staged}'[restore the index]' \ '(-W --worktree)'{-W,--worktree}'[restore the working tree (default)]' \ '--ignore-unmerged[ignore unmerged entries]' \ -- cgit v1.2.3 From 83f7dc780661ca471ac70fc2b1d5aa6247c7c189 Mon Sep 17 00:00:00 2001 From: Henri Menke Date: Sun, 29 Mar 2020 17:07:31 +1300 Subject: 45646: completion: Unison: Honour the $UNISON variable By default Unison uses the ~/.unison directory to store its cache and profiles. However, this location is configurable through the $UNISON environment variable. Quoting from the manual [1]: > If the environment variable UNISON is defined, then its value will be > used as the name of this directory. This patch enables users to move the .unison directory and still enjoy zsh completion for profiles. [1] https://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#unisondir --- ChangeLog | 5 +++++ Completion/Unix/Command/_unison | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 943bfe1d4..72aba5023 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-03-29 Henri Menke + + * 45646: Completion/Unix/Command/_unison: completion: Unison: + Honour the $UNISON variable + 2020-03-28 Gastón Haro * github #46: Completion/Unix/Command/_git: _git-restore: diff --git a/Completion/Unix/Command/_unison b/Completion/Unix/Command/_unison index 2a3333742..d8cf7458f 100644 --- a/Completion/Unix/Command/_unison +++ b/Completion/Unix/Command/_unison @@ -86,7 +86,7 @@ _arguments \ if [[ $state == profile ]]; then local -a profiles - profiles=( ~/.unison/*.prf(N) ) + profiles=( ${UNISON:-~/.unison}/*.prf(N) ) (( $#profiles )) && \ - compadd "$@" - ${${profiles#~/.unison/}%.prf} + compadd "$@" - ${${profiles#${UNISON:-~/.unison}/}%.prf} fi -- cgit v1.2.3 From 51091e19cd581149c759fcea4f534abe877dd307 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 29 Mar 2020 20:20:49 +0000 Subject: 45649: completion: Simplify Unison completion. No functional change. --- ChangeLog | 5 +++++ Completion/Unix/Command/_unison | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 72aba5023..8dbbc573b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-03-29 Daniel Shahaf + + * 45649: Completion/Unix/Command/_unison: completion: Simplify + Unison completion. No functional change. + 2020-03-29 Henri Menke * 45646: Completion/Unix/Command/_unison: completion: Unison: diff --git a/Completion/Unix/Command/_unison b/Completion/Unix/Command/_unison index d8cf7458f..5963d66c6 100644 --- a/Completion/Unix/Command/_unison +++ b/Completion/Unix/Command/_unison @@ -84,9 +84,6 @@ _arguments \ '*:profile:->profile' if [[ $state == profile ]]; then - local -a profiles - - profiles=( ${UNISON:-~/.unison}/*.prf(N) ) - (( $#profiles )) && \ - compadd "$@" - ${${profiles#${UNISON:-~/.unison}/}%.prf} + local -a profiles=( ${UNISON:-~/.unison}/*.prf(N:t:r) ) + compadd "$@" -a profiles fi -- cgit v1.2.3 From 013c87e3f32f71fc6aa47186e41f0bb51f44af9a Mon Sep 17 00:00:00 2001 From: davey hathorn Date: Mon, 20 Apr 2020 21:42:37 -0700 Subject: github #54: Fix dig completion error --- ChangeLog | 5 +++++ Completion/Unix/Command/_dig | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 2877c86f6..c92e0c732 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-04-21 dana + + * github #54: davey hathorn: Completion/Unix/Command/_dig: + Fix dig completion error + 2020-04-20 dana * unposted: NEWS, README: Document zsh/system changes from diff --git a/Completion/Unix/Command/_dig b/Completion/Unix/Command/_dig index d2ffb0a33..5245a2964 100644 --- a/Completion/Unix/Command/_dig +++ b/Completion/Unix/Command/_dig @@ -89,7 +89,7 @@ if [[ -n $state ]]; then _wanted hosts expl 'DNS server' _hosts && ret=0; else case $#line in - <3->) alts+=( 'classes:query class:compadd -M "m\:{a-z}={A-Z}" - IN CS CH HS' ) ;& + <3->) alts+=( 'classes:query class:compadd -M "m:{a-z}={A-Z}" - IN CS CH HS' ) ;& 2) alts+=( 'types:query type:_dns_types' ) ;; esac _alternative 'hosts:host:_hosts' $alts && ret=0 -- cgit v1.2.3 From 071d7956e68585772df45293542e1e397c28ac8a Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 2 May 2020 00:47:13 +0000 Subject: 45752/0001: _gcc: Add .cpp and .hpp to the ignored extensions list. --- ChangeLog | 5 +++++ Completion/Unix/Command/_gcc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 66ea195d3..8c7ab6a28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-05-02 Daniel Shahaf + + * 45752/0001: Completion/Unix/Command/_gcc: Add .cpp and .hpp + to the ignored extensions list. + 2020-04-27 Benjamin Esham * github #56: Doc/Zsh/mod_zutil.yo: typo: Add a single quote diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index 9ec09200e..4e81247d4 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -390,7 +390,7 @@ languages=( # generic options (from --help) args+=( '-###[print commands to run this compilation]' - '-o:output file:_files -g "^*.(c|h|cc|C|cxx)(-.)"' + '-o:output file:_files -g "^*.(c|h|cc|C|cxx|cpp|hpp)(-.)"' '-x[Specify the language of the following input files]:input file language:('"$languages"')' '+e-:virtual function definitions in classes:((0\:only\ interface 1\:generate\ code))' '-d-:dump:->dump' -- cgit v1.2.3 From 57a3a9a746cf6138fac76bf307a761d5ee3013a2 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 2 May 2020 00:47:31 +0000 Subject: 45752/0002: _gcc: Complete --output like -o. --- ChangeLog | 3 +++ Completion/Unix/Command/_gcc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 8c7ab6a28..aba434c8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2020-05-02 Daniel Shahaf + * 45752/0002: Completion/Unix/Command/_gcc: Complete --output + like -o. + * 45752/0001: Completion/Unix/Command/_gcc: Add .cpp and .hpp to the ignored extensions list. diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index 4e81247d4..20b3abe59 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -1004,7 +1004,7 @@ args+=( '--help[Display this information]' '--no-warnings[Same as -w]' '--optimize[Same as -O]' - '--output[Same as -o]' + '--output:output file:_files -g "^*.(c|h|cc|C|cxx|cpp|hpp)(-.)"' '--param[Set parameter to value. See manpage for a complete list of parameters]:name=value' '--verbose[Same as -v]' '--version[Display version information]' -- cgit v1.2.3 From 8498f8864e1a8f6991bd99c8068991a706cde436 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 7 May 2020 22:22:36 +0000 Subject: unposted: Use alternation patterns rather than brace expansion (Cf. discussion on GitLab !12.) --- ChangeLog | 6 ++++++ Completion/Debian/Command/_dscverify | 4 ++-- Completion/Unix/Command/_pandoc | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index b26ff83d4..bddfae9c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-05-07 Daniel Shahaf + + * unposted: Completion/Debian/Command/_dscverify, + Completion/Unix/Command/_pandoc: Use alternation patterns rather + than brace expansion + 2020-05-05 Daniel Shahaf * 45764: Test/D07multibyte.ztst: Add a regression test for 45772. diff --git a/Completion/Debian/Command/_dscverify b/Completion/Debian/Command/_dscverify index 22ffc03b5..4d383c6c4 100644 --- a/Completion/Debian/Command/_dscverify +++ b/Completion/Debian/Command/_dscverify @@ -9,10 +9,10 @@ _dscverify() { '--help[show the help message and exit]' '--version[show the version + copyright and exit]' '--no-default-keyrings[do not check against the default keyrings]' - '*--keyring[add keyring to the list of keyrings used]:keyring:_files -g "*.{kbx,gpg}(-.)"' + '*--keyring[add keyring to the list of keyrings used]:keyring:_files -g "*.(kbx|gpg)(-.)"' '(--nosigcheck --no-sig-check -u)'{--nosigcheck,--no-sig-check,-u}'[do not verify the GPG signature]' '--verbose[do not suppress GPG output]' - '*:dsc file:_files -g "*.{changes,dsc,buildinfo}(-.)"' + '*:dsc file:_files -g "*.(changes|dsc|buildinfo)(-.)"' ) local first_only=( diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index 29d3724e0..0c0672aaa 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -391,7 +391,7 @@ _arguments -C \ '--epub-chapter-level=[specify the header level at which to split the EPUB into separate "chapter" files]:number:_pandoc_header_level' \ '--pdf-engine=[use the specified engine when producing PDF output]:program:_pandoc_pdf_engine' \ '*--pdf-engine-opt=[use the given string as a command-line argument to the pdf-engine]:string:_pandoc_pdf_engine_opts' \ - '*--bibliography=[set the bibliography field in the document'"'"'s metadata to FILE]:file:{_files -g "*.{bib,bibtex,copac,json,yaml,enl,xml,wos,medline,mods,ris}"}' \ + '*--bibliography=[set the bibliography field in the document'"'"'s metadata to FILE]:file:{_files -g "*.(bib|bibtex|copac|json|yaml|enl|xml|wos|medline|mods|ris)"}' \ '--csl=[set the csl field in the document'"'"'s metadata to FILE]:file:{_files -g "*.csl"}' \ '--citation-abbreviations=[set the citation-abbreviations field in the document'"'"'s metadata to FILE]:file:_files' \ '--natbib[use natbib for citations in LaTeX output]' \ -- cgit v1.2.3 From 53052335b920a7e62de409119e24291181b1ae86 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Sun, 17 May 2020 15:16:18 -0500 Subject: 45831: Add _vi completer --- ChangeLog | 4 ++++ Completion/Unix/Command/_vi | 47 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 Completion/Unix/Command/_vi (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 992b7b205..40ba349c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2020-05-17 Matthew Martin + + * 45831: Completion/Unix/Command/_vi: Add _vi completer. + 2020-05-16 Daniel Shahaf * users/24843: Doc/Zsh/compsys.yo: zshcompsys(1): Point to the diff --git a/Completion/Unix/Command/_vi b/Completion/Unix/Command/_vi new file mode 100644 index 000000000..6201299a2 --- /dev/null +++ b/Completion/Unix/Command/_vi @@ -0,0 +1,47 @@ +#compdef ex vi view + +local -a args + +if _pick_variant vim='(N|)VIM' vi --version; then + _vim + return +fi + +args=( + '-c+[execute command on the first file loaded]:command:' + '-r[recover the named files]' + '-t+[start editing at the specified tag]:tag:' + '-w+[set window size to specified number of lines]:lines:' + '*: :_files' +) + +[[ $service != view ]] && args+=( + '-R[set readonly]' +) + +[[ $service == ex ]] && args+=( + '-s[enter batch mode]' + '-v[start in vi mode]' +) + +case $OSTYPE in + *bsd*|dragonfly*) + args+=( + "-F[don't copy the entire file on start]" + '-S[set the secure option]' + ) + [[ $service != ex ]] && args+=( + '-e[start in ex mode]' + ) + ;| + netbsd*) + args+=( + '-G[start in gtags mode]' + ) + [[ $service == vi ]] && args+=( + '-l[set the lisp and showmatch options]' + ) + ;; +esac + +_arguments -s -S -A '-*' : $args -- cgit v1.2.3 From 911500d3be2a604176657028f8adfb9e4d3b42cd Mon Sep 17 00:00:00 2001 From: Yasuhiro KIMURA Date: Fri, 29 May 2020 06:36:47 +0900 Subject: 45934: _subversion: Make 'svnliteadmin' completed same as 'svnadmin' In FreeBSD base system svnadmin is installed as 'svnliteadmin'. So make 'svnliteadmin' completed same as 'svnadmin'. --- ChangeLog | 5 +++++ Completion/Unix/Command/_subversion | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 769fc1dae..f91fe53f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-05-28 Yasuhiro KIMURA + + * 45934: Completion/Unix/Command/_subversion: Make 'svnliteadmin' + completed same as 'svnadmin' + 2020-05-28 Daniel Shahaf * unposted: Util/zyodl.vim: Highlight the word "note", like diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index a1e9109de..26eef500f 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -1,4 +1,4 @@ -#compdef svn svnlite=svn svnadmin svnadmin-static=svnadmin +#compdef svn svnlite=svn svnadmin svnadmin-static=svnadmin svnliteadmin=svnadmin _svn () { local curcontext="$curcontext" state line expl ret=1 -- cgit v1.2.3 From 7ec05332a281ab0229a864bb4ccc4571e4f8ca1b Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Fri, 29 May 2020 22:25:08 -0500 Subject: 45939: Add _pgids type --- ChangeLog | 7 +++++++ Completion/Linux/Command/_ionice | 4 ++-- Completion/Unix/Command/_lsof | 2 +- Completion/Unix/Command/_pgrep | 2 +- Completion/Unix/Command/_renice | 2 +- Completion/Unix/Type/_pgids | 5 +++++ 6 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 Completion/Unix/Type/_pgids (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index b1d58021b..ac6ccc445 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2020-06-01 Matthew Martin + + * 45939: Completion/Linux/Command/_ionice, + Completion/Unix/Command/_lsof, Completion/Unix/Command/_pgrep, + Completion/Unix/Command/_renice, Completion/Unix/Type/_pgids: + Add _pgids type. + 2020-06-01 Doron Behar * gitlab !14: Completion/Linux/Command/_modutils: modutils diff --git a/Completion/Linux/Command/_ionice b/Completion/Linux/Command/_ionice index d64f1c496..ba403ca56 100644 --- a/Completion/Linux/Command/_ionice +++ b/Completion/Linux/Command/_ionice @@ -17,14 +17,14 @@ _arguments -C -s -S \ '(- *)'{-h,--help}'[display help information]' \ + '(args)' \ '(H)'{-p-,--pid=-}'[interpret args as process ID]::process id:_pids' \ - '(H)'{-P-,--pgid=-}'[specify process group IDs]::process group' \ + '(H)'{-P-,--pgid=-}'[specify process group IDs]::process group:_pgids' \ '(H)'{-u-,--uid=-}'[act on running process owned by specified users]::user id' && ret=0 if [[ -n $state ]]; then if (( $+opt_args[args--p] || $+opt_args[args---pid] )); then _pids && ret=0 elif (( $+opt_args[args--P] || $+opt_args[args---pgid] )); then - _message -e pgids 'process group' + _pgids && ret=0 elif (( $+opt_args[args--u] || $+opt_args[args---uid] )); then _message -e uids 'user id' else diff --git a/Completion/Unix/Command/_lsof b/Completion/Unix/Command/_lsof index 754012e3b..8afb55e1d 100644 --- a/Completion/Unix/Command/_lsof +++ b/Completion/Unix/Command/_lsof @@ -34,7 +34,7 @@ _arguments -C -s -S $args \ '-f[inhibit listing of kernel file structure info]::info type:->file-structures' \ '+f[enable listing of kernel file structure info]::info type:->file-structures' \ '-F[select output fields]:fields:->fields' \ - '-g[select by process group id]::process group id' \ + '-g[select by process group id]::process group id:_sequence -s , _pgids' \ '(*)*-i[select internet files]::address:->addresses' \ '-K+[select listing of tasks of processes]::value:((i\:ignore\ tasks))' \ '-k[specify kernel name list file]:kernel file:_files' \ diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index 3b4d082a7..3f00b21dc 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -149,7 +149,7 @@ case $state in _pgrep_sequence ppids 'parent process ID' ppid ;; (pgid) - _pgrep_sequence pgids 'process group ID' pgid + _sequence _pgids ;; (projid) _pgrep_sequence project-ids 'project ID' project diff --git a/Completion/Unix/Command/_renice b/Completion/Unix/Command/_renice index cbdac8cae..3b0457348 100644 --- a/Completion/Unix/Command/_renice +++ b/Completion/Unix/Command/_renice @@ -12,7 +12,7 @@ else _describe -o option opts && ret=0 case ${(v)words[(I)-?]} in - -g) _message -e pgids 'process group ID' && ret=0 ;; + -g) _pgids && ret=0 ;; -u) _users && ret=0 ;; *) _pids && ret=0;; esac diff --git a/Completion/Unix/Type/_pgids b/Completion/Unix/Type/_pgids new file mode 100644 index 000000000..25d0c4af0 --- /dev/null +++ b/Completion/Unix/Type/_pgids @@ -0,0 +1,5 @@ +#autoload + +local expl + +_wanted pgids expl 'process group ID' compadd "$@" - ${(un)$(_call_program pgids ps -A -o pgid=)} -- cgit v1.2.3 From 1939db10afe726c5e44ff88a6bd396a396eaa1f6 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Wed, 17 Jun 2020 09:59:58 -0400 Subject: 45982: _zfs: add space property --- ChangeLog | 5 +++++ Completion/Unix/Command/_zfs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index df931d194..908fd5cfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-06-17 Eric Cook + + * 45982: Frederick Zhang: Completion/Unix/Command/_zfs: + Add space read-only property + 2020-06-17 Daniel Shahaf * unposted: Util/ztst-syntax.vim: internal: ztst.vim: Recognize diff --git a/Completion/Unix/Command/_zfs b/Completion/Unix/Command/_zfs index 814358bc7..452e1160d 100644 --- a/Completion/Unix/Command/_zfs +++ b/Completion/Unix/Command/_zfs @@ -133,7 +133,7 @@ _zfs() { # TODO: userused@ and groupused@ could have more extensive handling ro_properties=( - "name" "type" "creation" "used" "available" "referenced" + "name" "type" "creation" "space" "used" "available" "referenced" "compressratio" "mounted" "origin" "usedbychildren" "usedbydataset" "usedbyrefreservation" "usedbysnapshots" "defer_destroy" "userused@" "userrefs" "groupused@" -- cgit v1.2.3 From 8bd46bf2a241e0e3a32a24ce2333095214b3b77a Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 19 Jun 2020 15:32:13 +0000 Subject: 46044 (tweaked per Matthew): _units: Correct the path to the units data file on Debian with units 2.00 and newer and on FreeBSD. --- ChangeLog | 6 ++++++ Completion/Unix/Command/_units | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 99e07370d..79fa9c085 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-06-19 Daniel Shahaf + + * 46044 (tweaked per Matthew): Completion/Unix/Command/_units: + Correct the path to the units data file on Debian with units + 2.00 and newer and on FreeBSD. + 2020-06-18 Daniel Shahaf * 46067: Test/A05execution.ztst: Add a unit test for diff --git a/Completion/Unix/Command/_units b/Completion/Unix/Command/_units index bea77ae67..6d86f4dc3 100644 --- a/Completion/Unix/Command/_units +++ b/Completion/Unix/Command/_units @@ -40,10 +40,12 @@ local -a testfiles testfiles=( /usr/share/units.dat # GNU on Fedora /usr/share/units/units.dat # on gentoo - /usr/share/misc/units.dat # on Debian + /usr/share/units/definitions.units # on Debian, units 2.00 and newer /usr/local/share/units.dat # GNU DIY install /usr/share/lib/unittab # Solaris - /usr/share/misc/units.lib # BSD + /usr/share/misc/units.lib # OpenBSD [as of 2020]; also FreeBSD 9.1 + /usr/share/misc/definitions.units # FreeBSD 12.1 + /usr/share/misc/units.dat # on Debian, units 1.88 and older ) datfile=${opt_args[-f]:-${opt_args[--file]}} -- cgit v1.2.3 From d14a924c37a60ae7b6c141d4cd575f7cbaa4ddee Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 26 Jun 2020 00:46:00 +0200 Subject: unposted c.f. 46034: workaround incompatibility with sh_file_expansion option --- ChangeLog | 3 +++ Completion/Unix/Command/_gpg | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 0e8a4ce8f..8ba6f1159 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2020-06-26 Oliver Kiddle + * unposted c.f. 46034: Completion/Unix/Command/_gpg: workaround + incompatibility with sh_file_expansion option + * 46106: Completion/BSD/Command/_usbconfig: new completion * 46105: Completion/X/Command/_xinput: new xinput completion diff --git a/Completion/Unix/Command/_gpg b/Completion/Unix/Command/_gpg index b35693d1f..5d54865d5 100644 --- a/Completion/Unix/Command/_gpg +++ b/Completion/Unix/Command/_gpg @@ -173,7 +173,7 @@ fi '--dump-options[show all options]' ) -extra=( ${${${args#\([^\)]#\)}#\*}%%[:=\[]*} ) +extra=( ${${${args#\([^\)]#\)}#\*}%%[=:\[]*} ) extra=( ${allopts:|extra} ) _arguments -C -s -S -A "-*" $args $extra '*:args:->args' && ret=0 -- cgit v1.2.3 From d839833e4e00ee320a353846eaa235ab952181f0 Mon Sep 17 00:00:00 2001 From: Miroslav Koškár Date: Sat, 27 Jun 2020 08:12:15 +0200 Subject: 46139: _git: Remove hanging whitespaces --- ChangeLog | 4 ++++ Completion/Unix/Command/_git | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 03fb6f9d9..7f6318919 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2020-06-27 Miroslav Koškár + + * 46139: Completion/Unix/Command/_git: Remove hanging whitespaces + 2020-06-27 Daniel Shahaf * unposted (after 46068): Src/Zle/zle_utils.c: Fix a compiler diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 9eeff6a49..fc754e7e5 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -2346,7 +2346,7 @@ __git_config_value () { # Helper to _git-config(). May be called by other functions, too, provided # that The caller has set $line, $state, and $opt_args as _git-config() would # set them: -# +# # - set $line[1] to the option name being completed (even if completing an # option value). # - set $opt_args to git-config(1) options, as set by _arguments in @@ -2916,7 +2916,7 @@ __git_config_option-or-value () { for key in $git_present_options ; do if (( ${+git_options[(r)(#i)${(b)key}:*]} )); then # $key is already in git_options - continue + continue elif (( ${+sections_that_permit_arbitrary_subsection_names[(r)${(b)key%%.*}]} )); then if [[ $key == *.*.* ]]; then # If $key isn't an instance of a known foo.*.bar:baz $git_options entry... -- cgit v1.2.3 From c74b3c89191e89ce946df149ac29b587fff92267 Mon Sep 17 00:00:00 2001 From: Miroslav Koškár Date: Sat, 27 Jun 2020 08:12:16 +0200 Subject: 46140: _git: Fix insufficiently quoted pattern --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 7f6318919..8b9155860 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2020-06-27 Miroslav Koškár + * 46140: Completion/Unix/Command/_git: Fix insufficiently + quoted pattern + * 46139: Completion/Unix/Command/_git: Remove hanging whitespaces 2020-06-27 Daniel Shahaf diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index fc754e7e5..602d0d008 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -8087,7 +8087,7 @@ _git() { local -A git_aliases local a k v local endopt='!(-)--end-of-options' - aliases=(${(0)"$(_call_program aliases git config -z --get-regexp '\^alias\.')"}) + aliases=(${(0)"$(_call_program aliases git config -z --get-regexp '\^alias\\.')"}) for a in ${aliases}; do k="${${a/$'\n'*}/alias.}" v="${a#*$'\n'}" -- cgit v1.2.3 From c1c1fb9b2c39757e210bd047ceee97d8d91ed3f8 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 26 Jun 2020 18:06:39 +0000 Subject: 46130: _git-config: Complete some more options. --- ChangeLog | 5 +++ Completion/Unix/Command/_git | 93 ++++++++++++++++++++++++++++++++------------ 2 files changed, 73 insertions(+), 25 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 8b9155860..b0193b2a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-06-28 Daniel Shahaf + + * 46130: Completion/Unix/Command/_git: _git-config: Complete + some more options. + 2020-06-27 Miroslav Koškár * 46140: Completion/Unix/Command/_git: Fix insufficiently diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 602d0d008..d8e1743b5 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -2387,12 +2387,15 @@ __git_config_option-or-value () { advice.nestedTag:'show advice if a user attempts to recursively tag a tag object::->bool:true' author.email:'email address used for author in commits::_email_addresses -c' author.name:'full name used for author in commits:name:->string' + am.threeWay:'use 3-way merge if patch does not apply cleanly::->bool:false' blame.blankboundary:'show blank SHA-1 for boundary commits::->bool:false' blame.coloring:'determine the coloring scheme to be applied to blame output:scheme [none]:->string' + blame.showEmail:"show author email instead of author name::->bool:false" blame.showroot:'show root commits as normal commits::->bool:false' blame.ignoreRevsFile:'ignore revisions listed in the file:file:_files' blame.date:'date format to use in output::__git_date_formats:iso' 'branch.*.description:branch description:branch description:->string' + branch.sort:"default sorting order for 'git branch' output::__git_ref_sort_keys" cvsexportcommit.cvsdir:'the default location of the CVS checkout to use for the export:cvs export dir:_directories' column.ui:'specify whether supported commands should output in columns.::->column:never' column.branch:'specify whether to output branch listing in git branch in columns::_git_column_layouts:never' @@ -2404,7 +2407,9 @@ __git_config_option-or-value () { core.fileMode:'track changes to the executable bit of files::->bool:true' core.attributesfile:'look into this file for attributes in addition to .gitattributes:additional attributes file:_files' core.abbrev:'set the length object names are abbreviated to:length:->int:7' + core.checkRoundtripEncoding:"encodings to UTF-8 round trip check::_guard '' 'comma-separated list of encodings'" # _guard used as a hack because _message doesn't take compadd options core.commentchar:'comment character when using an editor::->string' + core.filesRefLockTimeout:"how long to retry locking a reference:retry time (milliseconds, or -1 for indefinite):->int:100" core.ignoreCygwinFSTricks:'use Cygwin stat()/lstat()::->bool:true' core.ignorecase:'use workarounds for non-case-sensitive filesystems::->bool:false' core.trustctime:'trust inode change time::->bool:true' @@ -2426,6 +2431,7 @@ __git_config_option-or-value () { core.loosecompression:'level of compression to apply to non-pack files::->compression:1' core.packedGitWindowSize:'size of mappings of pack files:pack window size:->bytes' core.packedGitLimit:'maximum number of bytes to map from pack files:maximum pack file map size:->bytes' + core.packedRefsTimeout:"how long to retry locking the packed-refs file:retry time (milliseconds, or -1 for indefinite):->int:1000" core.precomposeunicode:'revert the unicode decomposition of filenames done by Mac OS::->bool:false' core.deltaBaseCacheLimit:'maximum size of cache for base objects:maximum base objects cache size:->bytes:96m' core.bigFileThreshold:'maximum size of files to compress:maximum compress size:->bytes:512m' @@ -2439,7 +2445,10 @@ __git_config_option-or-value () { core.createObject:'take steps to prevent overwriting existing objects::->core.createObject:link' core.checkstat:'determine which stat fields to match between the index and work tree::->core.checkstat:default' core.notesRef:'show notes in given refs:refs:->string:refs/notes/commits' + core.sparseCheckoutCone:"enable git-sparse-checkout(1) cone mode::->bool:false" core.sparseCheckout:'use sparse checkout::->bool:false' + core.splitIndex:"enable the split-index feature::->bool:false" + core.useReplaceRefs:"honour 'replace' refs::->bool:true" credential.helper:'external helper to be called when a username or password credential is needed::_cmdstring' credential.useHttpPath:'consider the "path" component of an http or https URL to be important::->bool:false' credential.username:'If no username is set use this username by default:default username:->string' @@ -2525,13 +2534,18 @@ __git_config_option-or-value () { 'diff.*.xfuncname:regular expression that the diff driver should use to recognize the hunk header:regular expression:->string' diff.algorithm:'default diff algorithm::->diff.algorithm:default' diff.autorefreshindex:'run git update-index --refresh before git diff::->bool:true' + diff.colorMoved:"color moved lines in diffs::__git_color_moved" + diff.colorMovedWS:"ignore whitespace when detecting moved lines::__git_color_movedws" + diff.wsErrorHighlight:'highlight whitespace errors: :__git_ws_error_highlight' diff.context:'default number of context lines::->int:3' diff.dirstat:'comma separated list of --dirstat parameters specifying default behaviour:comma-separated list:->string:changes,noncumulative,3' diff.external:'command to generate diff with:diff command:_cmdstring' + diff.indentHeuristic:"heuristically shift hunk boundaries::->bool:true" + diff.interHunkContext:"combine hunks closer than N lines:number of lines:->int" diff.mnemonicprefix:'use mnemonic source and destination prefixes::->bool:false' diff.noprefix:'strip source and destination prefixes::->bool:false' diff.orderfile:'file to read patch order glob patterns from:order file:_files' - diff.renameLimit:'number of files to consider when detecting copy/renames:rename limit:->int' + diff.renameLimit:'number of files to consider when detecting copy/renames:limit (number of files):->int' diff.renames:'try to detect renames::->diff.renames:true' diff.ignoreSubmodules:'ignore submodules::->bool:false' diff.statGraphWidth:'width of the graph part in --stat output:width:->int' @@ -2543,10 +2557,12 @@ __git_config_option-or-value () { difftool.prompt:'prompt before each invocation of the diff tool::->bool:true' diff.wordRegex:'regex used to determine what a word is when performing word-by-word diff:regular expression:->string' diff.guitool:'diff tool with gui to use::__git_difftools' + fastimport.unpackLimit:"whether to import objects as loose object files or as a pack:threshold for packing (number of objects imported):->int" feature.experimental:'enable config options that are new to Git::->bool:false' feature.manyFiles:'enable config options that optimize for repos with many files::->bool:false' fetch.parallel:'specify maximum number of fetch operations to run in parallel:number:->int' fetch.prune:'remove any remote tracking branches that no longer exist remotely::->bool:false' + fetch.pruneTags:"maintain one-to-one correspondence with upstream tag refs::->bool:false" fetch.unpackLimit:'maximum number of objects to unpack when fetching:unpack limit:->int' fetch.recurseSubmodules:'recurse into submodules (as needed) when fetching::->fetch.recurseSubmodules:on-demand' fetch.fsckObjects:'check all fetched objects::->bool:false' @@ -2570,13 +2586,16 @@ __git_config_option-or-value () { gc.aggressiveDepth:'maximum delta depth:maximum delta depth::->int:250' gc.aggressiveWindow:'window size used in delta compression algorithm::->int:250' gc.auto:'minimum limit for packing loose objects with --auto::->int:6700' + gc.autoDetach:"make 'git gc --auto' run in the background::->bool:true" gc.autopacklimit:'minimum limit for packing packs with --auto::->int:50' + gc.bigPackThreshold:"keep large packs:size threshold:->bytes" gc.packrefs:'allow git gc to run git pack-refs::->gc.packrefs:true' - gc.pruneexpire:'grace period for pruning::->days+now' + gc.pruneexpire:'grace period for pruning:number of days, "now", or "never":->int' gc.reflogexpire:'grace period for git reflog expire::->days:90' gc.reflogexpireunreachable:'grace period for git reflog expire for unreachable entries::->days:30' gc.rerereresolved:'number of days to keep records of resolved merges::->days:60' gc.rerereunresolved:'number of days to keep records of unresolved merges::->days:15' + gc.worktreePruneExpire:'grace period for pruning worktrees:number of days, "now", or "never":->int' # git default: 3.months.ago gitcvs.commitmsgannotation:'string to append to each commit message::->string' gitcvs.enabled:'enable the cvs server interface::->bool:false' gitcvs.logfile:'name of log file for cvs pserver:log file:_files' @@ -2627,10 +2646,12 @@ __git_config_option-or-value () { guitool.revunmerged:'show only unmerged branches in revprompt::->bool:false' guitool.title:'title of prompt dialog:prompt title:->string' guitool.prompt:'prompt to display:prompt:->string' + grep.column:"show column number of first match::->bool:false" grep.extendedRegexp:'enable --extended-regexp option by default (ignored when grep.patternType is set)::->bool:false' grep.fullname:'enable --full-name option by default::->bool:false' grep.lineNumber:'enable -n option by default::->bool:false' grep.patternType:'default matching pattern type::->grep.patternType:default' + grep.threads:"number of worker threads::->int" help.browser:'browser used to display help in web format::__git_browsers' help.htmlpath:'location of HTML help::->help.htmlpath' http.cookiefile:'file containing cookie lines which should be used in the Git http session::_files' @@ -2699,6 +2720,7 @@ __git_config_option-or-value () { instaweb.local:'bind to 127.0.0.1::->bool:false' instaweb.modulepath:'module path for the Apache HTTP-daemon for instaweb:module directory:_directories' instaweb.port:'port to bind HTTP daemon to for instaweb::_ports' + interactive.diffFilter:"mark up diffs for human consumption:filter command:_cmdstring" interactive.singlekey:'accept one-letter input without Enter::->bool:false' log.abbrevCommit:'make git-log, git-show, and git-whatchanged assume --abbrev-commit::->bool:false' log.date:'default date-time mode::__git_date_formats' @@ -2716,7 +2738,9 @@ __git_config_option-or-value () { merge.defaultToUpstream:'merge the upstream branches configured for the current branch by default::->bool:true' merge.ff:'allow fast-forward merges::->merge.ff:true' merge.log:'include summaries of merged commits in new merge commit messages::->bool:false' - merge.renameLimit:'number of files to consider when detecting copy/renames during merge:limit:->int' + merge.directoryRenames:"try to detect directory renames:mode:compadd false true conflict" + merge.renames:"try to detect renames::->diff.renames" + merge.renameLimit:'number of files to consider when detecting copy/renames during merge:limit (number of files):->int' merge.renormalize:'use canonical representation of files during merge::->bool:false' merge.stat:'print the diffstat between ORIG_HEAD and merge at end of merge::->bool:true' merge.tool:'tool used by git mergetool during merges::__git_mergetools' @@ -2792,13 +2816,15 @@ __git_config_option-or-value () { sendemail.bcc:'value of Bcc\: header::_email_addresses' sendemail.cc:'value of Cc\: header::_email_addresses' sendemail.cccmd:'command to generate Cc\: header with:Cc\: command:_cmdstring' - sendemail.toccmd:'command to generate To\: header with:To\: command:_cmdstring' + sendemail.tocmd:'command to generate To\: header with:To\: command:_cmdstring' sendemail.chainreplyto:'send each email as a reply to the previous one::->bool:false' sendemail.confirm:'type of confirmation required before sending::->sendemail.confirm:auto' sendemail.envelopesender:'envelope sender to send emails as::_email_addresses' sendemail.from:'sender email address::_email_addresses' sendemail.multiedit:'edit all files at once::->bool:true' sendemail.signedoffbycc:'add Signed-off-by\: or Cc\: lines to Cc\: header::->bool:true' + sendemail.smtpBatchSize:"number of messages to send per SMTP connection::->int" + sendemail.smtpReloginDelay:"delay before reconnecting to SMTP server:delay (seconds):->int" sendemail.smtppass:'password to use for SMTP-AUTH:password:->string' sendemail.suppresscc:'rules for suppressing Cc\:::->sendemail.suppresscc' sendemail.suppressfrom:'add From\: address to the Cc\: list::->bool:false' @@ -2811,6 +2837,7 @@ __git_config_option-or-value () { sendemail.smtpuser:'user to use for SMTP-AUTH:smtp user:_users' sendemail.thread:'set In-Reply-To\: and References\: headers::->bool:true' sendemail.validate:'perform sanity checks on patches::->bool:true' + sendemail.xmailer:'add the "X-Mailer" header::->bool:true' 'sendemail.*.aliasesfile:file containing email aliases::_files' 'sendemail.*.aliasfiletype:format of aliasesfile::->sendemail.aliasfiletype' 'sendemail.*.annotate:review and edit each patch you are about to send::bool->false' @@ -2843,12 +2870,15 @@ __git_config_option-or-value () { status.submodulesummary:'include submodule summary::->bool:false' status.branch:'show branch and tracking info in short format::->bool:false' status.short:'use short format by default::->bool:false' + status.renameLimit:'number of files to consider when detecting copy/renames:limit (number of files):->int' + status.renames:"detect renames in 'status' and 'commit'::->diff.renames" 'submodule.*.branch:remote branch name for a submodule:branch name:->string' 'submodule.*.fetchRecurseSubmodules:fetch commits of submodules::->bool' 'submodule.*.path:path within project:submodule directory:_directories -qS \:' 'submodule.*.url:URL to update from::__git_any_repositories' 'submodule.*.update:update strategy to use::->submodule.update:none' 'submodule.*.ignore:ignore modifications to submodules with git status and git diff-*::->submodule.ignore' + submodule.recurse:'recurse into submodules by default (for most git commands)::->bool:false' svn.noMetadata:'disable git-svn-id: lines at end of commits::->bool:false' svn.useSvmProps:'use remappings of URLs and UUIDs from mirrors::->bool:false' svn.useSvnsyncProps:'use remappings of URLs and UUIDs for the svnsync command::->bool:false' @@ -2870,6 +2900,7 @@ __git_config_option-or-value () { 'svn-remote.*.pushurl:URL to push to::_urls' 'svn-remote.*.branches:branch mappings:branch mapping:->string' 'svn-remote.*.tags:tag mappings:tag mapping:->string' + tag.gpgSign:'sign all tags::->bool' tag.sort:'default sorting method:sorting method:->string' 'tar.*.command:specify a shell command through which the tar output generated by git archive should be piped::_cmdstring' 'tar.*.remote:enable for use by remote clients via git-upload-archive::->bool' @@ -2994,6 +3025,10 @@ __git_config_option-or-value () { local opt declare -a match mbegin mend for opt in ${${${${(M)git_options:#(#i)${IPREFIX}[^.:]##:*}#(#i)${IPREFIX}}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]}; do + # TODO: Completing the option names 'core.splitIndex' or 'grep.column' + # offers a second, trailing dot, because there are also options + # called 'splitIndex.foo' and 'column.bar' (some of them are + # added to $git_options as "unknown option name"). if (( ${git_options[(I)${opt%%:*}.*]} )); then sections_and_options+=$opt else @@ -3242,7 +3277,7 @@ __git_config_option-or-value () { _message 'git-merge options' ;; (bytes) - __git_guard_bytes "$parts[2]" && ret=0 + __git_guard_bytes "$parts[3]" && ret=0 ;; (color) compset -P '* ' @@ -3323,16 +3358,6 @@ __git_config_option-or-value () { __git_guard_number 'number of days' fi ;; - (days+now) - # TODO: This needs to be improved. - if [[ -n $current ]]; then - compadd - $current && ret=0 - elif [[ -n $parts[5] ]]; then - compadd - $parts[5] && ret=0 - else - __git_guard_number 'number of days' - fi - ;; (diff.algorithm) __git_config_values -- "$current" "$parts[5]" \ default:'basic greedy diff algorithm' \ @@ -3412,7 +3437,7 @@ __git_config_option-or-value () { elif [[ -n $parts[5] ]]; then compadd - $parts[5] && ret=0 else - __git_guard_number 'integer' + __git_guard_number ${parts[3]:-'integer'} fi ;; (merge.conflictstyle) @@ -7383,6 +7408,29 @@ __git_setup_log_options () { ) } +(( $+functions[__git_ws_error_highlight] )) || +__git_ws_error_highlight() { + _values -s , "kind of line" all default none context old new +} + +(( $+functions[__git_color_moved] )) || +__git_color_moved() { + local -a __git_color_moved=( + no:"do not highlight moved lines" + default:"like zebra" + plain:"highlight moved lines with color" + blocks:"greedily detect blocks of moved text of at least 20 characters" + zebra:"like blocks, with alternating colors between different blocks" + dimmed-zebra:"like zebra, uninteresting parts are dimmed" + ) + _describe "mode" __git_color_moved +} + +(( $+functions[__git_color_movedws] )) || +__git_color_movedws() { + _sequence compadd - no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change +} + (( $+functions[__git_setup_diff_options] )) || __git_setup_diff_options () { # According to Git: "fatal: --name-only, --name-status, --check and -s are mutually exclusive" @@ -7429,13 +7477,8 @@ __git_setup_diff_options () { none\:"disable word diff"))' '--word-diff-regex=-[specify what constitutes a word]:word regex' '(--color --no-color )--color-words=-[show colored-word diff]::word regex' - '(--color --no-color )--color-moved=-[color moved lines differently]::mode:((no\:"do not highlith moved lines" - default\:"like zebra" - plain\:"highlight moved lines with color" - blocks\:"greedily detect blocks of moved text of at least 20 characters" - zebra\:"like blocks, with alternating colors between different blocks" - dimmed-zebra\:"like zebra, uninteresting parts are dimmed"))' - '(--no-color-moved-ws)--color-moved-ws=[configure how whitespace is ignored when performing move detection for --color-moved]:mode:_sequence compadd - no ignore-space-at-eol ignore-space-change ignore-all-space allow-indentation-change' + '(--color --no-color )--color-moved=-[color moved lines differently]::mode:__git_color_moved' + '(--no-color-moved-ws)--color-moved-ws=[configure how whitespace is ignored when performing move detection for --color-moved]:mode:__git_color_movedws' "(--color-moved-ws)--no-color-moved-ws=[don't ignore whitespace when performing move detection]" "--ita-invisible-in-index[hide 'git add -N' entries from the index]" "!(--ita-invisible-in-index)--ita-visible-in-index" @@ -7443,7 +7486,7 @@ __git_setup_diff_options () { $exclusive_diff_options'--check[warn if changes introduce trailing whitespace or space/tab indents]' '--full-index[show full object name of pre- and post-image blob]' '(--full-index)--binary[in addition to --full-index, output binary diffs for git-apply]' - '--ws-error-highlight=[specify where to highlight whitespace errors]: :_values -s , "kind of line" all default none context old new' + '--ws-error-highlight=[specify where to highlight whitespace errors]: :__git_ws_error_highlight' '--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length' '(-B --break-rewrites)'{-B-,--break-rewrites=-}'[break complete rewrite changes into pairs of given size]:: :__git_guard_number size' '(-M --find-renames)'{-M-,--find-renames=-}'[detect renames with given scope]:: :__git_guard_number size' @@ -7469,7 +7512,7 @@ __git_setup_diff_options () { '(-b --ignore-space-change -w --ignore-all-space)'{-w,--ignore-all-space}'[ignore white space when comparing lines]' '--ignore-blank-lines[do not show hunks that add or remove blank lines]' '--no-indent-heuristic[disable heuristic that shifts diff hunk boundaries to make patches easier to read]' - '--inter-hunk-context=[combine hunks closer than n lines]:n' + '--inter-hunk-context=[combine hunks closer than N lines]:number of lines' '--output-indicator-new=[specify the character to indicate a new line]:character [+]' '--output-indicator-old=[specify the character to indicate a old line]:character [-]' '--output-indicator-context=[specify the character to indicate a context line]:character [ ]' -- cgit v1.2.3 From 5584badbea3ffe2d25ef11cc7d4b138d10a867b8 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 26 Jun 2020 18:06:40 +0000 Subject: 46129: _git-config: Fix a bug where a second trailing dot would be incorrectly offered. --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index b0193b2a8..238cd49d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2020-06-28 Daniel Shahaf + * 46129: Completion/Unix/Command/_git: _git-config: Fix a bug + where a second trailing dot would be incorrectly offered. + * 46130: Completion/Unix/Command/_git: _git-config: Complete some more options. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index d8e1743b5..f33ccf35a 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -3025,11 +3025,7 @@ __git_config_option-or-value () { local opt declare -a match mbegin mend for opt in ${${${${(M)git_options:#(#i)${IPREFIX}[^.:]##:*}#(#i)${IPREFIX}}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]}; do - # TODO: Completing the option names 'core.splitIndex' or 'grep.column' - # offers a second, trailing dot, because there are also options - # called 'splitIndex.foo' and 'column.bar' (some of them are - # added to $git_options as "unknown option name"). - if (( ${git_options[(I)${opt%%:*}.*]} )); then + if (( ${git_options[(I)${IPREFIX}${opt%%:*}.*]} )); then sections_and_options+=$opt else options+=$opt -- cgit v1.2.3 From 17764224381663132657ded58bbded7579a60b39 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 26 Jun 2020 18:06:41 +0000 Subject: 46128: _git: Complete more options and diff/merge tools. --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 29 +++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 238cd49d0..c5773aaa7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2020-06-28 Daniel Shahaf + * 46128: Completion/Unix/Command/_git: Complete more options + and diff/merge tools. + * 46129: Completion/Unix/Command/_git: _git-config: Fix a bug where a second trailing dot would be incorrectly offered. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index f33ccf35a..1a8f28651 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -2396,6 +2396,7 @@ __git_config_option-or-value () { blame.date:'date format to use in output::__git_date_formats:iso' 'branch.*.description:branch description:branch description:->string' branch.sort:"default sorting order for 'git branch' output::__git_ref_sort_keys" + checkout.defaultRemote:'assumed remote name when specifying an unqualified remote branch name:remote name:__git_remotes' cvsexportcommit.cvsdir:'the default location of the CVS checkout to use for the export:cvs export dir:_directories' column.ui:'specify whether supported commands should output in columns.::->column:never' column.branch:'specify whether to output branch listing in git branch in columns::_git_column_layouts:never' @@ -2455,6 +2456,7 @@ __git_config_option-or-value () { 'credential.*.helper:external helper to be called when a username or password credential is needed::_cmdstring' 'credential.*.useHttpPath:consider the "path" component of an http or https URL to be important::->bool:false' 'credential.*.username:if no username is set use this username by default:default username:->string' + credentialCache.ignoreSIGHUP:'ignore SIGHUP in git-credential-cache—daemon::->bool:false' add.ignore-errors:'ignore indexing errors when adding files::->bool:false' add.ignoreErrors:'ignore indexing errors when adding files::->bool:false' am.keepcr:'keep CR characters when splitting mails::->bool:false' @@ -2557,12 +2559,15 @@ __git_config_option-or-value () { difftool.prompt:'prompt before each invocation of the diff tool::->bool:true' diff.wordRegex:'regex used to determine what a word is when performing word-by-word diff:regular expression:->string' diff.guitool:'diff tool with gui to use::__git_difftools' + merge.guitool:'merge tool with gui to use::__git_difftools' fastimport.unpackLimit:"whether to import objects as loose object files or as a pack:threshold for packing (number of objects imported):->int" feature.experimental:'enable config options that are new to Git::->bool:false' feature.manyFiles:'enable config options that optimize for repos with many files::->bool:false' + fetch.output:'output format:format:compadd compact full' fetch.parallel:'specify maximum number of fetch operations to run in parallel:number:->int' fetch.prune:'remove any remote tracking branches that no longer exist remotely::->bool:false' fetch.pruneTags:"maintain one-to-one correspondence with upstream tag refs::->bool:false" + fetch.showForcedUpdates:"show forced updates::->bool:true" fetch.unpackLimit:'maximum number of objects to unpack when fetching:unpack limit:->int' fetch.recurseSubmodules:'recurse into submodules (as needed) when fetching::->fetch.recurseSubmodules:on-demand' fetch.fsckObjects:'check all fetched objects::->bool:false' @@ -2614,7 +2619,10 @@ __git_config_option-or-value () { 'gitcvs.*.dbTableNamePrefix:database table name prefix:prefix:->string' gitcvs.usecrlfattr:'use end-of-line conversion attributes::->bool:false' gitcvs.allbinary:'treat all files from CVS as binary::->bool:false' - gpg.program:'use program instead of "gpg" found on $PATH when making or verifying a PGP signature::_cmdstring' + gpg.format:'private key format for --gpg-sign:format:compadd openpgp x509' + gpg.minTrustLevel:'minimum trust level for signature verification:trust level:compadd undefined never marginal fully ultimate' # TODO: sort in this order (use compadd -V) + {gpg.program,gpg.openpgp.program}:'use program instead of "gpg" found on $PATH when making or verifying a PGP signature::_cmdstring' + gpg.x509.program:'use program instead of "gpgsm" found on $PATH when making or verifying an x509 signature::_cmdstring' gui.commitmsgwidth:'width of commit message window:width::->int:75' gui.diffcontext:'number of context lines used in diff window:context::->int:5' gui.encoding:'encoding to use for displaying file contents::->encoding' @@ -2776,10 +2784,13 @@ __git_config_option-or-value () { push.followTags:'enable --follow-tags option by default::->bool:false' push.gpgSign:'GPG-sign pushes::->bool:false' push.recurseSubmodules:'ensure all submodule commits are available on a remote-tracking branch' + push.pushOption:'transmit strings to server to pass to pre/post-receive hooks::->string' rebase.stat:'show a diffstat of what changed upstream since last rebase::->bool:false' rebase.autoSquash:'autosquash by default::->bool:false' rebase.autoStash:'autostash by default::->bool:false' + rebase.instructionFormat:'interactive rebase todo list format::__git_format_placeholders' rebase.missingCommitsCheck:'print a warning if some commits are removed' + rebase.rescheduleFailedExec:"automatically re-schedule any 'exec' that fails::->bool" receive.autogc:'run git gc --auto after receiving data::->bool:true' receive.fsckObjects:'check all received objects::->bool:true' receive.hiderefs:'string(s) receive-pack uses to decide which refs to omit from its initial advertisement:hidden refs:->string' @@ -2795,6 +2806,7 @@ __git_config_option-or-value () { 'remote.*.promisor:use this remote to fetch promisor objects::->bool:false' 'remote.*.pushurl:push URL of a remote repository::__git_any_repositories' 'remote.*.proxy:URL of proxy to use for a remote repository::_urls' + "remote.*.pruneTags:maintain one-to-one correspondence with remote's tag refs::->bool:false" 'remote.*.prune:remove any remote tracking branches that no longer exist remotely::->bool:false' 'remote.*.fetch:default set of refspecs for git fetch::__git_ref_specs_fetchy' 'remote.*.push:default set of refspecs for git push::__git_ref_specs_pushy' @@ -2805,9 +2817,13 @@ __git_config_option-or-value () { 'remote.*.uploadpack:default program to execute on remote when fetching:git upload-pack command:_cmdstring' 'remote.*.tagopt:options for retrieving remote tags::->remote.tagopt' 'remote.*.vcs:interact with the remote through git-remote helper:remote VCS:->string' + repack.packKeptObjects:'repack objects in packs marked with .keep::->bool' + repack.useDeltaIslands:'pass --delta-islands to git-pack-objects::->bool:false' repack.usedeltabaseoffset:'use delta-base offsets::->bool:true' + repack.writeBitmaps:'trade off disk space for faster subsequent repacks::->bool' rerere.autoupdate:'update index after resolution::->bool:false' rerere.enabled:'record resolved conflicts::->bool' + reset.quiet:'pass --quiet by default::->bool:false' sendemail.identity:'default identity::__git_sendemail_identities' sendemail.smtpencryption:'encryption method to use::->sendemail.smtpencryption' sendemail.aliasesfile:'file containing email aliases:email aliases file:_files' @@ -2865,7 +2881,9 @@ __git_config_option-or-value () { sendemail.assume8bitEncoding:'encoding to use for non-ASCII messages::__git_encodings' sequence.editor:'text editor used by git rebase -i::_cmdstring' showbranch.default:'default set of branches for git show-branch::->branch' + status.aheadBehind:"display detailed ahead/behind counts relative to upstream branch::->bool:true" status.relativePaths:'show paths relative to current directory::->bool:false' + status.showStash:'show number of stashes::->bool:false' status.showUntrackedFiles:'show untracked files::->status.showUntrackedFiles:normal' status.submodulesummary:'include submodule summary::->bool:false' status.branch:'show branch and tracking info in short format::->bool:false' @@ -2879,6 +2897,7 @@ __git_config_option-or-value () { 'submodule.*.update:update strategy to use::->submodule.update:none' 'submodule.*.ignore:ignore modifications to submodules with git status and git diff-*::->submodule.ignore' submodule.recurse:'recurse into submodules by default (for most git commands)::->bool:false' + ssh.variant:'SSH command flavour:flavour id:compadd ssh simple plink putty tortoiseplink' svn.noMetadata:'disable git-svn-id: lines at end of commits::->bool:false' svn.useSvmProps:'use remappings of URLs and UUIDs from mirrors::->bool:false' svn.useSvnsyncProps:'use remappings of URLs and UUIDs for the svnsync command::->bool:false' @@ -2920,6 +2939,8 @@ __git_config_option-or-value () { versionsort.suffix:'specify sort order of suffixes applied to tags:suffix' web.browser:'web browser to use::__git_browsers' worktree.guessRemote:'with add, if branch matches remote track it::->bool:true' + + {fetch.fsck.skipList,receive.fsck.skipList,fsck.skipList}:'ignore objects broken in a non-fatal way:path to a list of objects:_files' ) declare -a git_present_options # 'present' is an adjective @@ -3024,6 +3045,7 @@ __git_config_option-or-value () { elif compset -P '[^.]##.'; then local opt declare -a match mbegin mend + # TODO: completing 'gpg.openpgp' doesn't offer 'gpg.openpgp.program' for opt in ${${${${(M)git_options:#(#i)${IPREFIX}[^.:]##:*}#(#i)${IPREFIX}}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]}; do if (( ${git_options[(I)${IPREFIX}${opt%%:*}.*]} )); then sections_and_options+=$opt @@ -3553,7 +3575,7 @@ __git_config_option-or-value () { (*) # TODO: Do we need to set up a _requested/_next_label? declare -a action - _description values expl "$parts[2]" + _description values expl "$parts[3]" eval "action=($parts[4])" "$action[1]" "$expl[@]" "${(@)action[2,-1]}" && ret=0 ;; @@ -7981,6 +8003,8 @@ __git_diff-or-merge-tools () { diffuse ecmerge emerge + examdiff + guiffy gvimdiff gvimdiff2 gvimdiff3 @@ -7994,6 +8018,7 @@ __git_diff-or-merge-tools () { vimdiff vimdiff2 vimdiff3 + winmerge xxdiff) builtindifftools=($builtintools kompare) -- cgit v1.2.3 From a4b4a3a7c7d9c94c1b19cab285f0a333761a3416 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 26 Jun 2020 18:06:42 +0000 Subject: 46131: _git-config: Partly fix a bug whereby a 'foo.ba' wouldn't be completed to 'foo.bar.baz'. Now it properly gets completed, but in the case of gpg.openpgp.program, the description would be shown as "unknown option name", that being the description of gpg.*.program via `git help -c`, which shadows the more description of gpg.openpgp.program in $git_options. --- ChangeLog | 4 ++++ Completion/Unix/Command/_git | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index c5773aaa7..1da0d92bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-06-28 Daniel Shahaf + * 46131: Completion/Unix/Command/_git: _git-config: Partly + fix a bug whereby a 'foo.ba' wouldn't be completed to + 'foo.bar.baz'. + * 46128: Completion/Unix/Command/_git: Complete more options and diff/merge tools. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 1a8f28651..05e2a2361 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -2963,6 +2963,7 @@ __git_config_option-or-value () { pretty remotes ${(u)${(M)${git_options%%:*}:#*[.][*][.]*}%%.*} + ${(u)${(M)git_present_options:#*[.][*][.]*}%%.*} ) local key for key in $git_present_options ; do @@ -3008,6 +3009,7 @@ __git_config_option-or-value () { if compset -P '[^.]##.*.'; then declare -a match mbegin mend + # TODO: completing 'gpg.openpgp' adds both 'gpg.openpgp.program' and 'gpg.*.program' to $options, so it ends up being listed as 'unknown option name' even though we have a description # When completing 'remote.foo.', offer 'bar' if $git_options contains 'remote.foo.bar'. options+=(${${${${(M)git_options:#(#i)${IPREFIX}[^.:]##:*}#(#i)${IPREFIX}}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]}) # When completing 'remote.foo.', offer 'bar' if $git_options contains 'remote.*.bar'. @@ -3045,8 +3047,7 @@ __git_config_option-or-value () { elif compset -P '[^.]##.'; then local opt declare -a match mbegin mend - # TODO: completing 'gpg.openpgp' doesn't offer 'gpg.openpgp.program' - for opt in ${${${${(M)git_options:#(#i)${IPREFIX}[^.:]##:*}#(#i)${IPREFIX}}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]}; do + for opt in ${${${${(M)git_options:#(#i)${IPREFIX}[^.:][^:]#:*}#(#i)${IPREFIX}}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]}; do if (( ${git_options[(I)${IPREFIX}${opt%%:*}.*]} )); then sections_and_options+=$opt else -- cgit v1.2.3 From 19390a1ba8dc983b0a1379058e90cd51ce156815 Mon Sep 17 00:00:00 2001 From: zsugabubus Date: Mon, 22 Jun 2020 12:27:38 +0200 Subject: 46097: Fix "assignment to invalid subscript range" error in _rm. See 46090 for details. --- ChangeLog | 5 +++++ Completion/Unix/Command/_rm | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index ec66ace61..b2d94f38c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-06-28 zsugabubus + + * 46097: Completion/Unix/Command/_rm: Fix "assignment to invalid + subscript range" error in _rm. + 2020-06-28 Daniel Shahaf * 46132: Doc/Zsh/expn.yo: docs: Use an itemized list in the diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm index ea9190de2..e66b77fa4 100644 --- a/Completion/Unix/Command/_rm +++ b/Completion/Unix/Command/_rm @@ -69,7 +69,7 @@ _arguments -C -s -S $opts \ case $state in (file) - line[CURRENT]=() + (( CURRENT > 0 )) && line[CURRENT]=() line=( ${line//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} ) _files -F line && ret=0 ;; -- cgit v1.2.3 From 5a34b68ae2d324ff51bc81a559f82a3a2954f855 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 8 Jul 2020 23:52:37 +0200 Subject: 46217: update options for tmux 3.1 --- ChangeLog | 2 + Completion/Unix/Command/_tmux | 110 ++++++++++++++++++++++++++++++++++-------- 2 files changed, 93 insertions(+), 19 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 39935256d..af9d581b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2020-07-08 Oliver Kiddle + * 46217: Completion/Unix/Command/_tmux: update options for tmux 3.1 + * github #60: Mathias Fredriksson: Completion/Unix/Type/_zfs_dataset: Fix completion for a zfs dataset containing spaces diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index b564c955d..f4e5619a0 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -125,6 +125,7 @@ _tmux_aliasmap=( # status line confirm confirm-before + menu display-menu display display-message # buffers @@ -169,15 +170,16 @@ _tmux-attach-session() { '-d[detach other clients attached to target session]' \ '-r[put the client into read-only mode]' \ '-t+[specify target session]:target session: __tmux-sessions-separately' \ - "-E[don't apply update-environment option]" + "-E[don't apply update-environment option]" \ + '-x[with -d, send SIGHUP to the parent of the attached client]' } _tmux-bind-key() { [[ -n ${tmux_describe} ]] && print "bind a key to a command" && return _arguments -s -A "-*" \ - '-c[bind to command mode instead of normal mode]' \ '-n[make the binding work without the need for the prefix key]' \ '-r[the key may repeat]' \ + '-N+[attach a note to the key]:note' \ '-T+[specify key table for the binding]:key table' \ '1:key' \ '*:::template:= _tmux' @@ -202,7 +204,8 @@ _tmux-capture-pane() { '-C[escape non-printable characters as octal \\ooo]' \ '-e[include escape sequences for attributes etc]' \ '-E[specify last line to capture]:line number (- means last line)' \ - '-J[join wrapped lines and preserve trailing space]' \ + '(-N)-J[join wrapped lines and preserve trailing space]' \ + '(-J)-N[preserve trailing space]' \ '-q[ignore errors when trying to access alternate screen]' \ '(-b)-p[print data to stdout]' \ '-P[only capture beginnings of as-yet incomplete escape sequences]' \ @@ -214,6 +217,8 @@ _tmux-choose-buffer() { [[ -n ${tmux_describe} ]] && print "put a pane into buffer choice mode" && return _arguments -s \ '-N[start without the preview]' \ + '-Z[zoom the pane]' \ + '-r[reverse sort order]' \ '-F+[specify format for each list item]:format:__tmux-formats' \ '-f+[filter items]:filter format:__tmux-formats' \ '-O+[initial sort order]:order:(time name size)' \ @@ -225,6 +230,8 @@ _tmux-choose-client() { [[ -n ${tmux_describe} ]] && print "put a window into client choice mode" && return _arguments -s \ '-N[start without the preview]' \ + '-Z[zoom the pane]' \ + '-r[reverse sort order]' \ '-F+[specify format for each list item]:format:__tmux-formats' \ '-f+[filter items]:filter format:__tmux-formats' \ '-O+[initial sort order]:order:(time name size)' \ @@ -237,6 +244,8 @@ _tmux-choose-tree() { _arguments -s \ '-G[include all sessions in any session groups in the tree rather than only the first]' \ '-N[start without the preview]' \ + '-Z[zoom the pane]' \ + '-r[reverse sort order]' \ '-F+[specify format for each list item]:format:__tmux-formats' \ '-f+[filter items]:filter format:__tmux-formats' \ '-O+[initial sort order]:order:(time name size)' \ @@ -260,7 +269,8 @@ _tmux-command-prompt() { [[ -n ${tmux_describe} ]] && print "open the tmux command prompt in a client" && return _arguments -s \ '-1[only accept one key press]' \ - '-N' \ + '-k[only accept one key press and translate it to a key name]' \ + '-N[accept only numeric key presses]' \ '-i[execute the command every time the prompt input changes]' \ '-I+[specify list of initial inputs]:initial-text (comma-separated list)' \ '-p+[specify list of prompts]:prompts (comma-separated list)' \ @@ -280,6 +290,9 @@ _tmux-copy-mode() { [[ -n ${tmux_describe} ]] && print "enter copy mode" && return _arguments -s \ '-t+[specify target pane]:pane:__tmux-panes' \ + '-e[scrolling to the bottom should exit copy mode]' \ + '-H[hide the position indicator in the top right]' \ + '-q[cancel copy mode and any other modes]' \ '-u[scroll up one page]' \ '-M[begin a mouse drag]' } @@ -299,16 +312,45 @@ _tmux-detach-client() { '-t+[specify target client]:client:__tmux-clients' } +_tmux-display-menu() { + [[ -n ${tmux_describe} ]] && print "display a menu" && return + local curcontext="$curcontext" ret=1 + local -a state line expl + _arguments -C -s -S -A "-*" \ + '-c+[specify target client]:client:__tmux-clients' \ + '-t+[specify target pane]:pane:__tmux-panes' \ + '-T+[specify title]:title' \ + '-x+[specify horizontal position]: : _alternative "columns\: \:_guard \[0-9\]\# column" "positions\:position\:((R\:right P\:bottom M\:mouse W\:window))"' \ + '-y+[specify vertical position]: : _alternative "rows\: \:_guard \[0-9\]\# row" "positions\:position\:((P\:left M\:mouse S\:status\ line))"' \ + '*::: :->options' && ret=0 + + if [[ -n $state ]]; then + case $(( CURRENT % 3 )) in + 1) _message -e options 'menu option' ;; + 2) _message -e keys 'shortcut key' ;; + 0) + compset -q + words=( menu "$words[@]" ) + (( CURRENT++ )) + _tmux && ret=0 + ;; + esac + fi + + return ret +} + _tmux-display-message() { [[ -n ${tmux_describe} ]] && print "display a message in the status line" && return _arguments -s -S -A "-*" \ '(-p -F :)-a[list the format variables and their values]' \ + '-I[forward any input read from stdin to the target pane]' \ '-c+[specify target client]:client:__tmux-clients' \ '(-a)-p[print message to stdout]' \ '-t+[specify target pane]:pane:__tmux-panes' \ '(-a)-F+[specify output format]:format:__tmux-formats' \ - '(-a)-v[prints verbose logging as the format is parsed]' \ - ':message' + '(-a)-v[print verbose logging as the format is parsed]' \ + ':message:__tmux-formats' } _tmux-display-panes() { @@ -323,6 +365,7 @@ _tmux-display-panes() { _tmux-find-window() { [[ -n ${tmux_describe} ]] && print "search for a pattern in windows" && return _arguments -s \ + '-r[use regular expression matching]' \ '-C[match visible contents]' \ '-N[match window name]' \ '-T[match window title]' \ @@ -354,13 +397,15 @@ _tmux-if-shell() { _tmux-join-pane() { [[ -n ${tmux_describe} ]] && print "split a pane and move an existing one into the new space" && return + # -p removed from documentation but still works, or use -l and append % _arguments -s \ '-b[join source pane left of or above target pane]' \ "-d[don't make the new window become the active one]" \ + '(-l)-f[span the full size]' \ '-h[split horizontally]' \ '-v[split vertically]' \ - "-l+[define new pane's size]: :_guard '[0-9]#' 'numeric value'" \ - "-p+[define new pane's size in percent]: :_guard '[0-9]#' 'numeric value'" \ + "(-p)-l[define new pane's size]:size" \ + "!(-f -l)-p+:size (percentage)" \ '-s+[specify source pane]:pane:__tmux-panes' \ '-t+[specify target pane]:pane:__tmux-panes' } @@ -397,6 +442,7 @@ _tmux-last-pane() { _arguments -s \ '-d[disable input to the pane]' \ '-e[enable input to the pane]' \ + '-Z[keep window zoomed if it was zoomed]' \ '-t+[specify session]:session:__tmux-sessions' } @@ -428,12 +474,16 @@ _tmux-list-clients() { _tmux-list-commands() { [[ -n ${tmux_describe} ]] && print "list supported sub-commands" && return - _arguments '-F+[specify format]:format' + _arguments '-F+[specify format]:format:__tmux-formats' '1:sub-command:_tmux' } _tmux-list-keys() { [[ -n ${tmux_describe} ]] && print "list all key-bindings" && return _arguments -s \ + '-1[list only the first matching key]' \ + '-a[list the command for keys that do have a note]' \ + '-N[list only keys with attached notes]' \ + '-P+[specify a prefix to print before each key]:prefix' \ '-T+[specify key table]:key table' } @@ -512,10 +562,10 @@ _tmux-move-window() { _tmux-new-session() { [[ -n ${tmux_describe} ]] && print "create a new session" && return _arguments -s -A "-*" -S \ - '-A[attach to existing session if it already exists]' \ '-c+[specify working directory for the session]:directory:_directories' \ + '-A[attach to existing session if it already exists]' \ "-d[don't attach new session to current terminal]" \ - "-D[in case of -A behave like attach-session's -d]" \ + "-D[with -A, detach other clients attached to session]" \ "-E[don't apply update-environment option]" \ '-F+[specify output format]:format:__tmux-formats' \ '-n+[specify initial window name]:window name' \ @@ -524,6 +574,7 @@ _tmux-new-session() { '-t+[specify target session]:session:__tmux-sessions' \ '-x[specify width]:width' \ '-y[specify height]:height' \ + '-X[with -D, send SIGHUP to the parent of the attached client]' \ '*:: :_cmdambivalent' } @@ -532,6 +583,7 @@ _tmux-new-window() { _arguments -s -A "-*" -S \ '-a[insert new window at next free index from -t]' \ '-c+[specify working directory for the session]:directory:_directories' \ + '*-e[specify environment variable]:environment variable:_parameters -g "*export*" -qS=' \ "-d[don't make the new window become the active one]" \ '-F+[specify output format]:format:__tmux-formats' \ '-k[destroy it if the specified window exists]' \ @@ -592,6 +644,7 @@ _tmux-refresh-client() { '-C+[set the width and height of a control client]:width,height' \ '-c[reset so that the position follows the cursor]' \ '-D[move visible portion of window down]' \ + '-F+[specify flags]:flag:(no-output)' \ '-L[move visible portion of window left]' \ '-l[request clipboard from the client and store it in a new paste buf using xterm(1) escape sequence]' \ "-S[only update the client's status bar]" \ @@ -649,6 +702,7 @@ _tmux-respawn-pane() { [[ -n ${tmux_describe} ]] && print "reuse a pane in which a command has exited" && return _arguments -s -A "-*" -S \ '-c+[specify a new working directory for the pane]:directory:_directories' \ + '*-e[specify environment variable]:environment variable:_parameters -g "*export*" -qS=' \ '-k[kill window if it is in use]' \ '-t+[specify target pane]:pane:__tmux-pane' \ ':command:_cmdambivalent' @@ -658,6 +712,7 @@ _tmux-respawn-window() { [[ -n ${tmux_describe} ]] && print "reuse a window in which a command has exited" && return _arguments -s -A "-*" -S \ '-c+[specify a new working directory for the window]:directory:_directories' \ + '*-e[specify environment variable]:environment variable:_parameters -g "*export*" -qS=' \ '-k[kill window if it is in use]' \ '-t+[specify target window]:window:__tmux-windows' \ ':command:_cmdambivalent' @@ -668,6 +723,7 @@ _tmux-rotate-window() { _arguments -s \ '-D[rotate downward]' \ '-U[rotate upward]' \ + '-Z[keep the window zoomed if it was zoomed]' \ '-t+[specify target window]:window:__tmux-windows' } @@ -699,6 +755,7 @@ _tmux-select-layout() { _tmux-select-pane() { [[ -n ${tmux_describe} ]] && print "make a pane the active one in the window" && return + # -P and -g have been removed from the documentation in tmux 3 but still work _arguments -s \ '-D[move to the pane below target]' \ '-d[disable input to the pane]' \ @@ -710,6 +767,7 @@ _tmux-select-pane() { '-m[set marked pane]' \ '-R[move to the pane right of target]' \ '-U[move to the pane above target]' \ + '-Z[keep the window zoomed if it was zoomed]' \ '-P+[set pane style]:style:__tmux-style' \ '-T+[set the pane title]:title' \ '-t+[specify target pane]:pane:__tmux-panes' @@ -728,7 +786,9 @@ _tmux-select-window() { _tmux-send-keys() { [[ -n ${tmux_describe} ]] && print "send key(s) to a window" && return _arguments -s -A "-*" -S \ - '-l[disable key name lookup and send data literally]' \ + '(-H)-l[disable key name lookup and send data literally]' \ + '-F[expand formats in arguments where appropriate]' \ + '(-l)-H[interpret key as hexadecimal number for an ASCII character]' \ '-R[reset terminal state]' \ '-M[pass through a mouse event]' \ '-X[send a command into copy mode]' \ @@ -801,8 +861,9 @@ _tmux-set-option() { '-o[prevent setting of an option that is already set]' \ '-q[suppress errors about unknown or ambiguous options]' \ '-u[unset a non-global option]' \ - '-w[change window (not session) options]' \ - '-s[change server (not session) options]' \ + '(-w -s)-p[change pane (no session) options]' \ + '(-p -s)-w[change window (not session) options]' \ + '(-p -w)-s[change server (not session) options]' \ '-t+[specify target session]:target session:__tmux-sessions' \ '*:: :->name_or_value' && ret=0 @@ -835,6 +896,7 @@ _tmux-set-window-option() { _tmux-set-hook() { [[ -n ${tmux_describe} ]] && print "set a hook to a command" && return _arguments -s \ + '-a[append to hook]' \ '(-R)-g[add hook to global list]' \ '(-g -u)-R[run hook immediately]' \ '(-R)-u[unset a hook]' \ @@ -888,11 +950,14 @@ _tmux-show-options() { local curcontext="$curcontext" state line ret=1 typeset -A opt_args _arguments -C -s : \ + '-A[include options inherited from a parent set]' \ + '-H[include hooks]' \ '-g[show global options]' \ '-q[suppress errors about unknown or ambiguous options]' \ - '-s[show server options]' \ '-v[show only the option value, not the name]' \ - '-w[show window options]' \ + '(-s -w)-p[show pane (not session) options]' \ + '(-p -w)-s[show server (not session) options]' \ + '(-p -s)-w[show window (not session) options]' \ '-t+[specify target session]:target session:__tmux-sessions' \ '*:: :->name_or_value' && ret=0 @@ -921,22 +986,27 @@ _tmux-show-window-options() { _tmux-source-file() { [[ -n ${tmux_describe} ]] && print "execute tmux commands from a file" && return _arguments \ + '-n[file is parsed but no commands are executed]' \ "-q[don't report error if path doesn't exist]" \ + '-v[show parsed commands and line numbers if possible]' \ '*:path:_directories' } _tmux-split-window() { [[ -n ${tmux_describe} ]] && print "splits a pane into two" && return + # -p removed from documentation but still works, or use -l and append % _arguments -s \ '-b[create new pane left of or above target pane]' \ "-d[don't make the new window become the active one]" \ + '*-e[specify environment variable]:environment variable:_parameters -g "*export*" -qS=' \ '-F+[specify output format]:format:__tmux-formats' \ - '-f[create new pane spanning full window width or height]' \ + '(-l)-f[create new pane spanning full window width or height]' \ '-h[split horizontally]' \ '-v[split vertically]' \ - "-l[define new pane's size]:size" \ - "-p[define new pane's size in percent]:size (percentage)" \ + "(-p)-l[define new pane's size]:size" \ + "!(-f -l)-p+:size (percentage)" \ '-t+[specify target pane]:pane:__tmux-panes' \ + '(:)-I[create empty pane and forward stdin to it]' \ ':command:_cmdambivalent' # Yes, __tmux-panes is correct here. The behaviour was changed # in recent tmux versions and makes more sense. Except that @@ -959,6 +1029,7 @@ _tmux-swap-pane() { _arguments -s \ '-D[move pane down]' \ '-U[move pane up]' \ + '-Z[keep the window zoomed if it was zoomed]' \ "-d[don't change the active pane]" \ '-s+[specify source pane]:pane:__tmux-panes' \ '-t+[specify destination pane]:pane:__tmux-panes' @@ -981,6 +1052,7 @@ _tmux-switch-client() { '-n[move client to next session]' \ '-p[move client to previous session]' \ '-r[toggle read-only flag of client]' \ + '-Z[keep the window zoomed if it was zoomed]' \ '-t+[specify target window]:window:__tmux-windows' } -- cgit v1.2.3 From 781129b838a4fbb8cb9a70f7dc62dd26a4bb9ba9 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 8 Jul 2020 23:54:38 +0200 Subject: 46216: update for ansible 2.9 --- ChangeLog | 2 + Completion/Unix/Command/_ansible | 147 +++++++++++++++++++++++++++++---------- 2 files changed, 111 insertions(+), 38 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index af9d581b9..254597dc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2020-07-08 Oliver Kiddle + * 46216: Completion/Unix/Command/_ansible: update for ansible 2.9 + * 46217: Completion/Unix/Command/_tmux: update options for tmux 3.1 * github #60: Mathias Fredriksson: Completion/Unix/Type/_zfs_dataset: diff --git a/Completion/Unix/Command/_ansible b/Completion/Unix/Command/_ansible index f1e13a813..9de9b6675 100644 --- a/Completion/Unix/Command/_ansible +++ b/Completion/Unix/Command/_ansible @@ -1,7 +1,7 @@ #compdef ansible ansible-config ansible-console ansible-doc ansible-galaxy ansible-inventory ansible-playbook ansible-pull ansible-vault -value-,ANSIBLE_STDOUT_CALLBACK,-default- -local curcontext="$curcontext" plug plugvar ign ret=1 -local -a args state line +local curcontext="$curcontext" plug plugvar subcmd ign ret=1 +local -a args state line expl gactions local -A opt_args case $service in @@ -40,7 +40,7 @@ case $service in '!(-R --su-user -U --sudo-user)'{-R,-U,--su-user,--sudo-user}':user [root]:_users' ) ;| - ansible|ansible-console|ansible-inventory|ansible-playbook|ansible-pull|ansible-vault) + ansible|ansible-console|ansible-inventory|ansible-playbook|ansible-pull) args+=( '--ask-vault-pass[ask for vault password]' '--vault-id=[specify vault identity to use]:vault identity' @@ -72,7 +72,7 @@ case $service in ;| ansible-playbook|ansible-pull) args+=( - '(-t --tags)'{-t,--tags}'[only run plays and tasks tagged with these values]' + '(-t --tags)'{-t,--tags}'[only run plays and tasks tagged with these values]:tag:->tags' "--skip-tags[only run plays and tasks whose tags don't match]" ) ;| @@ -106,11 +106,12 @@ case $service in ;; ansible-doc) args+=( - '!(-l --list -F --list_files -s --snippet)'{-j,--json} # "internal testing only" + '!--metadata-dump' # "internal testing only" + '(-l --list -F --list_files -s --snippet)'{-j,--json}'[change output to json format]' '(-l --list -F --list_files -s --snippet)'{-l,--list}'[list available plugins]' '(-l --list -F --list_files -s --snippet)'{-F,--list_files}'[show plugin names and their source files without summaries]' '(-l --list -F --list_files -s --snippet)'{-s,--snippet}'[show playbook snippet for specified plugins]' - '(-t --type)'{-t+,--type=}'[choose plugin type]:plugin type [module]:(become cache callback cliconf connection httpapi inventory lookup shell module strategy vars)' + '(-t --type)'{-t+,--type=}'[choose plugin type]:plugin type [module]:(become cache callback cliconf connection httpapi inventory lookup netconf shell module strategy vars)' '*:plugin:->plugins' ) ;; @@ -127,12 +128,12 @@ case $service in ) ;; ansible-galaxy) - args+=( -A "-*" $args + args=( -A "-*" $args '--list[list integrations]' '(-c --ignore-certs)'{-c,--ignore-certs}'[ignore SSL certificate validation errors]' '(-s --server)'{-s+,--server=}'[specify API server destination]:server destination' '--remove=[remove integration]:integration id' - '1:action:(delete import info init install list login remove search setup)' + '::type:(collection role)' '*::args:->galaxy' ) ;; @@ -154,7 +155,7 @@ case $service in '(-d --directory)'{-d+,--directory=}'[specify directory to checkout repository to]:directory:_directories' '--full[do a full instead of a shallow clone]' '(-m --module-name)'{-m+,--module-name=}'[specify repository module used for checking out repository]:module:(git subversion hg bzr)' - '--accept-host-key[adds the hostkey for the repo url if not already added]' + '--accept-host-key[add the hostkey for the repo url if not already added]' '--purge[purge checkout after playbook run]' '(-f --force)'{-f,--force}'[run the playbook even if the repository could not be updated]' '(-C --checkout)'{-C,--checkout}'[specify branch/tag/commit to checkout]:branch/tag/commit' @@ -168,9 +169,7 @@ case $service in ;; ansible-vault) args=( -A "-*" $args - '::action:(create decrypt edit encrypt encrypt_string rekey view)' - '--new-vault-id=[specify new vault identity to use for rekey]:vault id' - '--new-vault-password-file=[specify new vault password file to use for rekey]:file:_files' + '::action:compadd -M "r:|_=* r:|=*" - create decrypt edit encrypt encrypt_string rekey view' '*::args:->vault' ) ;; @@ -232,27 +231,68 @@ case $state in _wanted plugins expl "${plug} plugin" compadd -a $plugvar && ret=0 fi ;; + tags) + # The recursive glob here is questionable and perhaps there should be a style. + _sequence _wanted tags expl tag compadd - \ + ${(s.,.)${(j.,.)${(M)${(f)"$(cat **/*.yml)"}:# #tags:*}#*: }} && ret=0 + ;; galaxy) ign='' - curcontext="${curcontext%:*}-${line[1]}:" - (( $#words > 2 )) && ign='!' + gactions=( delete import info init install list login remove search setup ) + case ${(j.:.)line[1,3]} in + (role|collection):*:*) + subcmd="${line[1]}-${line[2]}" + ;; + collection:*) + gactions=( init build publish install ) + subcmd=collection + ;; + role:*) subcmd=role ;; + *:*) subcmd="role-${line[1]}" ;& + [^:]#) + words=( role "$words[@]" ) + (( CURRENT++ )) + ;; + esac + curcontext="${curcontext%:*}-${subcmd}:" + (( $#words > 3 )) && ign='!' args=( "${ign}(-)"{-h,--help}'[display usage information]' - '(-c --ignore-certs)'{-c,--ignore-certs}'[ignore SSL certificate validation errors]' - '(-s --server)'{-s+,--server=}'[specify API server destination]:server:_hosts' - {-v,--verbose}'[verbose mode]' + '1: :{ _wanted actions expl action compadd -a gactions }' ) - case $line[1] in - info|search|list|remove|install) + case $subcmd in + *-*) + args+=( + '(-c --ignore-certs)'{-c,--ignore-certs}'[ignore SSL certificate validation errors]' + '(-s --server)'{-s+,--server=}'[specify API server destination]:server:_hosts' + \*{-v,--verbose}'[verbose mode]' + ) + ;| + collection-*) + args+=( '--api-key=[specify ansible galaxy API key]:api key' ) + ;| + role-(info|search|list|remove|install)) args+=( '(-p --roles-path)'{-p,--roles-path}'[specify location of roles]:path:_directories' ) ;| - info|init) + role-(info|init)) args+=( "--offline[don't query the galaxy API]" ) ;| - init|install) - args+=( '(-f --force)'{-f,--force}'[force overwriting an existing role]' ) + *-(init|build|install)) + args+=( '(-f --force)'{-f,--force}'[force overwriting an existing role or collection]' ) + ;| + *-install) + args+=( + '(-i --ignore-errors)'{-i,--ignore-errors}'[ignore errors and continue with the next specified role/collection]' + '(-n --no-deps)'{-n,--no-deps}"[don’t download roles/collections listed as dependencies]" + "--force-with-deps[force overwriting an existing role/collection and it's dependencies]" + ) + ;| + *-init) + args+=( + '--init-path=[specify path in which the skeleton will be created]:path:_directories' + ) ;| - search) + role-search) args+=( '--author=[specify GitHub username]:username' '--galaxy-tags=[specify list of galaxy tags to filter by]:galaxy tags' @@ -260,29 +300,25 @@ case $state in '*: :_guard "^-*" "search term"' ) ;; - setup) + role-setup) args+=( '--list[list integrations]' '--remove=[remove integration]:integration id' ) ;; - init) + role-init) args+=( - '--init-path=[specify path in which the skeleton role will be created]:path:_directories' - '--role-skeleton=[specify path to a role skeleton that the new role should be based upon]' + '--role-skeleton=[specify path to a role skeleton that the new role should be based upon]:path:_files' '--type=[initialize using an alternate role type]:role type:(container apb network)' ) ;; - install) + role-install) args+=( - "--force-with-deps[force overwriting an existing role and it's dependencies]" - '(-n --no-deps)'{-n,--no-deps}"[don’t download roles listed as dependencies]" - '(-i --ignore-errors)'{-i,--ignore-errors}'[ignore errors and continue with the next specified role]' '(-g --keep-scm-meta)'{-g,--keep-scm-meta}'[use tar instead of the scm archive option when packaging the role]' '(-r --role-file)'{-r+,--role-file=}'[specify file containing a list of roles to be imported]:file:_files' ) ;; - import) + role-import) args+=( '--status[check the status of the most recent import request for given github_user/github_repo]' "--no-wait[don’t wait for import results]" @@ -290,24 +326,54 @@ case $state in '--role-name=[specify name the role should have]:role' ) ;; - login) + role-login) args+=( '--github-token=[identify with github token rather than username and password]' ) ;; + collection-build) + args+=( + '--output-path=[specify path in which the collection is built to]:path [.]:_directories' + ) + ;; + collection-init) + args+=( + '--collection-skeleton=[specify path to a collection skeleton that the new role should be based upon]:path:_files' + ) + ;; + collection-publish) + args+=( + "--no-wait[don't wait for import validation results]" + '--import-timeout=[specify time to wait for import process]:time' + ) + ;; + collection-install) + args+=( + '(-p --collections-path)'{-p+,--collections-path=}'[specify directory containing collections]:_directories' + '(-r --requirements-file)'{-r+,--requirements-file=}'[specify file containing a list of collections to install]:file:_files' + ) + ;; esac - _arguments -s -S $args && ret=0 + _arguments -s -S : $args && ret=0 ;; vault) + ign='' curcontext="${curcontext%:*}-${line[1]}:" - args=() + (( $#words > 2 )) && ign='!' + args=( + "${ign}(-)"{-h,--help}'[display usage information]' + '--ask-vault-pass[ask for vault password]' + '--vault-id=[specify vault identity to use]:vault identity' + '--vault-password-file=[specify vault password file]:vault password file:_files' + \*{-v,--verbose}'[verbose mode]' + ) case $line[1] in - encrypt*|edit|rekey) + create|encrypt*|edit|rekey) args+=( '--encrypt-vault-id=[specify vault id to use to encrypt (required if more than one vault-id is provided)]:vault id' ) ;| - (de|en)crypt*) args=( '--output=[specify output file name]:file:_files' ) ;| + (de|en)crypt*) args+=( '--output=[specify output file name]:file:_files' ) ;| encrypt_string) args+=( '(-p --prompt)'{-p,--prompt}'[prompt for the string to encrypt]' @@ -316,7 +382,12 @@ case $state in ) ;| create|edit|rekey|view) args+=( ':file:_files' ) ;| - (en|de)crypt) args+=( '::file:_files' ) + (en|de)crypt) args+=( '::file:_files' ) ;; + rekey) + args+=( + '--new-vault-id=[specify new vault identity to use]:vault identity' + '--new-vault-password-file=[specify new vault password file]:vault password file:_files' + ) ;; esac _arguments -s -S $args && ret=0 -- cgit v1.2.3 From 394c55709e6cdb7e4b6994dc60763696581bf423 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 10 Aug 2020 13:01:15 +0200 Subject: 47293: lowercase completion descriptions for lp --- ChangeLog | 4 ++ Completion/Unix/Command/_lp | 159 ++++++++++++++++++++++---------------------- 2 files changed, 85 insertions(+), 78 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 6096f0c58..a871fef22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2020-08-10 Oliver Kiddle + + * 47293: Completion/Unix/Command/_lp: lowercase descriptions + 2020-08-10 Daniel Shahaf * 47308: Etc/zsh-development-guide: Document the new X-Seq diff --git a/Completion/Unix/Command/_lp b/Completion/Unix/Command/_lp index e84d9ad04..dd2bf5e1a 100644 --- a/Completion/Unix/Command/_lp +++ b/Completion/Unix/Command/_lp @@ -58,6 +58,9 @@ _lp_job_options() '6:rotated 180 degrees') _describe "orientation requested" desc_opts ;; + (job-sheets(|-*)) + compadd "$@" /usr/share/cups/banners/*(:t) + ;; (sides) compadd "$@" one-sided two-sided-{long,short}-edge ;; @@ -163,128 +166,128 @@ _lp() case $service in (lpq) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ - '(-a)-P+[Destination printer]:printers:_printers' \ - '(-P)-a[All printers]' \ - '-l[Long listing]' \ - '*:poll interval (+seconds):' + '(-a)-P+[destination printer]:printer:_printers' \ + '(-P)-a[all printers]' \ + '-l[long listing]' \ + '*:poll interval (+seconds)' ;; (lprm) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ - '-P+[Destination printer]:printers:_printers' \ - '*:job ids:_lp_list_jobs' + '-P+[destination printer]:printer:_printers' \ + '*:job id:_lp_list_jobs' ;; (lpoptions) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ - '(-p -l -r -x)-d+[Set default printer]:printers:_printers' \ - '(-l -x)*-o:job options:_lp_job_options' \ - '(-d -x)-p+[Destination printer for options]:printers:_printers' \ - '(-d -o -r -x)-l[List options]' \ + '(-p -l -r -x)-d+[set default printer]:printer:_printers' \ + '(-l -x)*-o:job option:_lp_job_options' \ + '(-d -x)-p+[destination printer for options]:printer:_printers' \ + '(-d -o -r -x)-l[list options]' \ '(-d -l -x)*-r:remove option:_lp_job_options' \ - '(-d -l -r -o)-x+[Remove all options]:printers:_printers' + '(-d -l -r -o)-x+[remove all options]:printer:_printers' ;; (lpstat) _arguments \ - '-E[Force encryption]' \ - '-R[Shows print job ranking]' \ + '-E[force encryption]' \ + '-R[shows print job ranking]' \ '-U:username (for connection to server):_users' \ - '-W:which jobs:(completed not-completed)' \ - '-a+[Show accepting state]:printers:_printers' \ - '-c:printer classes:' \ - '-d[Show current default destination]' \ + '-W:which job:(completed not-completed)' \ + '-a+[show accepting state]:printer:_printers' \ + '-c:printer class' \ + '-d[show current default destination]' \ '-h:hostname (alternate server):_hosts' \ - '-l[Long listing]' \ - '-o+[Destinations]:printers:_printers' \ - '-p+:printers:_printers' \ + '-l[long listing]' \ + '-o+[destinations]:printer:_printers' \ + '-p+:printer:_printers' \ '-r[CUPS server running status]' \ - '-s[Status summary]' \ - '-t[All status info]' \ - '-u[List jobs by users]:users:_users' \ - '-v+[Show devices]:printers:_printers' + '-s[status summary]' \ + '-t[all status info]' \ + '-u[list jobs by users]:user:_users' \ + '-v+[show devices]:printer:_printers' ;; (lpr) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-H:hostname (alternate server):_hosts' \ - '(-C -J -T)'-{C,J,T}':job name:' \ - '-P+[Destination printer]:printers:_printers' \ + '(-C -J -T)'-{C,J,T}':job name' \ + '-P+[destination printer]:printer:_printers' \ '-U:username (for connection to server):_users' \ - '-#[Copies]:copies (1--100):' \ - '-h[Disables banner printing]' \ - '-l[Raw file]' \ - '-m[Send an email on job completion]' \ - '*-o:print job options:_lp_job_options' \ - '-p[Format with shaded header incl. date, time etc.]' \ - '-q[Hold job for printing.]' \ - '-r[Delete files after printing]' \ - '*:PS/PDF files:_pspdf' + '-#[copies]:copies (1--100)' \ + '-h[disables banner printing]' \ + '-l[raw file]' \ + '-m[send an email on job completion]' \ + '*-o:print job option:_lp_job_options' \ + '-p[format with shaded header incl. date, time etc.]' \ + '-q[hold job for printing.]' \ + '-r[delete files after printing]' \ + '*:PS/PDF file:_pspdf' ;; (lp) _arguments \ - '-E[Force encryption]' \ - '-U[Username (for connection to server)]:username:_users' \ + '-E[force encryption]' \ + '-U[username (for connection to server)]:username:_users' \ '-c[(OBSOLETE) copy to spool dir before printing]' \ - '-d+[Destination printer]:printers:_printers' \ + '-d+[destination printer]:printer:_printers' \ '-h:hostname (alternate server):_hosts' \ - '-i[Job id to modify]:job id:' \ - '-m[Send an email on job completion]' \ - '-n[Copies]:copies (1--100):' \ - '*-o:print job options:_lp_job_options' \ - '-q[Job priority -- 1 (lowest) to 100 (highest)]:priority:' \ - "-s[Don't report resulting job IDs]" \ - '-t[Sets the job name]:job name:' \ - '-u[Job submission username]:username:_users' \ - '-H[Time to print]:print time (or enter hh\:mm):(hold immediate restart resume)' \ - '-P:page range list:' \ - '*:PS/PDF files:_pspdf' + '-i[job id to modify]:job id' \ + '-m[send an email on job completion]' \ + '-n[copies]:copies (1--100)' \ + '*-o:print job option:_lp_job_options' \ + '-q[job priority -- 1 (lowest) to 100 (highest)]:priority' \ + "-s[don't report resulting job IDs]" \ + '-t[set the job name]:job name' \ + '-u[job submission username]:username:_users' \ + '-H[time to print]:print time (or enter hh\:mm):(hold immediate restart resume)' \ + '-P:page range list' \ + '*:PS/PDF file:_pspdf' ;; (lpinfo) _arguments \ - '-E[Force encryption]' \ - '-U[Username (for connection to server)]:username:_users' \ + '-E[force encryption]' \ + '-U[username (for connection to server)]:username:_users' \ '-h:hostname (alternate server):_hosts' \ - '-l[Shows a "long" listing of devices or drivers]' \ - {--exclude-schemes,--include-schemes}'[Device/PPD schemes to filter from results]:scheme-list:' \ - '(-v --timeout)--device-id[IEEE-1284 device ID to match]:device-id-string:' \ - '(-v --timeout)--language:locale:' \ - '(-v --timeout)--product[Product to match]:name:' \ - '(-v --timeout)--make-and-model[Make and model to match]:name:' \ - '(-v --timeout)-m[List available drivers]' \ - '(-m --device-id --language --make-and-model --product)--timeout[Timeout when listing devices with -v]:timeout (seconds):' \ - '(-m --device-id --language --make-and-model --product)-v[List available devices]' + '-l[show a "long" listing of devices or drivers]' \ + {--exclude-schemes,--include-schemes}'[device/PPD schemes to filter from results]:scheme-list' \ + '(-v --timeout)--device-id[IEEE-1284 device ID to match]:device-id-string' \ + '(-v --timeout)--language:locale' \ + '(-v --timeout)--product[product to match]:name' \ + '(-v --timeout)--make-and-model[make and model to match]:name' \ + '(-v --timeout)-m[list available drivers]' \ + '(-m --device-id --language --make-and-model --product)--timeout[timeout when listing devices with -v]:timeout (seconds)' \ + '(-m --device-id --language --make-and-model --product)-v[list available devices]' ;; (lpadmin) _arguments \ - '-E[Force encryption/Enable destination]' \ - '-U[Username (for connection to server)]:username:_users' \ + '-E[force encryption/enable destination]' \ + '-U[username (for connection to server)]:username:_users' \ '-h:hostname (alternate server):_hosts' \ - '(-p -R -x -o)-d+[Default printer]:printers:_printers' \ - '(-d -x)-p+[Configure printer]:printers:_printers' \ - '(-p -R -d -o)-x+[Delete printer]:printers:_printers' \ - '(-x -d)-R[Name-default]:name-default:' \ - '-c:printer classes:' \ - '-m:model:' \ - '(-x -d)*-o:options:_lp_job_options' \ - '-r[Remove from class]:class:' \ - '-u[Access policy]:access policy:' \ - '-v[Device-uri of printer queue]:device-uri:' \ - '-D[Text description of destination]:info:' \ - '-L[Location of the printer]:location:' \ + '(-p -R -x -o)-d+[default printer]:printer:_printers' \ + '(-d -x)-p+[configure printer]:printer:_printers' \ + '(-p -R -d -o)-x+[delete printer]:printer:_printers' \ + '(-x -d)-R[name-default]:name-default' \ + '-c:printer class' \ + '-m:model' \ + '(-x -d)*-o:option:_lp_job_options' \ + '-r[remove from class]:class' \ + '-u[access policy]:access policy' \ + '-v[device-uri of printer queue]:device-uri' \ + '-D[text description of destination]:info' \ + '-L[location of the printer]:location' \ '-P[PPD file to use]:PPD file:_files "*.(#i)ppd(-.)"' esac } -- cgit v1.2.3 From 478d38006a982b3af09675f1fea105e7a7d1ab4b Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 13 Aug 2020 22:09:08 +0200 Subject: 47319: complete more options to ImageMagick's convert command --- ChangeLog | 5 +++++ Completion/Unix/Command/_imagemagick | 7 +++++++ 2 files changed, 12 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 9abd960aa..685acc48d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-08-13 Oliver Kiddle + + * 47319: Completion/Unix/Command/_imagemagick: complete more + options to ImageMagick's convert command + 2020-08-10 Oliver Kiddle * 47294: Completion/Debian/Command/_aptitude: updates to options diff --git a/Completion/Unix/Command/_imagemagick b/Completion/Unix/Command/_imagemagick index 3afa108ae..b7671fe49 100644 --- a/Completion/Unix/Command/_imagemagick +++ b/Completion/Unix/Command/_imagemagick @@ -262,7 +262,10 @@ case "$service" in _arguments -C -M 'm:{a-z}={A-Z}' \ '-adjoin[join images]' \ '-affine[drawing transform matrix]:matrix' \ + '-alpha[set the alpha channel]:alpha' \ '-antialias[remove pixel aliasing]' \ + '-authenticate[decrypt image with specified password]:password' \ + '-attenuate[lessen (or intensify) when adding noise to an image]:value' \ '-append[append image sequence]' \ '-average[average image sequence]' \ '-background[specify background color]:color:_x_color' \ @@ -301,6 +304,7 @@ case "$service" in '(-endian)+endian' \ '-enhance[enhance image]' \ '-equalize[histogram equalization]' \ + '-features[analyze image features (e.g. contrast, correlation)]:distance' \ '-fill[specify color to use when filling a graphic primitive]:color:_x_color' \ '-filter:filter type for resizing:(Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc)' \ '-flatten[flatten a sequence of images]' \ @@ -315,12 +319,14 @@ case "$service" in '-gravity:image gravity:(Center North NorthEast East SouthEast South SouthWest West NorthWest)' \ '-implode:implosion factor (0.0 - 99.9%%)' \ '-interlace:interlacing scheme:(None Line Plane Partition)' \ + '-interpolative-resize[resize image using point sampled interpolation]:geometry' \ '-label:label string' \ '-layer:layer type:(Red Green Blue Matte)' \ '-linewidth:line width' \ '-loop:number of iterations (GIF animation)' \ '-map[single image colormap file]:picture file for colors:_imagemagick' \ '+map[all images colormap file]:picture file for colors:_imagemagick' \ + '-mask[associate a mask with the image]:file:_files' \ '-matte[store matte channel]' \ '-modulate:,,' \ '-monochrome[transform to black and white]' \ @@ -352,6 +358,7 @@ case "$service" in '-size:image size (x+)' \ '-solarize:solarization threshold' \ '-spread:neighborhood size' \ + '-support[specify resize support]:support (>1.0 is blurry, < 1.0 is sharp)' \ '-swirl:swirl tightness' \ '-texture:background texture image:_imagemagick' \ '-threshold:threshold for maximum intensity' \ -- cgit v1.2.3 From edb5459d618257c44d33cd02901b46bbbfa100f4 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 21 Aug 2020 17:41:08 +0200 Subject: 47322: allow prefix with ssh cipher completion and add matching control for options --- ChangeLog | 5 +++++ Completion/Unix/Command/_ssh | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 147b4c9be..8c5b64920 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-08-21 Oliver Kiddle + + * 47322: Completion/Unix/Command/_ssh: allow prefix with ssh + cipher completion and add matching control for options + 2020-08-18 Daniel Shahaf * 47323: Completion/Redhat/Command/_rpm: _rpmbuild: Complete diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index 0775590e6..642f11bcb 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -269,8 +269,8 @@ _ssh () { if compset -P 1 '*='; then case "${IPREFIX#-o}" in (#i)(ciphers|macs|kexalgorithms|hostkeyalgorithms|pubkeyacceptedkeytypes|hostbasedkeytypes)=) - if ! compset -P +; then - _wanted append expl 'append to default' compadd + && ret=0 + if ! compset -P '[+-]'; then + _wanted prefix expl 'relative to default' compadd - + - && ret=0 fi ;; esac @@ -475,7 +475,7 @@ _ssh () { else # old options are after the empty "\"-line _wanted values expl 'configure file option' \ - compadd -M 'm:{a-z}={A-Z}' -q -S '=' - \ + compadd -M 'm:{a-z}={A-Z} r:[^A-Z]||[A-Z]=* r:|=*' -q -S '=' - \ AddKeysToAgent \ AddressFamily \ BatchMode \ -- cgit v1.2.3 From 17ee9c5f68d18ef48c1ef99ae6162a06675104f2 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 4 Sep 2020 19:56:27 +0100 Subject: 47350: new dropbox command line client completion --- ChangeLog | 4 +++ Completion/Unix/Command/_dropbox | 66 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 Completion/Unix/Command/_dropbox (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 8b5e11c63..2d7bf8b46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2020-09-04 Peter Stephenson + + * 47350; Completion/Unix/Command/_dropbox: new completion. + 2020-08-28 Daniel Shahaf * github #64: Src/Modules/curses_keys.awk: Fix a build-time diff --git a/Completion/Unix/Command/_dropbox b/Completion/Unix/Command/_dropbox new file mode 100644 index 000000000..115f9eb45 --- /dev/null +++ b/Completion/Unix/Command/_dropbox @@ -0,0 +1,66 @@ +#compdef dropbox + +if [[ CURRENT -eq 2 || $words[2] = help ]]; then + local -a line progs + + _call_program command dropbox help | + while read -A line; do + if [[ $line[1] = [a-z]## ]]; then + progs+=("${line[1]}:${line[2,-1]}") + fi + done + + _describe -t command 'Dropbox command' progs +else + local -a opts + + case $words[2] in + (exclude) + _path_files -g '*(/)' + ;; + + (filestatus) + shift words + (( CURRENT-- )) + _arguments -s : \ + '(-l --list)'{-l,--list}'[use format like ls]' \ + '(-a --all)'{-a,--all}'[do not ignore entries starting .]' \ + '*:File to list:_files' + ;; + + (ls|puburl|sharelink) + _files + ;; + + (autostart|lansync) + opts=("y:turn $words[2] on" "n:turn $words[2] off") + _describe "$words[2] behaviour" opts + ;; + + (proxy) + _arguments \ + '2:proxy mode:(none auto manual)' \ + '3:proxy type for manual mode:(http socks4 socks5)' \ + '4:proxy host for manual mode:_hosts' \ + '5:proxy port for manual mode:_ports' \ + '6:proxy user for manual mode:_users' \ + '7:proxy password for manual mode:' + ;; + + (start) + shift words + (( CURRENT-- )) + _arguments -s : '(-i --install)'{-i,--install}'[auto install dropboxd]' + ;; + + (throttle) + _arguments \ + '2:download limit in KB/s:(unlimited)' \ + '3:upload limit in KB/s:(unlimited)' + ;; + + (*) + _default + ;; + esac +fi -- cgit v1.2.3 From 0673212f4296275de1cf9935446580930109c9a5 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 6 Sep 2020 03:23:08 +1000 Subject: unposted: remove periods from completion descriptions As per the completion-style-guide recommendations. --- ChangeLog | 8 ++++++++ Completion/Unix/Command/_lp | 2 +- Completion/Unix/Command/_transmission | 2 +- Completion/X/Command/_code | 2 +- Completion/X/Command/_kdeconnect | 2 +- Completion/Zsh/Command/_zstyle | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 2d7bf8b46..e97ac7eb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2020-09-05 Doug Kearns + + * unposted: Completion/Unix/Command/_lp, + Completion/Unix/Command/_transmission, Completion/X/Command/_code, + Completion/X/Command/_kdeconnect, Completion/Zsh/Command/_zstyle: + Remove periods from completion descriptions as per the + completion-style-guide recommendations. + 2020-09-04 Peter Stephenson * 47350; Completion/Unix/Command/_dropbox: new completion. diff --git a/Completion/Unix/Command/_lp b/Completion/Unix/Command/_lp index dd2bf5e1a..914d63ff2 100644 --- a/Completion/Unix/Command/_lp +++ b/Completion/Unix/Command/_lp @@ -230,7 +230,7 @@ _lp() '-m[send an email on job completion]' \ '*-o:print job option:_lp_job_options' \ '-p[format with shaded header incl. date, time etc.]' \ - '-q[hold job for printing.]' \ + '-q[hold job for printing]' \ '-r[delete files after printing]' \ '*:PS/PDF file:_pspdf' ;; diff --git a/Completion/Unix/Command/_transmission b/Completion/Unix/Command/_transmission index 8a4bebec3..400c24b66 100644 --- a/Completion/Unix/Command/_transmission +++ b/Completion/Unix/Command/_transmission @@ -97,7 +97,7 @@ local torrent_action_only_actions=( {-Bn,--bandwidth-normal}'[give this torrent the bandwidth left over by high priority torrents]' {-Bl,--bandwidth-low}'[give this torrent the bandwidth left over by high and normal priority torrents]' {-ph,--priority-high}'[try to download the specified file(s) first]:torrent_file:_transmission-remote_torrent_priority_not_high' - {-pn,--priority-normal}'[try to download the specified files normally.]:torrent_file:_transmission-remote_torrent_priority_not_normal' + {-pn,--priority-normal}'[try to download the specified files normally]:torrent_file:_transmission-remote_torrent_priority_not_normal' {-pl,--priority-low}'[try to download the specified files last]:torrent_file:_transmission-remote_torrent_priority_not_low' {-v,--verify}'[verify the current torrent(s)]' ) diff --git a/Completion/X/Command/_code b/Completion/X/Command/_code index b725b2a17..76cd3dd19 100644 --- a/Completion/X/Command/_code +++ b/Completion/X/Command/_code @@ -4,7 +4,7 @@ local arguments arguments=( '(-d --diff)'{-d,--diff}'[compare two files with each other]:file to compare:_files:file to compare with:_files' - \*{-a,--add}'[add specified directory to the last active window.]:directory:_directories' + \*{-a,--add}'[add specified directory to the last active window]:directory:_directories' '(-g --goto)'{-g,--goto}'[open a file at the path on the specified line and column position]:file\:line[\:column]:_files -r \:' '(-n --new-window -r --reuse-window)'{-n,--new-window}'[open a new window]' '(-n --new-window -r --reuse-window)'{-r,--reuse-window}'[open a file or directory in the last active window]' diff --git a/Completion/X/Command/_kdeconnect b/Completion/X/Command/_kdeconnect index ffb7f5774..ee186690c 100644 --- a/Completion/X/Command/_kdeconnect +++ b/Completion/X/Command/_kdeconnect @@ -10,7 +10,7 @@ _arguments \ '--id-only[make --list-devices or --list-available print only the devices id, to ease scripting]' \ '--refresh[search for devices in the network and re-establish connections]' \ '(--pair --unpair)--pair[request pairing with the specified device]' \ - '--ring[find the device by ringing it.]' \ + '--ring[find the device by ringing it]' \ '(--pair --unpair)--unpair[stop pairing to the specified device]' \ '(--ping --ping-msg)--ping[send a ping to the device]' \ '(--ping --ping-msg)--ping-msg[send a ping to the device with the specified message]:message' \ diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle index bb871762e..75acde5f7 100644 --- a/Completion/Zsh/Command/_zstyle +++ b/Completion/Zsh/Command/_zstyle @@ -659,7 +659,7 @@ while (( $#state )); do 'p[name of top-most patch (applied-string)]' \ 'u[number of unapplied patches (unapplied-string)]' \ 'n[number of applied patches]' \ - 'c[number of unapplied patches.]' \ + 'c[number of unapplied patches]' \ 'a[number of all patches]' \ 'g[names of active mq guards (hg backend)]' \ 'G[number of active mq guards (hg backend)]' -- cgit v1.2.3 From 59a451abae442892e35b13844a612c7723ce699c Mon Sep 17 00:00:00 2001 From: Meng Bo Date: Mon, 21 Sep 2020 15:17:00 +0800 Subject: github #65: _nmap: Rename option flags (s/_/-/g) Nmap commands that previously included an underscore (--max_rtt_timeout, --send_eth, --host_timeout, etc.) have been renamed to use a hyphen in the preferred format. --- ChangeLog | 5 +++++ Completion/Unix/Command/_nmap | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 047e6c1d4..3f69f73a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-09-23 Meng Bo + + * github #65: Completion/Unix/Command/_nmap: Rename option flags + (s/_/-/g) + 2020-09-22 Jacob Menke * 47395: Completion/Base/Utility/_store_cache: Don't leak the diff --git a/Completion/Unix/Command/_nmap b/Completion/Unix/Command/_nmap index b3d3d488a..2a507baa3 100644 --- a/Completion/Unix/Command/_nmap +++ b/Completion/Unix/Command/_nmap @@ -17,7 +17,7 @@ _arguments -C \ '-h[show help information]' \ '*-o-[log results]:log format:->log-forms:log filename:_files' \ '--resume[resume cancelled scan]:log filename:_files' \ - '--append_output[append results to any log files]' \ + '--append-output[append results to any log files]' \ '-iL[read target specifications from file]:file:_files' \ '-iR[scan random hosts]:num hosts' \ '-p[specify ports to try]:port numbers' \ @@ -26,24 +26,24 @@ _arguments -C \ '-S[specify source address]:address:_hosts' \ '-e[specify interface to use]:network interface:_net_interfaces' \ '-g[specify source port number]:port number' \ - '--data_length[add random data to packets]:data length' \ + '--data-length[add random data to packets]:data length' \ '(-R)-n[skip reverse DNS to speed things up]' \ '(-n)-R[always do reverse DNS on targets]' \ "-r[don't randomize order in which ports are scanned]" \ '-ttl[specify IPv4 time to live for sent packets]' \ - '--randomize_hosts[scan hosts in random order]' \ + '--randomize-hosts[scan hosts in random order]' \ '-M[specify maximum number of parallel TCP connects]:maximum TCP connects' \ - '--packet_trace[show all packets sent in tcpdump-like format]' \ - '--version_trace[show packets related to version scanning]' \ + '--packet-trace[show all packets sent in tcpdump-like format]' \ + '--version-trace[show packets related to version scanning]' \ '--datadir[specify directory containing data files]:directory:_directories' \ '-T[specify timing policy]:timing policy:(Paranoid Sneaky Polite Normal Aggressive Insane)' \ - '--host_timeout[specify maximum time for scanning a single host]:timeout (ms)' \ - '--max_rtt_timeout[maximum time for a probe response]:timeout (ms)' \ - '--min_rtt_timeout[minimum time to wait for a probe response]:time (ms)' \ - '--initial_rtt_timeout[specify initial probe timeout]:timeout (ms)' \ - '--max_parallelism[specify max number of scans to perform in parallel]:number' \ - '--min_parallelism[scan at least specified number of ports in parallel]:number' \ - '--scan_delay[specify minimum amount of time between probes]:delay (ms)' \ + '--host-timeout[specify maximum time for scanning a single host]:timeout (ms)' \ + '--max-rtt-timeout[maximum time for a probe response]:timeout (ms)' \ + '--min-rtt-timeout[minimum time to wait for a probe response]:time (ms)' \ + '--initial-rtt-timeout[specify initial probe timeout]:timeout (ms)' \ + '--max-parallelism[specify max number of scans to perform in parallel]:number' \ + '--min-parallelism[scan at least specified number of ports in parallel]:number' \ + '--scan-delay[specify minimum amount of time between probes]:delay (ms)' \ '--interactive[go into interactive mode]' \ '*:host:_hosts' && ret=0 -- cgit v1.2.3 From 2644e3097dd26babf73ea8664f30341b262a2450 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 29 Oct 2020 21:44:19 +0100 Subject: users/26107: complete changed files after git diff HEAD --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 9db67eea0..b7283a07e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-10-29 Oliver Kiddle + + * users/26107: Completion/Unix/Command/_git: complete changed + files after git diff HEAD + 2020-10-25 Mikael Magnusson * Jun-ichi Takimoto: 47301: Src/builtin.c: Fix print -v diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 05e2a2361..81a060e4d 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -806,11 +806,14 @@ _git-diff () { # Example: git diff branch1..branch2 __git_tree_files ${PREFIX:-.} $(__git_committish_range_last $line[1]) && ret=0 elif __git_is_committish $line[1] || __git_is_treeish $line[1]; then + local files_alt='files::__git_tree_files ${PREFIX:-.} HEAD' + [[ $line[1] = (HEAD|@) ]] && + files_alt='files::__git_changed_files' # Example: git diff branch1 _alternative \ 'commits::__git_commits' \ 'blobs-and-trees-in-treeish::__git_blobs_and_trees_in_treeish' \ - 'files::__git_tree_files ${PREFIX:-.} HEAD' && ret=0 + $files_alt && ret=0 elif __git_is_blob $line[1]; then _alternative \ 'files::__git_cached_files' \ @@ -831,6 +834,10 @@ _git-diff () { __git_is_treeish $line[2]; then # Example: git diff branch1 branch2 __git_tree_files ${PREFIX:-.} $line[2] && ret=0 + elif [[ $line[1] = (HEAD|@) ]]; then + # Example: git diff @ file1 + # Example: git diff HEAD -- + __git_ignore_line __git_changed_files && ret=0 elif __git_is_committish $line[1] || __git_is_treeish $line[1]; then # Example: git diff branch file1 # Example: git diff branch -- f -- cgit v1.2.3 From 93c4cc0d8f1ad92f5f407a50e98d62bdc7d5c1b4 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Mon, 1 Feb 2021 09:40:34 +0900 Subject: 47883: _awk: support gawk ver.5 --- ChangeLog | 4 ++++ Completion/Unix/Command/_awk | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 2d69f05eb..52ebf9513 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2021-01-20 Jun-ichi Takimoto + + * 47883: Completion/Unix/Command/_awk: support gawk ver.5 + 2021-01-27 Peter Stephenson * 47873: Completion/Base/Core/_main_complete, diff --git a/Completion/Unix/Command/_awk b/Completion/Unix/Command/_awk index dcb2a6c21..e8f4a2530 100644 --- a/Completion/Unix/Command/_awk +++ b/Completion/Unix/Command/_awk @@ -1,6 +1,6 @@ #compdef awk gawk nawk -# For gawk ver.3 and 4, in addition to POSIX. +# For gawk ver.3 to 5, in addition to POSIX. # # gawk's options '-W ...' (such as '-W help') are not supported. # gawk3 has some synonyms for long options (e.g., --compat is a synonym @@ -14,7 +14,7 @@ local variant curcontext="$curcontext" state state_descr line ret=1 local -A opt_args local -a args -_pick_variant -r variant gawk4='GNU Awk 4' gawk3='GNU Awk 3' posix --version +_pick_variant -r variant gawk4='GNU Awk [45]' gawk3='GNU Awk 3' posix --version args=( {-F+,--field-separator}'[define input field separator by extended regex]:extended regular expression:' -- cgit v1.2.3 From 4bea58d0c41f5b0d1bb70244c51f956f60b576e4 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sat, 6 Feb 2021 00:22:15 +0100 Subject: 47919: use common function for completing BSD login classes also update for options to env on FreeBSD and Dragonfly --- ChangeLog | 6 ++++++ Completion/BSD/Type/_login_classes | 4 ++++ Completion/Unix/Command/_env | 34 +++++++++++++++++++++++++++------- Completion/Unix/Command/_pgrep | 3 +-- Completion/Unix/Command/_su | 2 +- Completion/Unix/Command/_user_admin | 2 +- 6 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 Completion/BSD/Type/_login_classes (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 08c18dba8..40c58037d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2021-02-06 Oliver Kiddle + * 47919: Completion/BSD/Type/_login_classes, + Completion/Unix/Command/_env, Completion/Unix/Command/_pgrep, + Completion/Unix/Command/_su, Completion/Unix/Command/_user_admin: + use common function for completing BSD login classes and update for + options to env + * 47918: Completion/Linux/Command/_nsenter, Completion/Linux/Command/_unshare: new util-linux completions diff --git a/Completion/BSD/Type/_login_classes b/Completion/BSD/Type/_login_classes new file mode 100644 index 000000000..227e3c748 --- /dev/null +++ b/Completion/BSD/Type/_login_classes @@ -0,0 +1,4 @@ +#autoload + +_description login-classes expl 'login class' +compadd "$@" "$expl[@]" - ${${(M)${(f)"$(user-class' + '-U[add variables from user and system login.conf(5)]: :->user-class' + ) + ;| + freebsd*|darwin*|dragonfly*) + args+=( '(-i)*-u+[remove variable from the environment]:env var to remove:_parameters -g "*export*"' '-P+[specify alternate executable search PATH]:path:_dir_list' '-S+[perform word splitting]:string to split' @@ -44,11 +52,23 @@ _arguments $args \ '*::arguments:->normal' && ret=0 if [[ -n $state ]]; then - while [[ $words[1] = *=* ]]; do - shift words - (( CURRENT-- )) - done - _normal && ret=0 + case $state in + normal) + while [[ $words[1] = *=* ]]; do + shift words + (( CURRENT-- )) + done + _normal && ret=0 + ;; + user-class) + if compset -P 1 '*/'; then + _login_classes && ret=0 + else + compset -S '/*' || suf=( -qS/ ) + _users $suf && ret=0 + fi + ;; + esac fi return ret diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index 3f00b21dc..49184307f 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -5,7 +5,6 @@ # (which changed the behaviour of -f and added -a) # - We don't really need to keep pgopts and pkopts separate, but it seems like # it should make things a bit easier to follow -# - @todo We could complete log-in classes given to -c # - @todo We could complete routing tables given to -T local curcontext="$curcontext" state line ret=1 expl pgopts pkopts no @@ -18,7 +17,7 @@ typeset -a arguments sig_arguments aopts # overridden below arguments=( '-a[include process ancestors in match list]' - '-c+[match only on specified login class]:login class' + '-c+[match only on specified login class]:login class:_login_classes' '(-F --pidfile)'{-F+,--pidfile=}'[match only processes in specified PID file]:PID file:_files' '(-f --full)'{-f,--full}'[match against full command line]' '(-G --group)'{-G+,--group=}'[match only on specified real group IDs]: :_sequence _groups' diff --git a/Completion/Unix/Command/_su b/Completion/Unix/Command/_su index 066f5c3b6..1af751a17 100644 --- a/Completion/Unix/Command/_su +++ b/Completion/Unix/Command/_su @@ -35,7 +35,7 @@ case $OSTYPE in ;| *bsd*|dragonfly*) args+=( - '-c+[use settings from specified login class]:class' + '-c+[use settings from specified login class]:class:_login_classes' ) ;| freebsd*) args+=( '-s[set the MAC label]' ) ;; diff --git a/Completion/Unix/Command/_user_admin b/Completion/Unix/Command/_user_admin index c7e1efc80..db1c977ad 100644 --- a/Completion/Unix/Command/_user_admin +++ b/Completion/Unix/Command/_user_admin @@ -54,7 +54,7 @@ case ${service%???}:${(M)service%???}:$OSTYPE in ;| user:*:(net|open)bsd*) args+=( - '-L[specify login class]:login class' + '-L[specify login class]:login class:_login_classes' '-p+[specify encrypted password]:encrypted password' ) ;| -- cgit v1.2.3 From 645c89af6d2bda2e02a02656e1af70f9d99e0355 Mon Sep 17 00:00:00 2001 From: aaaz Date: Sun, 10 Jan 2021 17:38:37 +0000 Subject: gitlab !16: Allow spaces between short options and their parameters in _transmission This matches the summary listed in the `transmission-remote` man page and the program's actual behavior. --- ChangeLog | 6 ++++++ Completion/Unix/Command/_transmission | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 40c58037d..436457a01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2021-02-07 Oliver Kiddle + + * gitlab !16: aaaz : + Completion/Unix/Command/_transmission: allow spaces between short + options and their parameters in transmission completion + 2021-02-06 Oliver Kiddle * 47919: Completion/BSD/Type/_login_classes, diff --git a/Completion/Unix/Command/_transmission b/Completion/Unix/Command/_transmission index 400c24b66..8951eacb0 100644 --- a/Completion/Unix/Command/_transmission +++ b/Completion/Unix/Command/_transmission @@ -6,9 +6,9 @@ local exclusive_auth_options='(-n --auth -ne --authenv -N --netrc)' local general_options=( {-d,--debug}'[enable debugging mode]' - $exclusive_auth_options{-n-,--auth=}'[set the username and password for authentication]:username\:password: ' + $exclusive_auth_options{-n+,--auth=}'[set the username and password for authentication]:username\:password: ' $exclusive_auth_options{-ne,--authenv}'[set the authentication information from the TR_AUTH environment variable]' - $exclusive_auth_options{-N-,--netrc=}'[set the authentication information from a netrc file]:file:_files' + $exclusive_auth_options{-N+,--netrc=}'[set the authentication information from a netrc file]:file:_files' '--find[tell Transmission where to look for the current torrents'"'"' data]' ) # `general_actions`: *actions* that can be specified when a specific set of torrents is either specified or either not @@ -16,7 +16,7 @@ local general_actions=( '(- :)'{-gsr,--global-seedratio}'[all torrents, unless overridden by a per-torrent setting, should seed until a specific ratio]:ratio:{_message "ratio in kB/sec"}' '(- :)'{-GSR,--no-global-seedratio}'[all torrents, unless overridden by a per-torrent setting, should seed regardless of ratio]' '(- :)'{-pr,--peers}'[set the maximum number of peers]:number: ' - '(- :)'{-d-,--downlimit=}'[limit the maximum download speed to limit kB/s]:limit:{_message "limit in kB/sec"}' + '(- :)'{-d+,--downlimit=}'[limit the maximum download speed to limit kB/s]:limit:{_message "limit in kB/sec"}' '(- :)'{-D,--no-downlimit}'[disable download speed limits]' ) # `global_only_actions`: *actions* that can be specified only when no specific torrent is specified @@ -32,7 +32,7 @@ local global_only_actions=( '(- :)--alt-speed-days[set the number of days on which to enable the speed scheduler]:days:_transmission-remote_days' '(- :)--torrent-done-script[specify a file to run each time a torrent finishes]:script:_files' '(- :)--no-torrent-done-script[don'"'"'t run any script when a torrent finishes]' - '(- :)'{-e-,--cache=}'[set the session'"'"'s maximum memory cache size in MiB]:size (MiB):' + '(- :)'{-e+,--cache=}'[set the session'"'"'s maximum memory cache size in MiB]:size (MiB):' '(- :)'{-er,--encryption-required}'[encrypt all peer connections]' '(- :)'{-ep,--encryption-preferred}'[prefer encrypted peer connections]' '(- :)'{-et,--encryption-tolerated}'[prefer unencrypted peer connections]' @@ -42,7 +42,7 @@ local global_only_actions=( {-t,--torrent=}'[set the current torrent(s) for use by subsequent options]:torrent:_transmission-remote_torrent' '(- :)'{-si,--session-info}'[list session information from the server]' '(- :)'{-st,--session-stats}'[list statistical information from the server]' - {-a-,--add=}'[add torrents to transmission]:filename\|url:_transmission-remote_add' + {-a+,--add=}'[add torrents to transmission]:filename\|url:_transmission-remote_add' '(- :)'{-l,--list}'[list all torrents]' '(- :)'{-p,--port}'[set the port for use when listening for incoming peer connections]:port:' '(- :)--start-paused[start added torrents paused]' @@ -65,9 +65,9 @@ local global_only_actions=( ) # `torrent_add_options`: *options* that can be used only when *adding* a torrent local torrent_add_options=( - '(-C --no-incomplete-dir)'{-c-,--incomplete-dir=}'[when adding new torrents, store their contents in directory until the torrent is done]:dir:{_files -/}' + '(-C --no-incomplete-dir)'{-c+,--incomplete-dir=}'[when adding new torrents, store their contents in directory until the torrent is done]:dir:{_files -/}' '(-c --incomplete-dir)'{-C,--no-incomplete-dir}'[don'"'"'t store incomplete torrents in a different directory]' - {-w-,--download-dir=}'[when used in conjunction with --add, set the new torrent'"'"'s download folder]:dir:{_files -/}' + {-w+,--download-dir=}'[when used in conjunction with --add, set the new torrent'"'"'s download folder]:dir:{_files -/}' ) # `torrent_action_only_actions`: *actions* that can be specified only when explicitly selecting a specific set of torrents local torrent_action_only_actions=( @@ -81,15 +81,15 @@ local torrent_action_only_actions=( {-it,--info-trackers}'[list the specified torrent'"'"'s trackers]' '--trash-torrent[delete torrents after adding]' '--no-trash-torrent[do not delete torrents after adding]' - {-td-,--tracker-add=}'[add a tracker to a torrent]:tracker:_urls' - {-tr-,--tracker-remove=}'[remove a tracker from a torrent]:tracker_id:_transmission-remote_torrent_tracker_id' + {-td+,--tracker-add=}'[add a tracker to a torrent]:tracker:_urls' + {-tr+,--tracker-remove=}'[remove a tracker from a torrent]:tracker_id:_transmission-remote_torrent_tracker_id' {-s,--start}'[start the current torrent(s)]' {-S,--stop}'[stop the current torrent(s) from downloading or seeding]' {-r,--remove}'[remove the current torrent(s) without deleting the downloaded data]' {-rad,--remove-and-delete}'[remove the current torrent(s) and delete the downloaded data]' '--reannounce[reannounce the current torrent(s)]' '--move[move the current torrents'"'"' data from their current locations to the specified directory]:{_files -/}' - {-sr-,--seedratio=}'[let the current torrent(s) seed until a specific ratio]:ratio:{_message "ratio in kB/sec"}' + {-sr+,--seedratio=}'[let the current torrent(s) seed until a specific ratio]:ratio:{_message "ratio in kB/sec"}' {-SR,--no-seedratio}'[let the current torrent(s) use the global seedratio settings]' {-hl,--honor-session}'[make the current torrent(s) honor the session limits]' {-HL,--no-honor-session}'[make the current torrent(s) not honor the session limits]' -- cgit v1.2.3 From ed160f268a45ddf9bfbad27c6f93c90263d56b17 Mon Sep 17 00:00:00 2001 From: Semnodime Date: Fri, 22 Jan 2021 16:09:52 +0100 Subject: github #72: Fix unix command lldb tab-completion The --arguments are space (` `) separated, not equal-sign (`=`) separated. lldb --correct c_arg --wrong=w_arg --- ChangeLog | 3 +++ Completion/Unix/Command/_lldb | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 436457a01..b1f98d233 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-02-07 Oliver Kiddle + * github #72 (tweaked): Semnodime: Completion/Unix/Command/_lldb: + fix unix command lldb tab-completion, args are space separated + * gitlab !16: aaaz : Completion/Unix/Command/_transmission: allow spaces between short options and their parameters in transmission completion diff --git a/Completion/Unix/Command/_lldb b/Completion/Unix/Command/_lldb index 0426f69f2..eae8e1d3a 100644 --- a/Completion/Unix/Command/_lldb +++ b/Completion/Unix/Command/_lldb @@ -6,12 +6,12 @@ typeset -a opts args [[ $EUID = 0 || $_comp_priv_prefix[1] = sudo ]] && opts=( -a ) args=( - '*'{-o+,--one-line=}'[run one-line lldb command after loading executable]:lldb command: ' - '*'{-s+,--source=}'[run lldb commands from a file after loading executable]:file:_files' - '*'{-O+,--one-line-before-file=}'[run one-line lldb command before loading executable]:lldb command' - '*'{-S+,--source-before-file=}'[run lldb commands from a file before loading executable]:file:_files' - '(-k --one-line-on-crash)'{-k+,--one-line-on-crash=}'[run one-line lldb command if target crashes in batch mode]:lldb command' - '(-K --source-on-crash)'{-K+,--source-on-crash=}'[run lldb commands from a file if target crashes in batch mode]:file:_files' + '*'{-o+,--one-line}'[run one-line lldb command after loading executable]:lldb command: ' + '*'{-s+,--source}'[run lldb commands from a file after loading executable]:file:_files' + '*'{-O+,--one-line-before-file}'[run one-line lldb command before loading executable]:lldb command' + '*'{-S+,--source-before-file}'[run lldb commands from a file before loading executable]:file:_files' + '(-k --one-line-on-crash)'{-k+,--one-line-on-crash}'[run one-line lldb command if target crashes in batch mode]:lldb command' + '(-K --source-on-crash)'{-K+,--source-on-crash}'[run lldb commands from a file if target crashes in batch mode]:file:_files' '(-b --batch)'{-b,--batch}'[run commands from -s -S -o -O and quit]' '(-Q --source-quietly)'{-Q,--source-quietly}'[suppress output from -s, -S, -o or -O]' '(-e --editor)'{-e,--editor}'[open source files using "external editor" mechanism]' @@ -19,21 +19,21 @@ args=( '(-X --no-use-colors)'{-X,--no-use-colors}'[do not use colors]' '(-d --debug)'{-d,--debug}'[print extra information for debugging itself]' '(-r --repl)'{-r,--repl}'[run lldb in REPL mode]' - '(-l --script-language)'{-l+,--script-language=}'[use the specified scripting language]:language:(Python Perl Ruby Tcl)' + '(-l --script-language)'{-l+,--script-language}'[use the specified scripting language]:language:(Python Perl Ruby Tcl)' - info '(-)'{-h,--help}'[print the usage information]' '(-)'{-v,--version}'[print the current version number]' '(-)'{-P,--python-path}'[print path to the lldb.py file]' - file - '(-f --file)'{-f+,--file=}'[specify executable file to debug]:executable:_files -g "*(-*)"' - '(-a --arch)'{-a+,--arch=}'[use the specified architecture]:arch' - '(-c --core)'{-c+,--core=}'[specify core file to open]:core file:_files -g "*core*(-.)"' + '(-f --file)'{-f+,--file}'[specify executable file to debug]:executable:_files -g "*(-*)"' + '(-a --arch)'{-a+,--arch}'[use the specified architecture]:arch' + '(-c --core)'{-c+,--core}'[specify core file to open]:core file:_files -g "*core*(-.)"' '*::executable and arguments:->exe_args' - name - '(-n --attach-name)'{-n+,--attach-name=}"[attach to the named process]: :_process_names $opts" + '(-n --attach-name)'{-n+,--attach-name}"[attach to the named process]: :_process_names $opts" '(-w --wait-for)'{-w,--wait-for}'[wait for the specified process to launch]' - pid - '(-p --attach-pid)'{-p+,--attach-pid=}'[attach to the specified process]:pid:_pids' + '(-p --attach-pid)'{-p+,--attach-pid}'[attach to the specified process]:pid:_pids' ) _arguments -C -s -S : $args && return 0 -- cgit v1.2.3 From f59b6f6df3f3de609b261de41dcfb6029c4d523b Mon Sep 17 00:00:00 2001 From: DCsunset Date: Sun, 29 Nov 2020 21:22:17 +0800 Subject: github #66: Add more commands to _todo.sh --- ChangeLog | 3 +++ Completion/Unix/Command/_todo.sh | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 2949b72a2..1c7ee05a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-02-07 Oliver Kiddle + * github #66: DCsunset: Completion/Unix/Command/_todo.sh: + Add more commands to _todo.sh + * github #63: oxiedi@yandex.ru: Completion/Base/Utility/_values: fix regression caused by 44274, with sort style -o may be passed diff --git a/Completion/Unix/Command/_todo.sh b/Completion/Unix/Command/_todo.sh index 287c9ff78..99b6bb695 100644 --- a/Completion/Unix/Command/_todo.sh +++ b/Completion/Unix/Command/_todo.sh @@ -55,21 +55,26 @@ case $state in "append:adds to item on line NUMBER the text TEXT." "archive:moves done items from todo.txt to done.txt." "command:run internal commands only" + "deduplicate:removes duplicate lines from todo.txt." "del:deletes the item on line NUMBER in todo.txt." "depri:remove prioritization from item" + "done:marks task(s) on line ITEM# as done in todo.txt" "do:marks item on line NUMBER as done in todo.txt." "help:display help" "list:displays all todo items containing TERM(s), sorted by priority." "listall:displays items including done ones containing TERM(s)" + "listaddons:lists all added and overridden actions in the actions directory." "listcon:list all contexts" "listfile:display all files in .todo directory" "listpri:displays all items prioritized at PRIORITY." + "listproj:lists all the projects in todo.txt." "move:move item between files" "prepend:adds to the beginning of the item on line NUMBER text TEXT." "pri:adds or replace in NUMBER the priority PRIORITY (upper case letter)." "replace:replace in NUMBER the TEXT." "remdup:remove exact duplicates from todo.txt." "report:adds the number of open and done items to report.txt." + "showhelp:list the one-line usage of all built-in and add-on actions." ) _describe -t todo-commands 'todo.sh command' cmdlist ;; @@ -98,7 +103,7 @@ case $state in fi ;; - (depri|do|dp) + (depri|do|dp|done) nextstate=item ;; -- cgit v1.2.3 From 509e84ef4455c8ec00ad28322bee741717ab47bf Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 7 Feb 2021 02:13:10 +0100 Subject: 47930: update completions for FreeBSD base up to 12.2 --- ChangeLog | 4 ++++ Completion/BSD/Command/_freebsd-update | 2 ++ Completion/Unix/Command/_uniq | 3 ++- Completion/Unix/Type/_diff_options | 7 +++---- 4 files changed, 11 insertions(+), 5 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 4d1e16917..7498c9d4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2021-02-07 Oliver Kiddle + * 47930: Completion/BSD/Command/_freebsd-update, + Completion/Unix/Command/_uniq, Completion/Unix/Type/_diff_options: + update completions for FreeBSD base up to 12.2 + * 47929: Completion/Zsh/Command/_zstyle: complete newer possible values for the sort style diff --git a/Completion/BSD/Command/_freebsd-update b/Completion/BSD/Command/_freebsd-update index d42457272..7dd907298 100644 --- a/Completion/BSD/Command/_freebsd-update +++ b/Completion/BSD/Command/_freebsd-update @@ -5,9 +5,11 @@ flags=( '(cron)fetch[fetch a compressed snapshot or update existing one]' '(fetch)cron[sleep rand(3600) seconds, and then fetch updates]' '(install rollback)upgrade[fetch files necessary for upgrading to a new release]' + 'updatesready[check if there are fetched updates ready to install]' '(upgrade rollback)install[install the most recently fetched updates or upgrade]' '(upgrade install)rollback[uninstall the most recently installed updates]' 'IDS[compare the system against an index of "known good" files]' + 'showconfig[show configuration options after parsing conffile and command line options]' ) _arguments \ diff --git a/Completion/Unix/Command/_uniq b/Completion/Unix/Command/_uniq index 97f73b3ac..e123a94cd 100644 --- a/Completion/Unix/Command/_uniq +++ b/Completion/Unix/Command/_uniq @@ -23,8 +23,9 @@ args=( if ! _pick_variant gnu=Free\ Soft unix --version; then local optchars="cdufs" if [[ "$OSTYPE" == (darwin|dragonfly|freebsd|openbsd)* ]]; then - optchars="${optchars}i" + optchars+=i fi + [[ $OSTYPE = freebsd* ]] && optchars+=D args=( ${(M)args:#(|\*)(|\(*\))-[$optchars]*} ) fi diff --git a/Completion/Unix/Type/_diff_options b/Completion/Unix/Type/_diff_options index 440913dff..dfa9889f2 100644 --- a/Completion/Unix/Type/_diff_options +++ b/Completion/Unix/Type/_diff_options @@ -70,9 +70,7 @@ if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12-> '(-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" @@ -80,8 +78,6 @@ if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12-> '(--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' ) @@ -128,6 +124,9 @@ if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12-> '(-S --starting-file)'{-S+,--starting-file=}'[set first file in comparison]:start with 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]' \ + "($of $ouc)"{-y,--side-by-side}'[output in two columns]' \ + "($ofwy $ouc)--suppress-common-lines[don't output common lines]" \ + "($ofwy $ouc --width -W)"{--width=,-W+}'[set size of line]:number of characters per line' \ "$@" else of='-c -e -f' -- cgit v1.2.3 From b17449352eee39413d80fa4e886eb4f07e7519cd Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 7 Feb 2021 02:37:45 +0100 Subject: 47931: update completions for OpenBSD base up to 6.8 --- ChangeLog | 5 +++++ Completion/BSD/Command/_signify | 1 + Completion/BSD/Command/_systat | 1 + Completion/Unix/Command/_locale | 1 + Completion/Unix/Command/_netstat | 19 +++++++++++-------- Completion/Unix/Command/_top | 6 +++++- 6 files changed, 24 insertions(+), 9 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 7498c9d4b..df096438f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2021-02-07 Oliver Kiddle + * 47931: Completion/BSD/Command/_signify, + Completion/BSD/Command/_systat, Completion/Unix/Command/_locale, + Completion/Unix/Command/_netstat, Completion/Unix/Command/_top: + update completions for OpenBSD base up to 6.8 + * 47930: Completion/BSD/Command/_freebsd-update, Completion/Unix/Command/_uniq, Completion/Unix/Type/_diff_options: update completions for FreeBSD base up to 12.2 diff --git a/Completion/BSD/Command/_signify b/Completion/BSD/Command/_signify index 6a786e2e1..91e97e811 100644 --- a/Completion/BSD/Command/_signify +++ b/Completion/BSD/Command/_signify @@ -5,6 +5,7 @@ _arguments -s -S -A "-*" : \ '-C[verify a signed checksum list and the checksum for each file]' \ '-p+[public key]:public key:_files' \ '-q[quiet mode]' \ + '-t+[specify key type]:key type' \ '-x+[specify signature file]:signature file:_files' \ '*:file:_files' \ - generate \ diff --git a/Completion/BSD/Command/_systat b/Completion/BSD/Command/_systat index 73533e864..a123e081c 100644 --- a/Completion/BSD/Command/_systat +++ b/Completion/BSD/Command/_systat @@ -45,6 +45,7 @@ case $OSTYPE in '-B[raw, non-interactive mode (two screen updates)]' '-b[raw, non-interactive mode (one screen update)]' '-d[exit after `count'\'' updates]:count' + '-h[human readable output]' '-i[interactive mode]' '-N[resolve network addresses to names]' '-n[do not resolve network addresses to names]' diff --git a/Completion/Unix/Command/_locale b/Completion/Unix/Command/_locale index a7fd88f65..f1ed4bf36 100644 --- a/Completion/Unix/Command/_locale +++ b/Completion/Unix/Command/_locale @@ -28,6 +28,7 @@ elif [[ $OSTYPE == openbsd* ]]; then specs=( '(-m)-a[list all available locales]' '(-a)-m[list all available charmaps]' + '1:name:(charmap)' ) else diff --git a/Completion/Unix/Command/_netstat b/Completion/Unix/Command/_netstat index 94aa1688d..84d5dc2f2 100644 --- a/Completion/Unix/Command/_netstat +++ b/Completion/Unix/Command/_netstat @@ -5,10 +5,10 @@ local lopt='[show only listening sockets]' local zopt='-z[reset statistic counters after displaying them]' local popt='(-f)-p+[filter by protocol]:protocol:compadd -a plist' local Iopt='(-i)-I+[show information about the specified interface]:interface:_net_interfaces' -local set sel +local set sel tblopt local -A sets local -a Mopts families flist plist args sockets extend interval verbose -local -a {sel_,}{bpf,dhcp,groups,interfaces,masquerade,media,memory,multicast,pcb,queues,routing,statistics,wireless} +local -a {sel_,}{bpf,dhcp,groups,interfaces,masquerade,media,memory,multicast,pcb,queues,rdomains,routing,statistics,wireless} case $OSTYPE in linux-gnu) @@ -130,7 +130,7 @@ case $OSTYPE in ) routing=( $families ) sel_memory=( '-m[display statistics recorded by the memory management routines]' ) - sel_interfaces+=( '(1 -a -f -i -p -s)-w+[display packet traffic at intervals]:interval (seconds)' ) + sel_interfaces+=( '(1 -a -f -i -p -s -u)-w+[display packet traffic at intervals]:interval (seconds)' ) ;| darwin*|dragonfly*|(net|free)bsd*) interfaces+=( '-a[show multicast addresses currently in use]' ) @@ -266,13 +266,15 @@ case $OSTYPE in ) ;; openbsd*) - sets+=( wireless '-W*' ) + sets+=( wireless '-W*' rdomains '-R' ) + sel_rdomains=( '-R[show all rdomains with associated interfaces and routing tables]' ) sel_wireless=( '-W+[display per-interface IEEE 802.11 wireless statistics]:interface' ) flist+=( local mpls ) - sockets+=( -l$lopt '-B[show buffer sizes for TCP sockets]' ) - routing+=( + tblopt='-T+[select an alternate routing table to query]:routing table' + sockets+=( -l$lopt $tblopt '-B[show buffer sizes for TCP sockets]' ) + routing+=( $Mopts $tblopt + '-A[show the internal addresses of the routing table]' '-F[only show routes with gateway in the same address family as the destination]' - '-T+[select an alternate routing table to query]:routing table' ) interfaces+=( '-c+[show specified number of updates, then exit]:count' @@ -280,7 +282,8 @@ case $OSTYPE in '-q[only show interfaces that have seen packets]' '-t[show current value of the watchdog timer function]' ) - statistics+=( $popt ) + statistics+=( $popt '-r[display routing statistics]' ) + groups+=( -n$nopt ) pcb+=( $Mopts $verbose ) ;; netbsd*) diff --git a/Completion/Unix/Command/_top b/Completion/Unix/Command/_top index 652432166..af3deb6c7 100644 --- a/Completion/Unix/Command/_top +++ b/Completion/Unix/Command/_top @@ -64,7 +64,6 @@ case $OSTYPE in '-I[do not display idle processes]' '-i[interactive mode]' '-n[non-interactive mode (identical to batch mode)]' - '-o+[sort process display by the specified field]:field:( $fields )' '-p+[filter by the specified pid]: :_pids' '-q[renice top to -20]' '-S[show system processes]' @@ -80,6 +79,7 @@ case $OSTYPE in '-j[display the jail ID]' '-t[do not display the top process]' '-m+[specify statistic type]:type:(( cpu\:default io ))' + '-o+[sort process display by the specified field]:field:( $fields )' '-P[per-cpu CPU usage statistics]' '(1 -)-v[write version number and exit]' '-w[display approximate swap usage]' @@ -89,10 +89,14 @@ case $OSTYPE in );; openbsd*) fields+=( command ) + order=( '-:reverse order' ) specs+=( '-1[combine CPU statistic into one line]' + '-t[show the routing table instead of the wait channel]' '-C[show command arguments as well as process name]' '-g+[filter processes by the specified string]:string' + '-o+[sort process display by the specified field]:field:->sortkey' + '-T+[filter processes by the specified routing table]:routing table' '-U+[filter processes by the specified user]: :_users -M "L\:|-="' );; darwin*) -- cgit v1.2.3 From 2edac834a861043cf53ce36349edb13e1571c860 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 7 Feb 2021 02:54:21 +0100 Subject: 47932: update completions for procps 3.3.16 --- ChangeLog | 4 ++++ Completion/Linux/Command/_free | 2 +- Completion/Unix/Command/_pgrep | 3 ++- Completion/Unix/Command/_vmstat | 1 + Completion/Unix/Command/_w | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index df096438f..f0e404c62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2021-02-07 Oliver Kiddle + * 47932: Completion/Linux/Command/_free, Completion/Unix/Command/_w, + Completion/Unix/Command/_pgrep, Completion/Unix/Command/_vmstat: + update completions for procps 3.3.16 + * 47931: Completion/BSD/Command/_signify, Completion/BSD/Command/_systat, Completion/Unix/Command/_locale, Completion/Unix/Command/_netstat, Completion/Unix/Command/_top: diff --git a/Completion/Linux/Command/_free b/Completion/Linux/Command/_free index cc5bcf3bd..6d74e4a0d 100644 --- a/Completion/Linux/Command/_free +++ b/Completion/Linux/Command/_free @@ -1,5 +1,4 @@ #compdef free -# based on procps-ng-3.3.15 _arguments -s \ '(-l --lohi)'{-l,--lohi}'[show detailed low and high memory statistics]' \ @@ -7,6 +6,7 @@ _arguments -s \ '(-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: ' \ + '(-C --full-cache)'{-C,--full-cache}'[add further cache lines to main cache]' \ '--si[use power of 1000 instead of power of 1024]' \ '(-)--help[print help and exit]' \ '(-)'{-V,--version}'[print version information and exit]' \ diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index 49184307f..51a4883df 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -33,6 +33,7 @@ arguments=( '(-o -n --oldest --newest)'{-o,--oldest}'[match oldest process]' '(-P --parent)'{-P+,--parent=}'[match only on specified parent process IDs]: :->ppid' '(-l)-q[suppress normal output]' + '(-r --runstates)'{-r+,--runstates}'[match runstates]:run state:compadd -S "" D I R S T t W X Z' '-S[search also in system processes (kernel threads)]' '(-s --session)'{-s+,--session=}'[match only on specified process session IDs]: :->sid' # _signals is OK here - we do it differently below @@ -61,7 +62,7 @@ arguments=( case $OSTYPE in linux*) # Note: We deliberately exclude -v but not --inverse from pkill - pgopts=acdFfGghLlnoPstUuVvwx- + pgopts=acdFfGghLlnoPrstUuVvwx- pkopts=ceFfGghLnoPstUuVx- arguments=( ${arguments:#((#s)|*\))(\*|)-[acl]*} diff --git a/Completion/Unix/Command/_vmstat b/Completion/Unix/Command/_vmstat index f3ac1af14..e05bc88bc 100644 --- a/Completion/Unix/Command/_vmstat +++ b/Completion/Unix/Command/_vmstat @@ -8,6 +8,7 @@ case $OSTYPE in '(-t --timestamp)'{-t,--timestamp}'[show timestamp]' '(-n --one-header)'{-n,--one-header}'[do not redisplay header]' '(-S --unit)'{-S+,--unit=}'[specify unit for displayed sizes]:unit prefix [K]:((k\:1000 K\:1024 m\:1000000 M\:1048576))' + '(-C --full-cache)'{-C,--full-cache}'[add further cache lines to main cache]' '1: :_guard "[0-9]#" "interval (seconds)"' '2:count' + '(action)' \ '(- :)'{-h,--help}'[display help information]' diff --git a/Completion/Unix/Command/_w b/Completion/Unix/Command/_w index 8fb4154c7..69751c5e5 100644 --- a/Completion/Unix/Command/_w +++ b/Completion/Unix/Command/_w @@ -11,6 +11,7 @@ case $OSTYPE in '(H -o --old-style -s --short)'{-o,--old-style}'[old style output format]' '(H -s --short -o --old-style)'{-s,--short}'[use short output format]' '(H -u --no-current)'{-u,--no-current}'[ignore the username while figuring out the current process and cpu times]' + '(H -n --no-truncat)'{-n,--no-truncat}'[non-truncated listing (large)]' + H '(-)--help[display help information]' '(-)'{-V,--version}'[display version information]' -- cgit v1.2.3 From 25d69da85c707bfe08c2bad1d0b288baf8184b72 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 8 Feb 2021 00:06:57 +0100 Subject: 47943: update completions for DragonflyBSD 5.8.3 --- ChangeLog | 3 +++ Completion/Unix/Command/_date | 6 +++++- Completion/Unix/Command/_xargs | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index f0e404c62..6b2411bea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-02-07 Oliver Kiddle + * 47943: Completion/Unix/Command/_date, + Completion/Unix/Command/_xargs: update completions for DragonflyBSD + * 47932: Completion/Linux/Command/_free, Completion/Unix/Command/_w, Completion/Unix/Command/_pgrep, Completion/Unix/Command/_vmstat: update completions for procps 3.3.16 diff --git a/Completion/Unix/Command/_date b/Completion/Unix/Command/_date index 68bd357fb..dc447e06d 100644 --- a/Completion/Unix/Command/_date +++ b/Completion/Unix/Command/_date @@ -60,10 +60,14 @@ else ) ;| freebsd*|dragonfly*|darwin*) + args+=( + "*-v+[adjust and print (but don't set) date]:[+-]value[ymwdHMS]" + ) + ;| + freebsd*|darwin*) args+=( '-d+:daylight saving time value' '-t+:minutes west of GMT' - "*-v+[adjust and print (but don't set) date]:[+-]value[ymwdHMS]" ) ;| freebsd*|dragonfly*) diff --git a/Completion/Unix/Command/_xargs b/Completion/Unix/Command/_xargs index f21784ef1..8e23a04bb 100644 --- a/Completion/Unix/Command/_xargs +++ b/Completion/Unix/Command/_xargs @@ -25,7 +25,7 @@ case $variant in '-R[specify maximum arguments that -I will replace in]:replacements' ) ;| - freebsd*|netbsd*) + freebsd*|netbsd*|dragonfly*) args+=( '-S[space that -I can use for replacements]:size (bytes) [255]' ) -- cgit v1.2.3 From 073092f89dcf9fc1e59f9e3c5048f8c4829eae07 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 8 Feb 2021 00:40:10 +0100 Subject: 47944: update completions for NetBSD 9 --- ChangeLog | 4 ++++ Completion/BSD/Command/_bsd_pkg | 1 + Completion/BSD/Command/_pkgin | 2 +- Completion/BSD/Command/_systat | 7 ++++--- Completion/Unix/Command/_dmesg | 11 +++++++++-- 5 files changed, 19 insertions(+), 6 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 6b2411bea..4e85336ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2021-02-07 Oliver Kiddle + * 47944: Completion/BSD/Command/_bsd_pkg, + Completion/BSD/Command/_pkgin, Completion/BSD/Command/_systat, + Completion/Unix/Command/_dmesg: update completions for NetBSD 9 + * 47943: Completion/Unix/Command/_date, Completion/Unix/Command/_xargs: update completions for DragonflyBSD diff --git a/Completion/BSD/Command/_bsd_pkg b/Completion/BSD/Command/_bsd_pkg index 25d4f346a..6bdce58e0 100644 --- a/Completion/BSD/Command/_bsd_pkg +++ b/Completion/BSD/Command/_bsd_pkg @@ -144,6 +144,7 @@ _bsd_pkg() { netbsd*) flags+=( '(:)-a[delete all installed packages]' + '(:)-A[remove automatically installed packages that are no longer required]' "-D[don't execute deinstallation scripts]" '-F[specify each package by an installed file]' '-f[force deinstallation]' diff --git a/Completion/BSD/Command/_pkgin b/Completion/BSD/Command/_pkgin index 5cb12baea..662bed181 100644 --- a/Completion/BSD/Command/_pkgin +++ b/Completion/BSD/Command/_pkgin @@ -26,7 +26,7 @@ _arguments -s -S -C \ '*:: :->restargs' && ret=0 if [[ -n $state ]]; then - cmds=( ${${${(f)"$(_call_program commands $pkgin -h 2>&1)"}[3,-1]/ - (#b)(?)/:$match:l}%.} ) + cmds=( ${${${(f)"$(_call_program commands $pkgin -h 2>&1)"}[3,-1]/ - (#b)(?)/:$match:l}%.} ) short=( ${${cmds#*\(}/ #\)/} ) cmds=( ${cmds// #\(*\)/} ) if [[ $state = subcommands && ! -prefix - ]]; then diff --git a/Completion/BSD/Command/_systat b/Completion/BSD/Command/_systat index a123e081c..7d837790a 100644 --- a/Completion/BSD/Command/_systat +++ b/Completion/BSD/Command/_systat @@ -75,9 +75,10 @@ case $OSTYPE in opts=( '-M[alternative source to extract values from]:core:_files' '-N[alternative source to extract the name list from]:system:_files' - '-n[do not resolve IP addresses]' - '-w[refresh interval]:refresh interval' - '-t[the amount of refreshes for each screen in '\''all'\'' display mode]:turns' + '(-t -w)-b[show the chosen display once and exit]' + "-n[don't resolve IP addresses]" + '(-b)-w[refresh interval]:refresh interval' + "(-b)-t[specify amount of refreshes for each screen in 'all' display mode]:turns" ) esac diff --git a/Completion/Unix/Command/_dmesg b/Completion/Unix/Command/_dmesg index 3dd059214..1aa3bc262 100644 --- a/Completion/Unix/Command/_dmesg +++ b/Completion/Unix/Command/_dmesg @@ -1,6 +1,6 @@ #compdef dmesg -local args +local -a args case $OSTYPE in linux*) args=( -S -- ) ;; @@ -27,6 +27,13 @@ case $OSTYPE in '-n[use specified kernel core]:number' ) ;; + netbsd*) + args+=( + '-d[show timestamp deltas]' + '(-t)-T[format uptime timestamps in a human readable form]' + '(-T)-t[suppress printing uptime timestamps]' + ) + ;; esac -_arguments -s $args +_arguments -s : $args -- cgit v1.2.3 From 3714ee0b5868a30d7556acab337889849a3c8226 Mon Sep 17 00:00:00 2001 From: taiyu Date: Sun, 7 Feb 2021 05:15:03 -0800 Subject: github #68: support section suffix completion for man pages Support prepend and suffix values for insert-sections Add values for insert-sections for zstyle completion --- ChangeLog | 4 ++++ Completion/Unix/Command/_man | 22 ++++++++++++++-------- Completion/Zsh/Command/_zstyle | 6 ++++++ Doc/Zsh/compsys.yo | 10 +++++++--- 4 files changed, 31 insertions(+), 11 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 20f7eccf3..8a2161a81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2021-02-13 Oliver Kiddle + * github #68: taiyu.len: Completion/Unix/Command/_man, + Completion/Zsh/Command/_zstyle, Doc/Zsh/compsys.yo: + support section suffix completion for man pages + * 47905: Joshua Krusell: Src/Modules/zutil.c, Test/V12zparseopts.ztst: Add leading '-' to zparseopts option parsing errors diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man index 7d55201e3..dba1d13dc 100644 --- a/Completion/Unix/Command/_man +++ b/Completion/Unix/Command/_man @@ -6,7 +6,6 @@ # - We assume that Linux distributions are using either man-db or mandoc # - @todo Would be nice to support completing the initial operand as a section # name (on non-Solaris systems) -# - @todo We don't support the man-db syntax .
(e.g., `ls.1`) # - @todo We don't support the man-db feature of 'sub-pages' — that is, treating # pairs of operands like `git diff` as `git-diff` # - @todo Option exclusivity isn't super accurate @@ -415,7 +414,7 @@ _man() { } _man_pages() { - local pages sopt + local pages sopt tmp # What files corresponding to manual pages can end in. local suf='.((?|<->*|ntcl)(|.gz|.bz2|.z|.Z|.lzma))' @@ -444,13 +443,20 @@ _man_pages() { # `POSIX.1.5'. [[ $variant = solaris* ]] && sopt='-s ' - if ((CURRENT > 1 || noinsert)) || - ! zstyle -t ":completion:${curcontext}:manuals.$sect_dirname" insert-sections - then - compadd "$@" - ${pages%$~suf} - else - compadd "$@" -P "$sopt$sect_dirname " - ${pages%$~suf} + if ! ((CURRENT > 1 || noinsert)); then + zstyle -s ":completion:${curcontext}:manuals.$sect_dirname" insert-sections tmp fi + case "$tmp" in + prepend|true|on|yes|1) + compadd "$@" -P "$sopt$sect_dirname " - ${pages%$~suf} + ;; + suffix) + compadd "$@" -s ".$sect_dirname" - ${pages%$~suf} + ;; + *) + compadd "$@" - ${pages%$~suf} + ;; + esac } _man "$@" diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle index bb0e1f5bc..0473dd0fe 100644 --- a/Completion/Zsh/Command/_zstyle +++ b/Completion/Zsh/Command/_zstyle @@ -62,6 +62,7 @@ styles=( ignore-parents c:ignorepar ignored-patterns c: insert-ids c:insert-ids + insert-sections c:insert-sections insert-tab c:bool insert-unambiguous c:insunambig keep-prefix c:keep-prefix @@ -524,6 +525,11 @@ while (( $#state )); do compadd - menu single longer ;; + (insert-sections) + _wanted values expl 'where to insert man page section' \ + compadd - true false prepend suffix + ;; + (fake-files) _message -e fakes 'prefix and names' ;; diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 5f717d522..729b4e5d3 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -1838,14 +1838,18 @@ user is longer than the common prefix to the corresponding IDs. kindex(insert-sections, completion style) item(tt(insert-sections))( This style is used with tags of the form `tt(manuals.)var(X)' when -completing names of manual pages. If set to `true' and the var(X) in the -tag name matches the section number of the page being completed, the -section number is inserted along with the page name. For example, given +completing names of manual pages. If set and the var(X) in the tag name matches +the section number of the page being completed, the section number is inserted +along with the page name. For example, given example(zstyle ':completion:*:manuals.*' insert-sections true) tt(man ssh_) may be completed to tt(man 5 ssh_config). +The value may also be set to one of `tt(prepend)', or `tt(suffix)'. +`tt(prepend)' behaves the same as `true' as in the above example, while +`tt(suffix)' would complete tt(man ssh_) as tt(man ssh_config.5). + This is especially useful in conjunction with tt(separate-sections), as it ensures that the page requested of tt(man) corresponds to the one displayed in the completion listing when there are multiple pages with the -- cgit v1.2.3 From d909dc7323e53dfa63e12d11fa1a7bfc7e3ce81d Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sat, 13 Feb 2021 01:15:10 +0100 Subject: unposted (Daniel): add exclusion list missed in recent OpenBSD update to locale completion --- ChangeLog | 3 +++ Completion/Unix/Command/_locale | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 8a2161a81..a0bc14c99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-02-13 Oliver Kiddle + * unposted (Daniel): Completion/Unix/Command/_locale: + add exclusion list missed in recent OpenBSD update + * github #68: taiyu.len: Completion/Unix/Command/_man, Completion/Zsh/Command/_zstyle, Doc/Zsh/compsys.yo: support section suffix completion for man pages diff --git a/Completion/Unix/Command/_locale b/Completion/Unix/Command/_locale index f1ed4bf36..b2ee14ee0 100644 --- a/Completion/Unix/Command/_locale +++ b/Completion/Unix/Command/_locale @@ -28,7 +28,7 @@ elif [[ $OSTYPE == openbsd* ]]; then specs=( '(-m)-a[list all available locales]' '(-a)-m[list all available charmaps]' - '1:name:(charmap)' + '(-a -m)1:name:(charmap)' ) else -- cgit v1.2.3 From 055ce784017ebd42fbcef09165c52310fc7f6efd Mon Sep 17 00:00:00 2001 From: Jacob Gelbman Date: Mon, 22 Feb 2021 21:11:57 -0600 Subject: 48096: New ctags completion --- ChangeLog | 5 + Completion/Unix/Command/_ctags | 204 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 209 insertions(+) create mode 100644 Completion/Unix/Command/_ctags (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 7e96cfadf..ba5510aac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-02-23 Peter Stephenson + + * 48096: Jacob Gelbman: Completion/Unix/Command/_ctags: new + completion. + 2021-02-22 Bart Schaefer * 48094: Arseny Maslennikov: Functions/Prompts/prompt_restore_setup, diff --git a/Completion/Unix/Command/_ctags b/Completion/Unix/Command/_ctags new file mode 100644 index 000000000..53d4d8f12 --- /dev/null +++ b/Completion/Unix/Command/_ctags @@ -0,0 +1,204 @@ +#compdef ctags + +local state + +_arguments \ + "-?[help text]" \ + "-a[append the tags to an existing tag file]" \ + "-B[use backward searching patterns (?...?)]" \ + "-D[give definition for macro]:macro definition:" \ + "-e[output tag file for use with emacs]" \ + "-f[write tags to specified file. - is stdout]:file:_files" \ + "-F[use forward searching patterns]" \ + "-G[equivalent to --guess-language-eagerly]" \ + "-h[specify list of file extensions to be treated as include files]:" \ + "-I[a list of tokens to be specifically handled is read from either the command line or the specified file]:" \ + "-L[a list of input file names is read from the specified file. - is stdin]:file:_files" \ + "-n[equivalent to --excmd=number]" \ + "-N[equivalent to --excmd=pattern]" \ + "-o[alternative to -f]:file:_files" \ + "-R[equivalent to --recurse]" \ + "-u[equivalent to --sort=no]" \ + "-V[equivalent to --verbose]" \ + +I wrote a completion script for the ctags program. Someone might be able to use it: + +#compdef ctags + +local state + +_arguments \ + "-?[help text]" \ + "-a[append the tags to an existing tag file]" \ + "-B[use backward searching patterns (?...?)]" \ + "-D[give definition for macro]:macro definition:" \ + "-e[output tag file for use with emacs]" \ + "-f[write tags to specified file. - is stdout]:file:_files" \ + "-F[use forward searching patterns]" \ + "-G[equivalent to --guess-language-eagerly]" \ + "-h[specify list of file extensions to be treated as include files]:" \ + "-I[a list of tokens to be specifically handled is read from either the command line or the specified file]:" \ + "-L[a list of input file names is read from the specified file. - is stdin]:file:_files" \ + "-n[equivalent to --excmd=number]" \ + "-N[equivalent to --excmd=pattern]" \ + "-o[alternative to -f]:file:_files" \ + "-R[equivalent to --recurse]" \ + "-u[equivalent to --sort=no]" \ + "-V[equivalent to --verbose]" \ + "-x[print a tabular cross reference file to stdout]" \ + "--alias-=[add a pattern detecting a name, can be used as an alt name for lang]:pattern" \ + "--append=[should tags be appended to existing tag file]:bool:(yes no)" \ + "--etags-include=[include reference to file in emacs style tag file]:file:_files" \ + "--exclude=[exclude files and directories matching pattern]:pattern" \ + "--exclude-exception=[don't exclude files and directories matching pattern even if they match the pattern specified with --exclude]:pattern" \ + "--excmd=[uses the specified type of ex command to locate tags]:ex command type:(number pattern mix combine)" \ + "--extras=[include extra tag entries for selected information (flags fFgpqrs)]:flags" \ + "--extras-=[include own extra tag entries for selected information]:flags" \ + "--fields=[include selected extension fields (flags aCeEfFikKlmnNpPrRsStxzZ)]:flags" \ + "--fields-=[include selected own extension fields]:flags" \ + "--filter=[behave as a filter, reading file names from stdin and writing tags to stdout]:bool:(yes no)" \ + "--filter-terminator=[specify string to print to stdout following the tags for each file parsed when --filter is enabled]:string" \ + "--format=[force output of specified tag file format]:level" \ + "--guess-language-eagerly[guess the language of input file more eagerly]" \ + "--help[help text]" \ + "--help-full[help text with experimental features]" \ + "--if0=[should code within #if 0 conditionals be parsed]:bool:(yes no)" \ + "--input-encoding=[specify encoding of all input files]:encoding" \ + "--input-encoding-=[specify encoding of the input files]:encoding" \ + "--kinddef-=[define new kind for ]:kind" \ + "--kinds-=[enable/disable tag kinds for ]:kind" \ + "--langdef=[define a new language to be parsed with regular expressions]:name" \ + "--langmap=[override default mapping of language to input file extension]:maps" \ + "--language-force=[force all files to be interpreted using specified language]:language:->language" \ + "--languages=[restrict files scanned to these comma-separated languages]:language:->languages" \ + "--license[print details of software license]" \ + "--line-directives=[should #line directives be processed]:bool:(yes no)" \ + "--links=[indicate whether symlinks should be followed]:bool:(yes no)" \ + "--list-aliases=[list of alias patterns]:language:->language" \ + "--list-excludes[list of exclude patterns for files/dirs]" \ + "--list-extras=[list of extra tag flags]:language:->language" \ + "--list-features[list of compiled features]" \ + "--list-fields=[list of fields]:language:->language" \ + "--list-kinds=[list of all tag kinds for lang]:language:->language" \ + "--list-kinds-full=[list details of all tag kinds for lang]:language:->language" \ + "--list-languages[list of supported languages]" \ + "--list-map-extensions=[list of language extensions in mapping]:language:->language" \ + "--list-map-patterns=[list of language patterns in mapping]:language:->language" \ + "--list-maps=[list of language mappings (both extensions and patterns)]:language:->language" \ + "--list-mline-regex-flags[list of flags which can be used in a multiline regex parser definition]" \ + "--list-params=[list of language parameters. works with --machinable]:language:->language" \ + "--list-pseudo-tags[list of pseudo tags]" \ + "--list-regex-flags[list of flags which can be used in a regex parser definition]" \ + "--list-roles=[list of all roles of tag kinds specified for langs]:language:->language" \ + "--list-subparsers=[list of subparsers for the base lang]:language:->language" \ + "--machinable=[use tab separated representation in --list-* output]:bool:(yes no)" \ + "--map-=[set, add(+), or remove(-) the map for ]:pattern" \ + "--maxdepth=[specify maximum recursion depth]:depth" \ + "--mline-regex-=[define multiline regex for locating tags in ]:pattern" \ + "--options=[specify file (or dir) from which command line options should be read]:file:_files" \ + "--options-maybe=[same as --options but doesn't error]:file:_files" \ + "--optlib-dir=[add or set dir to optlib search path]:dir:_files -/" \ + "--output-encoding=[the encoding to write the tag file in]:encoding" \ + "--output-format=[specify the output format]:format:(u-ctags e-ctags etags xref)" \ + "--param-=[set specific parameter]:argument" \ + "--pattern-length-limit=[cutoff patterns of tag entries after N characters]:number" \ + "--print-language[don't make tags file but just print the guessed lang name for input file]" \ + "--pseudo-tags=[enable/disable emitting pseudo tag named ptag. if *, enable emitting all pseudo tags]:ptag" \ + "--put-field-prefix[put UCTAGS as prefix for the name of fields newly introducted in universal ctags]" \ + "--quiet=[don't print notice class messages]:bool:(yes no)" \ + "--recurse=[recurse]:bool:(yes no)" \ + "--regex-=[define regex for locating tags in specific lang]:pattern" \ + "--roles-.=[enable/disable tag roles for kinds of ]:role" \ + "--sort=[should tags be sorted]:argument:(yes no foldcase)" \ + "--tag-relative=[should paths be relative to location of tag file]:argument:(yes no always never)" \ + "--totals=[print stats about input and tag files]:arguments:(yes no extra)" \ + "--verbose=[enable verbose messages describing actions]:bool:(yes no)" \ + "--version[print version]" \ + "--with-list-header=[prepend the column descriptions in --list-* output]:bool:(yes no)" \ + "*:file:_files" + +if [ "$state" = "language" ]; then + compadd `ctags --list-languages | cut -d" " -f1` +elif [ "$state" = "languages" ]; then + _values -s , "languages" `ctags --list-languages | cut -d" " -f1` +fi + + + + "-x[print a tabular cross reference file to stdout]" \ + "--alias-=[add a pattern detecting a name, can be used as an alt name for lang]:pattern" \ + "--append=[should tags be appended to existing tag file]:bool:(yes no)" \ + "--etags-include=[include reference to file in emacs style tag file]:file:_files" \ + "--exclude=[exclude files and directories matching pattern]:pattern" \ + "--exclude-exception=[don't exclude files and directories matching pattern even if they match the pattern specified with --exclude]:pattern" \ + "--excmd=[uses the specified type of ex command to locate tags]:ex command type:(number pattern mix combine)" \ + "--extras=[include extra tag entries for selected information (flags fFgpqrs)]:flags" \ + "--extras-=[include own extra tag entries for selected information]:flags" \ + "--fields=[include selected extension fields (flags aCeEfFikKlmnNpPrRsStxzZ)]:flags" \ + "--fields-=[include selected own extension fields]:flags" \ + "--filter=[behave as a filter, reading file names from stdin and writing tags to stdout]:bool:(yes no)" \ + "--filter-terminator=[specify string to print to stdout following the tags for each file parsed when --filter is enabled]:string" \ + "--format=[force output of specified tag file format]:level" \ + "--guess-language-eagerly[guess the language of input file more eagerly]" \ + "--help[help text]" \ + "--help-full[help text with experimental features]" \ + "--if0=[should code within #if 0 conditionals be parsed]:bool:(yes no)" \ + "--input-encoding=[specify encoding of all input files]:encoding" \ + "--input-encoding-=[specify encoding of the input files]:encoding" \ + "--kinddef-=[define new kind for ]:kind" \ + "--kinds-=[enable/disable tag kinds for ]:kind" \ + "--langdef=[define a new language to be parsed with regular expressions]:name" \ + "--langmap=[override default mapping of language to input file extension]:maps" \ + "--language-force=[force all files to be interpreted using specified language]:language:->language" \ + "--languages=[restrict files scanned to these comma-separated languages]:language:->languages" \ + "--license[print details of software license]" \ + "--line-directives=[should #line directives be processed]:bool:(yes no)" \ + "--links=[indicate whether symlinks should be followed]:bool:(yes no)" \ + "--list-aliases=[list of alias patterns]:language:->language" \ + "--list-excludes[list of exclude patterns for files/dirs]" \ + "--list-extras=[list of extra tag flags]:language:->language" \ + "--list-features[list of compiled features]" \ + "--list-fields=[list of fields]:language:->language" \ + "--list-kinds=[list of all tag kinds for lang]:language:->language" \ + "--list-kinds-full=[list details of all tag kinds for lang]:language:->language" \ + "--list-languages[list of supported languages]" \ + "--list-map-extensions=[list of language extensions in mapping]:language:->language" \ + "--list-map-patterns=[list of language patterns in mapping]:language:->language" \ + "--list-maps=[list of language mappings (both extensions and patterns)]:language:->language" \ + "--list-mline-regex-flags[list of flags which can be used in a multiline regex parser definition]" \ + "--list-params=[list of language parameters. works with --machinable]:language:->language" \ + "--list-pseudo-tags[list of pseudo tags]" \ + "--list-regex-flags[list of flags which can be used in a regex parser definition]" \ + "--list-roles=[list of all roles of tag kinds specified for langs]:language:->language" \ + "--list-subparsers=[list of subparsers for the base lang]:language:->language" \ + "--machinable=[use tab separated representation in --list-* output]:bool:(yes no)" \ + "--map-=[set, add(+), or remove(-) the map for ]:pattern" \ + "--maxdepth=[specify maximum recursion depth]:depth" \ + "--mline-regex-=[define multiline regex for locating tags in ]:pattern" \ + "--options=[specify file (or dir) from which command line options should be read]:file:_files" \ + "--options-maybe=[same as --options but doesn't error]:file:_files" \ + "--optlib-dir=[add or set dir to optlib search path]:dir:_files -/" \ + "--output-encoding=[the encoding to write the tag file in]:encoding" \ + "--output-format=[specify the output format]:format:(u-ctags e-ctags etags xref)" \ + "--param-=[set specific parameter]:argument" \ + "--pattern-length-limit=[cutoff patterns of tag entries after N characters]:number" \ + "--print-language[don't make tags file but just print the guessed lang name for input file]" \ + "--pseudo-tags=[enable/disable emitting pseudo tag named ptag. if *, enable emitting all pseudo tags]:ptag" \ + "--put-field-prefix[put UCTAGS as prefix for the name of fields newly introducted in universal ctags]" \ + "--quiet=[don't print notice class messages]:bool:(yes no)" \ + "--recurse=[recurse]:bool:(yes no)" \ + "--regex-=[define regex for locating tags in specific lang]:pattern" \ + "--roles-.=[enable/disable tag roles for kinds of ]:role" \ + "--sort=[should tags be sorted]:argument:(yes no foldcase)" \ + "--tag-relative=[should paths be relative to location of tag file]:argument:(yes no always never)" \ + "--totals=[print stats about input and tag files]:arguments:(yes no extra)" \ + "--verbose=[enable verbose messages describing actions]:bool:(yes no)" \ + "--version[print version]" \ + "--with-list-header=[prepend the column descriptions in --list-* output]:bool:(yes no)" \ + "*:file:_files" + +if [ "$state" = "language" ]; then + compadd `ctags --list-languages | cut -d" " -f1` +elif [ "$state" = "languages" ]; then + _values -s , "languages" `ctags --list-languages | cut -d" " -f1` +fi -- cgit v1.2.3 From 5ede2c55f144593c16498c3131a76e188114a9c6 Mon Sep 17 00:00:00 2001 From: Jacob Gelbman Date: Wed, 24 Feb 2021 01:20:24 -0600 Subject: 48105: Update ctags completion with format fix --- ChangeLog | 5 + Completion/Unix/Command/_ctags | 379 ++++++++++++++++++++--------------------- 2 files changed, 191 insertions(+), 193 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index ba5510aac..417a63797 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-02-24 Peter Stephenson + + * 48105: Jacob Gelbman:Completion/Unix/Command/_ctags: update and + fix formatting nad import. + 2021-02-23 Peter Stephenson * 48096: Jacob Gelbman: Completion/Unix/Command/_ctags: new diff --git a/Completion/Unix/Command/_ctags b/Completion/Unix/Command/_ctags index 53d4d8f12..30c631d37 100644 --- a/Completion/Unix/Command/_ctags +++ b/Completion/Unix/Command/_ctags @@ -1,204 +1,197 @@ #compdef ctags -local state +local context state line expl +local -A opt_args -_arguments \ - "-?[help text]" \ - "-a[append the tags to an existing tag file]" \ - "-B[use backward searching patterns (?...?)]" \ - "-D[give definition for macro]:macro definition:" \ - "-e[output tag file for use with emacs]" \ - "-f[write tags to specified file. - is stdout]:file:_files" \ - "-F[use forward searching patterns]" \ - "-G[equivalent to --guess-language-eagerly]" \ - "-h[specify list of file extensions to be treated as include files]:" \ - "-I[a list of tokens to be specifically handled is read from either the command line or the specified file]:" \ - "-L[a list of input file names is read from the specified file. - is stdin]:file:_files" \ - "-n[equivalent to --excmd=number]" \ - "-N[equivalent to --excmd=pattern]" \ - "-o[alternative to -f]:file:_files" \ - "-R[equivalent to --recurse]" \ - "-u[equivalent to --sort=no]" \ - "-V[equivalent to --verbose]" \ - -I wrote a completion script for the ctags program. Someone might be able to use it: +if [ -z "$_ctags_type" ]; then + local output=`ctags --version 2>&1` + if [[ "$output" = *Universal\ Ctags* ]]; then + _ctags_type="universal" + elif [[ "$output" = *Exuberant\ Ctags* ]]; then + _ctags_type="exuberant" + elif [[ "$output" = *usage:\ ctags* ]]; then + _ctags_type="bsd" + elif [[ "$output" = *Emacs* ]]; then + _ctags_type="etags" + else + _ctags_type="universal" + fi +fi -#compdef ctags +if [ "$_ctags_type" = "etags" ]; then + _etags + return $? +fi -local state +local -a arguments -_arguments \ - "-?[help text]" \ - "-a[append the tags to an existing tag file]" \ - "-B[use backward searching patterns (?...?)]" \ - "-D[give definition for macro]:macro definition:" \ - "-e[output tag file for use with emacs]" \ - "-f[write tags to specified file. - is stdout]:file:_files" \ - "-F[use forward searching patterns]" \ - "-G[equivalent to --guess-language-eagerly]" \ - "-h[specify list of file extensions to be treated as include files]:" \ - "-I[a list of tokens to be specifically handled is read from either the command line or the specified file]:" \ - "-L[a list of input file names is read from the specified file. - is stdin]:file:_files" \ - "-n[equivalent to --excmd=number]" \ - "-N[equivalent to --excmd=pattern]" \ - "-o[alternative to -f]:file:_files" \ - "-R[equivalent to --recurse]" \ - "-u[equivalent to --sort=no]" \ - "-V[equivalent to --verbose]" \ - "-x[print a tabular cross reference file to stdout]" \ - "--alias-=[add a pattern detecting a name, can be used as an alt name for lang]:pattern" \ - "--append=[should tags be appended to existing tag file]:bool:(yes no)" \ - "--etags-include=[include reference to file in emacs style tag file]:file:_files" \ - "--exclude=[exclude files and directories matching pattern]:pattern" \ - "--exclude-exception=[don't exclude files and directories matching pattern even if they match the pattern specified with --exclude]:pattern" \ - "--excmd=[uses the specified type of ex command to locate tags]:ex command type:(number pattern mix combine)" \ - "--extras=[include extra tag entries for selected information (flags fFgpqrs)]:flags" \ - "--extras-=[include own extra tag entries for selected information]:flags" \ - "--fields=[include selected extension fields (flags aCeEfFikKlmnNpPrRsStxzZ)]:flags" \ - "--fields-=[include selected own extension fields]:flags" \ - "--filter=[behave as a filter, reading file names from stdin and writing tags to stdout]:bool:(yes no)" \ - "--filter-terminator=[specify string to print to stdout following the tags for each file parsed when --filter is enabled]:string" \ - "--format=[force output of specified tag file format]:level" \ - "--guess-language-eagerly[guess the language of input file more eagerly]" \ - "--help[help text]" \ - "--help-full[help text with experimental features]" \ - "--if0=[should code within #if 0 conditionals be parsed]:bool:(yes no)" \ - "--input-encoding=[specify encoding of all input files]:encoding" \ - "--input-encoding-=[specify encoding of the input files]:encoding" \ - "--kinddef-=[define new kind for ]:kind" \ - "--kinds-=[enable/disable tag kinds for ]:kind" \ - "--langdef=[define a new language to be parsed with regular expressions]:name" \ - "--langmap=[override default mapping of language to input file extension]:maps" \ - "--language-force=[force all files to be interpreted using specified language]:language:->language" \ - "--languages=[restrict files scanned to these comma-separated languages]:language:->languages" \ - "--license[print details of software license]" \ - "--line-directives=[should #line directives be processed]:bool:(yes no)" \ - "--links=[indicate whether symlinks should be followed]:bool:(yes no)" \ - "--list-aliases=[list of alias patterns]:language:->language" \ - "--list-excludes[list of exclude patterns for files/dirs]" \ - "--list-extras=[list of extra tag flags]:language:->language" \ - "--list-features[list of compiled features]" \ - "--list-fields=[list of fields]:language:->language" \ - "--list-kinds=[list of all tag kinds for lang]:language:->language" \ - "--list-kinds-full=[list details of all tag kinds for lang]:language:->language" \ - "--list-languages[list of supported languages]" \ - "--list-map-extensions=[list of language extensions in mapping]:language:->language" \ - "--list-map-patterns=[list of language patterns in mapping]:language:->language" \ - "--list-maps=[list of language mappings (both extensions and patterns)]:language:->language" \ - "--list-mline-regex-flags[list of flags which can be used in a multiline regex parser definition]" \ - "--list-params=[list of language parameters. works with --machinable]:language:->language" \ - "--list-pseudo-tags[list of pseudo tags]" \ - "--list-regex-flags[list of flags which can be used in a regex parser definition]" \ - "--list-roles=[list of all roles of tag kinds specified for langs]:language:->language" \ - "--list-subparsers=[list of subparsers for the base lang]:language:->language" \ - "--machinable=[use tab separated representation in --list-* output]:bool:(yes no)" \ - "--map-=[set, add(+), or remove(-) the map for ]:pattern" \ - "--maxdepth=[specify maximum recursion depth]:depth" \ - "--mline-regex-=[define multiline regex for locating tags in ]:pattern" \ - "--options=[specify file (or dir) from which command line options should be read]:file:_files" \ - "--options-maybe=[same as --options but doesn't error]:file:_files" \ - "--optlib-dir=[add or set dir to optlib search path]:dir:_files -/" \ - "--output-encoding=[the encoding to write the tag file in]:encoding" \ - "--output-format=[specify the output format]:format:(u-ctags e-ctags etags xref)" \ - "--param-=[set specific parameter]:argument" \ - "--pattern-length-limit=[cutoff patterns of tag entries after N characters]:number" \ - "--print-language[don't make tags file but just print the guessed lang name for input file]" \ - "--pseudo-tags=[enable/disable emitting pseudo tag named ptag. if *, enable emitting all pseudo tags]:ptag" \ - "--put-field-prefix[put UCTAGS as prefix for the name of fields newly introducted in universal ctags]" \ - "--quiet=[don't print notice class messages]:bool:(yes no)" \ - "--recurse=[recurse]:bool:(yes no)" \ - "--regex-=[define regex for locating tags in specific lang]:pattern" \ - "--roles-.=[enable/disable tag roles for kinds of ]:role" \ - "--sort=[should tags be sorted]:argument:(yes no foldcase)" \ - "--tag-relative=[should paths be relative to location of tag file]:argument:(yes no always never)" \ - "--totals=[print stats about input and tag files]:arguments:(yes no extra)" \ - "--verbose=[enable verbose messages describing actions]:bool:(yes no)" \ - "--version[print version]" \ - "--with-list-header=[prepend the column descriptions in --list-* output]:bool:(yes no)" \ +if [ "$_ctags_type" = "universal" ]; then + arguments=( + "-?[help text]" + "-a[append to tags file]" + "-B[use backward searching patterns (?...?)]" + "-D[give definition for macro]:macro definition:" + "-e[output tag file for use with emacs]" + "-f[write tags to specified file. - is stdout]:file:_files" + "-F[use forward searching patterns (/.../)]" + "-G[equivalent to --guess-language-eagerly]" + "-h[specify list of file extensions to be treated as include files]:" + "-I[a list of tokens to be specifically handled is read from either the command line or the specified file]:" + "-L[a list of input file names is read from the specified file. - is stdin]:file:_files" + "-n[equivalent to --excmd=number]" + "-N[equivalent to --excmd=pattern]" + "-o[alternative to -f]:file:_files" + "-R[equivalent to --recurse]" + "-u[equivalent to --sort=no]" + "-V[equivalent to --verbose]" + "-x[print a tabular cross reference file to stdout]" + "--alias-=[add a pattern detecting a name, can be used as an alt name for lang]:pattern" + "--append=[should tags be appended to existing tag file]:bool:(yes no)" + "--etags-include=[include reference to file in emacs style tag file]:file:_files" + "--exclude=[exclude files and directories matching pattern]:pattern" + "--exclude-exception=[don't exclude files and directories matching pattern even if they match the pattern specified with --exclude]:pattern" + "--excmd=[uses the specified type of ex command to locate tags]:ex command type:(number pattern mix combine)" + "--extras=[include extra tag entries for selected information (flags fFgpqrs)]:flags" + "--extras-=[include own extra tag entries for selected information]:flags" + "--fields=[include selected extension fields (flags aCeEfFikKlmnNpPrRsStxzZ)]:flags" + "--fields-=[include selected own extension fields]:flags" + "--filter=[behave as a filter, reading file names from stdin and writing tags to stdout]:bool:(yes no)" + "--filter-terminator=[specify string to print to stdout following the tags for each file parsed when --filter is enabled]:string" + "--format=[force output of specified tag file format]:level" + "--guess-language-eagerly[guess the language of input file more eagerly]" + "--help[help text]" + "--help-full[help text with experimental features]" + "--if0=[should code within #if 0 conditionals be parsed]:bool:(yes no)" + "--input-encoding=[specify encoding of all input files]:encoding" + "--input-encoding-=[specify encoding of the input files]:encoding" + "--kinddef-=[define new kind for ]:kind" + "--kinds-=[enable/disable tag kinds for ]:kind" + "--langdef=[define a new language to be parsed with regular expressions]:name" + "--langmap=[override default mapping of language to input file extension]:maps" + "--language-force=[force all files to be interpreted using specified language]:language:->language" + "--languages=[restrict files scanned to these comma-separated languages]:language:->languages" + "--license[print details of software license]" + "--line-directives=[should #line directives be processed]:bool:(yes no)" + "--links=[indicate whether symlinks should be followed]:bool:(yes no)" + "--list-aliases=[list of alias patterns]:language:->language" + "--list-excludes[list of exclude patterns for files/dirs]" + "--list-extras=[list of extra tag flags]:language:->language" + "--list-features[list of compiled features]" + "--list-fields=[list of fields]:language:->language" + "--list-kinds=[list of all tag kinds for lang]:language:->language" + "--list-kinds-full=[list details of all tag kinds for lang]:language:->language" + "--list-languages[list of supported languages]" + "--list-map-extensions=[list of language extensions in mapping]:language:->language" + "--list-map-patterns=[list of language patterns in mapping]:language:->language" + "--list-maps=[list of language mappings (both extensions and patterns)]:language:->language" + "--list-mline-regex-flags[list of flags which can be used in a multiline regex parser definition]" + "--list-params=[list of language parameters. works with --machinable]:language:->language" + "--list-pseudo-tags[list of pseudo tags]" + "--list-regex-flags[list of flags which can be used in a regex parser definition]" + "--list-roles=[list of all roles of tag kinds specified for langs]:language:->language" + "--list-subparsers=[list of subparsers for the base lang]:language:->language" + "--machinable=[use tab separated representation in --list-* output]:bool:(yes no)" + "--map-=[set, add(+), or remove(-) the map for ]:pattern" + "--maxdepth=[specify maximum recursion depth]:depth" + "--mline-regex-=[define multiline regex for locating tags in ]:pattern" + "--options=[specify file (or dir) from which command line options should be read]:file:_files" + "--options-maybe=[same as --options but doesn't error]:file:_files" + "--optlib-dir=[add or set dir to optlib search path]:dir:_files -/" + "--output-encoding=[the encoding to write the tag file in]:encoding" + "--output-format=[specify the output format]:format:(u-ctags e-ctags etags xref)" + "--param-=[set specific parameter]:argument" + "--pattern-length-limit=[cutoff patterns of tag entries after N characters]:number" + "--print-language[don't make tags file but just print the guessed lang name for input file]" + "--pseudo-tags=[enable/disable emitting pseudo tag named ptag. if *, enable emitting all pseudo tags]:ptag" + "--put-field-prefix[put UCTAGS as prefix for the name of fields newly introducted in universal ctags]" + "--quiet=[don't print notice class messages]:bool:(yes no)" + "--recurse=[recurse]:bool:(yes no)" + "--regex-=[define regex for locating tags in specific lang]:pattern" + "--roles-.=[enable/disable tag roles for kinds of ]:role" + "--sort=[should tags be sorted]:argument:(yes no foldcase)" + "--tag-relative=[should paths be relative to location of tag file]:argument:(yes no always never)" + "--totals=[print stats about input and tag files]:arguments:(yes no extra)" + "--verbose=[enable verbose messages describing actions]:bool:(yes no)" + "--version[print version]" + "--with-list-header=[prepend the column descriptions in --list-* output]:bool:(yes no)" "*:file:_files" - -if [ "$state" = "language" ]; then - compadd `ctags --list-languages | cut -d" " -f1` -elif [ "$state" = "languages" ]; then - _values -s , "languages" `ctags --list-languages | cut -d" " -f1` + ) +elif [ "$_ctags_type" = "exuberant" ]; then + arguments=( + "-a[append to tags file]" + "-B[use backward searching patterns (?...?)]" + "-e[output tag file for use with emacs]" + "-f[write tags to specified file. - is stdout]:file:_files" + "-F[use forward searching patterns (/.../)]" + "-h[specify list of file extensions to be treated as include files]:" + "-I[a list of tokens to be specifically handled is read from either the command line or the specified file]:" + "-L[a list of input file names is read from the specified file. - is stdin]:file:_files" + "-n[equivalent to --excmd=number]" + "-N[equivalent to --excmd=pattern]" + "-o[alternative to -f]:file:_files" + "-R[equivalent to --recurse]" + "-u[equivalent to --sort=no]" + "-V[equivalent to --verbose]" + "-x[print a tabular cross reference file to stdout]" + "--append=[should tags be appended to existing tag file]:bool:(yes no)" + "--etags-include=[include reference to file in emacs style tag file]:file:_files" + "--exclude=[exclude files and directories matching pattern]:pattern" + "--excmd=[uses the specified type of ex command to locate tags]:ex command type:(number pattern mix)" + "--extra=[include extra tag entries for selected information (flags fq)]:flags" + "--fields=[include selected extension fields (flags afmikKlnsStz)]:flags" + "--file-scope=[should tags scoped only for a single file be included in output]:bool:(yes no)" + "--filter=[behave as a filter, reading file names from stdin and writing tags to stdout]:bool:(yes no)" + "--filter-terminator=[specify string to print to stdout following the tags for each file parsed when --filter is enabled]:string" + "--format=[force output of specified tag file format]:level" + "--help[help text]" + "--if0=[should code within #if 0 conditionals be parsed]:bool:(yes no)" + "---kinds=[enable/disable tag kinds for ]:kind" + "--langdef=[define a new language to be parsed with regular expressions]:name" + "--langmap=[override default mapping of language to input file extension]:maps" + "--language-force=[force all files to be interpreted using specified language]:language:->language" + "--languages=[restrict files scanned to these comma-separated languages]:language:->languages" + "--license[print details of software license]" + "--line-directives=[should #line directives be processed]:bool:(yes no)" + "--links=[indicate whether symlinks should be followed]:bool:(yes no)" + "--list-kinds=[list of all tag kinds for lang]:language:->language" + "--list-languages[list of supported languages]" + "--list-maps=[list of language mappings (both extensions and patterns)]:language:->language" + "--options=[specify file (or dir) from which command line options should be read]:file:_files" + "--recurse=[recurse]:bool:(yes no)" + "--regex-=[define regex for locating tags in specific lang]:pattern" + "--sort=[should tags be sorted]:argument:(yes no foldcase)" + "--tag-relative=[should paths be relative to location of tag file]:argument:(yes no)" + "--totals=[print stats about input and tag files]:arguments:(yes no)" + "--verbose=[enable verbose messages describing actions]:bool:(yes no)" + "--version[print version]” + "*:file:_files" + ) +elif [ "$_ctags_type" = "bsd" ]; then + arguments=( + "-a[append to tags file]" + "-B[use backward searching patterns (?...?)]" + "-d[create tags for #defines that don't take arguments]" + "-F[use forward searching patterns (/.../)]" + "-f[write tags to specified file]:file:_files" + "-t[create tags for typedefs, structs, unions, and enums]" + "-u[update the specified files in the tags file]" + "-v[an index of the form expected by vgrind(1) is produced]" + "-w[suppress warning diagnostics]" + "-x[ctags produces a simple function index]" + "*:file:_files" + ) fi +_arguments $arguments - - "-x[print a tabular cross reference file to stdout]" \ - "--alias-=[add a pattern detecting a name, can be used as an alt name for lang]:pattern" \ - "--append=[should tags be appended to existing tag file]:bool:(yes no)" \ - "--etags-include=[include reference to file in emacs style tag file]:file:_files" \ - "--exclude=[exclude files and directories matching pattern]:pattern" \ - "--exclude-exception=[don't exclude files and directories matching pattern even if they match the pattern specified with --exclude]:pattern" \ - "--excmd=[uses the specified type of ex command to locate tags]:ex command type:(number pattern mix combine)" \ - "--extras=[include extra tag entries for selected information (flags fFgpqrs)]:flags" \ - "--extras-=[include own extra tag entries for selected information]:flags" \ - "--fields=[include selected extension fields (flags aCeEfFikKlmnNpPrRsStxzZ)]:flags" \ - "--fields-=[include selected own extension fields]:flags" \ - "--filter=[behave as a filter, reading file names from stdin and writing tags to stdout]:bool:(yes no)" \ - "--filter-terminator=[specify string to print to stdout following the tags for each file parsed when --filter is enabled]:string" \ - "--format=[force output of specified tag file format]:level" \ - "--guess-language-eagerly[guess the language of input file more eagerly]" \ - "--help[help text]" \ - "--help-full[help text with experimental features]" \ - "--if0=[should code within #if 0 conditionals be parsed]:bool:(yes no)" \ - "--input-encoding=[specify encoding of all input files]:encoding" \ - "--input-encoding-=[specify encoding of the input files]:encoding" \ - "--kinddef-=[define new kind for ]:kind" \ - "--kinds-=[enable/disable tag kinds for ]:kind" \ - "--langdef=[define a new language to be parsed with regular expressions]:name" \ - "--langmap=[override default mapping of language to input file extension]:maps" \ - "--language-force=[force all files to be interpreted using specified language]:language:->language" \ - "--languages=[restrict files scanned to these comma-separated languages]:language:->languages" \ - "--license[print details of software license]" \ - "--line-directives=[should #line directives be processed]:bool:(yes no)" \ - "--links=[indicate whether symlinks should be followed]:bool:(yes no)" \ - "--list-aliases=[list of alias patterns]:language:->language" \ - "--list-excludes[list of exclude patterns for files/dirs]" \ - "--list-extras=[list of extra tag flags]:language:->language" \ - "--list-features[list of compiled features]" \ - "--list-fields=[list of fields]:language:->language" \ - "--list-kinds=[list of all tag kinds for lang]:language:->language" \ - "--list-kinds-full=[list details of all tag kinds for lang]:language:->language" \ - "--list-languages[list of supported languages]" \ - "--list-map-extensions=[list of language extensions in mapping]:language:->language" \ - "--list-map-patterns=[list of language patterns in mapping]:language:->language" \ - "--list-maps=[list of language mappings (both extensions and patterns)]:language:->language" \ - "--list-mline-regex-flags[list of flags which can be used in a multiline regex parser definition]" \ - "--list-params=[list of language parameters. works with --machinable]:language:->language" \ - "--list-pseudo-tags[list of pseudo tags]" \ - "--list-regex-flags[list of flags which can be used in a regex parser definition]" \ - "--list-roles=[list of all roles of tag kinds specified for langs]:language:->language" \ - "--list-subparsers=[list of subparsers for the base lang]:language:->language" \ - "--machinable=[use tab separated representation in --list-* output]:bool:(yes no)" \ - "--map-=[set, add(+), or remove(-) the map for ]:pattern" \ - "--maxdepth=[specify maximum recursion depth]:depth" \ - "--mline-regex-=[define multiline regex for locating tags in ]:pattern" \ - "--options=[specify file (or dir) from which command line options should be read]:file:_files" \ - "--options-maybe=[same as --options but doesn't error]:file:_files" \ - "--optlib-dir=[add or set dir to optlib search path]:dir:_files -/" \ - "--output-encoding=[the encoding to write the tag file in]:encoding" \ - "--output-format=[specify the output format]:format:(u-ctags e-ctags etags xref)" \ - "--param-=[set specific parameter]:argument" \ - "--pattern-length-limit=[cutoff patterns of tag entries after N characters]:number" \ - "--print-language[don't make tags file but just print the guessed lang name for input file]" \ - "--pseudo-tags=[enable/disable emitting pseudo tag named ptag. if *, enable emitting all pseudo tags]:ptag" \ - "--put-field-prefix[put UCTAGS as prefix for the name of fields newly introducted in universal ctags]" \ - "--quiet=[don't print notice class messages]:bool:(yes no)" \ - "--recurse=[recurse]:bool:(yes no)" \ - "--regex-=[define regex for locating tags in specific lang]:pattern" \ - "--roles-.=[enable/disable tag roles for kinds of ]:role" \ - "--sort=[should tags be sorted]:argument:(yes no foldcase)" \ - "--tag-relative=[should paths be relative to location of tag file]:argument:(yes no always never)" \ - "--totals=[print stats about input and tag files]:arguments:(yes no extra)" \ - "--verbose=[enable verbose messages describing actions]:bool:(yes no)" \ - "--version[print version]" \ - "--with-list-header=[prepend the column descriptions in --list-* output]:bool:(yes no)" \ - "*:file:_files" - -if [ "$state" = "language" ]; then - compadd `ctags --list-languages | cut -d" " -f1` -elif [ "$state" = "languages" ]; then - _values -s , "languages" `ctags --list-languages | cut -d" " -f1` +if [[ "$state" = language* ]]; then + local -a languages + languages=(`ctags --list-languages | cut -d" " -f1`) + if [ "$state" = "language" ]; then + _wanted languages expl language compadd $languages + elif [ "$state" = "languages" ]; then + _values -s , languages $languages + fi fi + +return $(( compstate[nmatches] > 0 ? 0 : 1 )) -- cgit v1.2.3 From 42de9318f1bd05873eb850a830d30af13bc07415 Mon Sep 17 00:00:00 2001 From: Štěpán Němec Date: Wed, 24 Mar 2021 00:17:07 +0100 Subject: 48231: add missing git --pretty formats and improve descriptions --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 16 +++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 4d4ed3f09..6fb01eab5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-03-28 Oliver Kiddle + * Štěpán Němec: 48231: Completion/Unix/Command/_git: + add missing --pretty formats and improve descriptions + * 48230, 48233 (Jun T): Completion/Solaris/Command/_dtrace: completion of dtrace probes and runtime options diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 81a060e4d..ced89b501 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -7573,13 +7573,15 @@ __git_setup_diff_stage_options () { __git_format_placeholders() { local sep local -a disp names placeholders expl - _describe -t formats format '( oneline:"commit-ids and subject of messages" - short:"few headers and only subject of messages" - medium:"most parts of messages" - full:"all parts of commit messages" - fuller:"like full and includes dates" - email:"use email headers like From and Subject" - raw:"the raw commits" )' -- '( format:"specify own format" )' -S ':' && return + _describe -t formats format '( oneline:" " + short:"commit hash plus author and title headers" + medium:"like short plus author date header and full message" + full:"like medium with committer header instead of date" + fuller:"like full plus author and commit date headers" + reference:"<abbrev hash> (<title>, <short author date>)" + email:"email patch format" + mboxrd:"like email with From lines in message quoted with >" + raw:"entire commit object" )' -- '( format:"specify own format" )' -S ':' && return compset -P 'format:' compset -P '(%[^acgCG]|%?[^%]|[^%])#' if compset -P '%C'; then -- cgit v1.2.3 From ab166725dd5983b00cf21113fb77717c6be324c5 Mon Sep 17 00:00:00 2001 From: Jacob Gelbman <gelbman@gmail.com> Date: Thu, 11 Mar 2021 11:08:05 -0600 Subject: 48166: add completion for ctags language options --- ChangeLog | 7 +- Completion/Unix/Command/_ctags | 441 +++++++++++++++++++++++------------------ 2 files changed, 249 insertions(+), 199 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index a0eb693f5..e8fa6093e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-03-28 Oliver Kiddle <opk@zsh.org> + * Jacob Gelbman: 48166: Completion/Unix/Command/_ctags: + add completion for language options + * Arseny Maslennikov: 48210, 48211: Completion/Linux/Command/_setpriv: new completion for setpriv(1) @@ -53,8 +56,8 @@ 2021-02-24 Peter Stephenson <p.stephenson@samsung.com> - * 48105: Jacob Gelbman:Completion/Unix/Command/_ctags: update and - fix formatting nad import. + * 48105: Jacob Gelbman: Completion/Unix/Command/_ctags: update and + fix formatting and import. 2021-02-23 Peter Stephenson <p.stephenson@samsung.com> diff --git a/Completion/Unix/Command/_ctags b/Completion/Unix/Command/_ctags index 30c631d37..3c80ba1c5 100644 --- a/Completion/Unix/Command/_ctags +++ b/Completion/Unix/Command/_ctags @@ -1,197 +1,244 @@ -#compdef ctags - -local context state line expl -local -A opt_args - -if [ -z "$_ctags_type" ]; then - local output=`ctags --version 2>&1` - if [[ "$output" = *Universal\ Ctags* ]]; then - _ctags_type="universal" - elif [[ "$output" = *Exuberant\ Ctags* ]]; then - _ctags_type="exuberant" - elif [[ "$output" = *usage:\ ctags* ]]; then - _ctags_type="bsd" - elif [[ "$output" = *Emacs* ]]; then - _ctags_type="etags" - else - _ctags_type="universal" - fi -fi - -if [ "$_ctags_type" = "etags" ]; then - _etags - return $? -fi - -local -a arguments - -if [ "$_ctags_type" = "universal" ]; then - arguments=( - "-?[help text]" - "-a[append to tags file]" - "-B[use backward searching patterns (?...?)]" - "-D[give definition for macro]:macro definition:" - "-e[output tag file for use with emacs]" - "-f[write tags to specified file. - is stdout]:file:_files" - "-F[use forward searching patterns (/.../)]" - "-G[equivalent to --guess-language-eagerly]" - "-h[specify list of file extensions to be treated as include files]:" - "-I[a list of tokens to be specifically handled is read from either the command line or the specified file]:" - "-L[a list of input file names is read from the specified file. - is stdin]:file:_files" - "-n[equivalent to --excmd=number]" - "-N[equivalent to --excmd=pattern]" - "-o[alternative to -f]:file:_files" - "-R[equivalent to --recurse]" - "-u[equivalent to --sort=no]" - "-V[equivalent to --verbose]" - "-x[print a tabular cross reference file to stdout]" - "--alias-<lang>=[add a pattern detecting a name, can be used as an alt name for lang]:pattern" - "--append=[should tags be appended to existing tag file]:bool:(yes no)" - "--etags-include=[include reference to file in emacs style tag file]:file:_files" - "--exclude=[exclude files and directories matching pattern]:pattern" - "--exclude-exception=[don't exclude files and directories matching pattern even if they match the pattern specified with --exclude]:pattern" - "--excmd=[uses the specified type of ex command to locate tags]:ex command type:(number pattern mix combine)" - "--extras=[include extra tag entries for selected information (flags fFgpqrs)]:flags" - "--extras-<lang>=[include <lang> own extra tag entries for selected information]:flags" - "--fields=[include selected extension fields (flags aCeEfFikKlmnNpPrRsStxzZ)]:flags" - "--fields-<lang>=[include selected <lang> own extension fields]:flags" - "--filter=[behave as a filter, reading file names from stdin and writing tags to stdout]:bool:(yes no)" - "--filter-terminator=[specify string to print to stdout following the tags for each file parsed when --filter is enabled]:string" - "--format=[force output of specified tag file format]:level" - "--guess-language-eagerly[guess the language of input file more eagerly]" - "--help[help text]" - "--help-full[help text with experimental features]" - "--if0=[should code within #if 0 conditionals be parsed]:bool:(yes no)" - "--input-encoding=[specify encoding of all input files]:encoding" - "--input-encoding-<lang>=[specify encoding of the <lang> input files]:encoding" - "--kinddef-<lang>=[define new kind for <lang>]:kind" - "--kinds-<lang>=[enable/disable tag kinds for <lang>]:kind" - "--langdef=[define a new language to be parsed with regular expressions]:name" - "--langmap=[override default mapping of language to input file extension]:maps" - "--language-force=[force all files to be interpreted using specified language]:language:->language" - "--languages=[restrict files scanned to these comma-separated languages]:language:->languages" - "--license[print details of software license]" - "--line-directives=[should #line directives be processed]:bool:(yes no)" - "--links=[indicate whether symlinks should be followed]:bool:(yes no)" - "--list-aliases=[list of alias patterns]:language:->language" - "--list-excludes[list of exclude patterns for files/dirs]" - "--list-extras=[list of extra tag flags]:language:->language" - "--list-features[list of compiled features]" - "--list-fields=[list of fields]:language:->language" - "--list-kinds=[list of all tag kinds for lang]:language:->language" - "--list-kinds-full=[list details of all tag kinds for lang]:language:->language" - "--list-languages[list of supported languages]" - "--list-map-extensions=[list of language extensions in mapping]:language:->language" - "--list-map-patterns=[list of language patterns in mapping]:language:->language" - "--list-maps=[list of language mappings (both extensions and patterns)]:language:->language" - "--list-mline-regex-flags[list of flags which can be used in a multiline regex parser definition]" - "--list-params=[list of language parameters. works with --machinable]:language:->language" - "--list-pseudo-tags[list of pseudo tags]" - "--list-regex-flags[list of flags which can be used in a regex parser definition]" - "--list-roles=[list of all roles of tag kinds specified for langs]:language:->language" - "--list-subparsers=[list of subparsers for the base lang]:language:->language" - "--machinable=[use tab separated representation in --list-* output]:bool:(yes no)" - "--map-<lang>=[set, add(+), or remove(-) the map for <lang>]:pattern" - "--maxdepth=[specify maximum recursion depth]:depth" - "--mline-regex-<lang>=[define multiline regex for locating tags in <lang>]:pattern" - "--options=[specify file (or dir) from which command line options should be read]:file:_files" - "--options-maybe=[same as --options but doesn't error]:file:_files" - "--optlib-dir=[add or set dir to optlib search path]:dir:_files -/" - "--output-encoding=[the encoding to write the tag file in]:encoding" - "--output-format=[specify the output format]:format:(u-ctags e-ctags etags xref)" - "--param-<lang>=[set <lang> specific parameter]:argument" - "--pattern-length-limit=[cutoff patterns of tag entries after N characters]:number" - "--print-language[don't make tags file but just print the guessed lang name for input file]" - "--pseudo-tags=[enable/disable emitting pseudo tag named ptag. if *, enable emitting all pseudo tags]:ptag" - "--put-field-prefix[put UCTAGS as prefix for the name of fields newly introducted in universal ctags]" - "--quiet=[don't print notice class messages]:bool:(yes no)" - "--recurse=[recurse]:bool:(yes no)" - "--regex-<lang>=[define regex for locating tags in specific lang]:pattern" - "--roles-<lang>.<kind>=[enable/disable tag roles for kinds of <lang>]:role" - "--sort=[should tags be sorted]:argument:(yes no foldcase)" - "--tag-relative=[should paths be relative to location of tag file]:argument:(yes no always never)" - "--totals=[print stats about input and tag files]:arguments:(yes no extra)" - "--verbose=[enable verbose messages describing actions]:bool:(yes no)" - "--version[print version]" - "--with-list-header=[prepend the column descriptions in --list-* output]:bool:(yes no)" - "*:file:_files" - ) -elif [ "$_ctags_type" = "exuberant" ]; then - arguments=( - "-a[append to tags file]" - "-B[use backward searching patterns (?...?)]" - "-e[output tag file for use with emacs]" - "-f[write tags to specified file. - is stdout]:file:_files" - "-F[use forward searching patterns (/.../)]" - "-h[specify list of file extensions to be treated as include files]:" - "-I[a list of tokens to be specifically handled is read from either the command line or the specified file]:" - "-L[a list of input file names is read from the specified file. - is stdin]:file:_files" - "-n[equivalent to --excmd=number]" - "-N[equivalent to --excmd=pattern]" - "-o[alternative to -f]:file:_files" - "-R[equivalent to --recurse]" - "-u[equivalent to --sort=no]" - "-V[equivalent to --verbose]" - "-x[print a tabular cross reference file to stdout]" - "--append=[should tags be appended to existing tag file]:bool:(yes no)" - "--etags-include=[include reference to file in emacs style tag file]:file:_files" - "--exclude=[exclude files and directories matching pattern]:pattern" - "--excmd=[uses the specified type of ex command to locate tags]:ex command type:(number pattern mix)" - "--extra=[include extra tag entries for selected information (flags fq)]:flags" - "--fields=[include selected extension fields (flags afmikKlnsStz)]:flags" - "--file-scope=[should tags scoped only for a single file be included in output]:bool:(yes no)" - "--filter=[behave as a filter, reading file names from stdin and writing tags to stdout]:bool:(yes no)" - "--filter-terminator=[specify string to print to stdout following the tags for each file parsed when --filter is enabled]:string" - "--format=[force output of specified tag file format]:level" - "--help[help text]" - "--if0=[should code within #if 0 conditionals be parsed]:bool:(yes no)" - "--<lang>-kinds=[enable/disable tag kinds for <lang>]:kind" - "--langdef=[define a new language to be parsed with regular expressions]:name" - "--langmap=[override default mapping of language to input file extension]:maps" - "--language-force=[force all files to be interpreted using specified language]:language:->language" - "--languages=[restrict files scanned to these comma-separated languages]:language:->languages" - "--license[print details of software license]" - "--line-directives=[should #line directives be processed]:bool:(yes no)" - "--links=[indicate whether symlinks should be followed]:bool:(yes no)" - "--list-kinds=[list of all tag kinds for lang]:language:->language" - "--list-languages[list of supported languages]" - "--list-maps=[list of language mappings (both extensions and patterns)]:language:->language" - "--options=[specify file (or dir) from which command line options should be read]:file:_files" - "--recurse=[recurse]:bool:(yes no)" - "--regex-<lang>=[define regex for locating tags in specific lang]:pattern" - "--sort=[should tags be sorted]:argument:(yes no foldcase)" - "--tag-relative=[should paths be relative to location of tag file]:argument:(yes no)" - "--totals=[print stats about input and tag files]:arguments:(yes no)" - "--verbose=[enable verbose messages describing actions]:bool:(yes no)" - "--version[print version]” - "*:file:_files" - ) -elif [ "$_ctags_type" = "bsd" ]; then - arguments=( - "-a[append to tags file]" - "-B[use backward searching patterns (?...?)]" - "-d[create tags for #defines that don't take arguments]" - "-F[use forward searching patterns (/.../)]" - "-f[write tags to specified file]:file:_files" - "-t[create tags for typedefs, structs, unions, and enums]" - "-u[update the specified files in the tags file]" - "-v[an index of the form expected by vgrind(1) is produced]" - "-w[suppress warning diagnostics]" - "-x[ctags produces a simple function index]" - "*:file:_files" - ) -fi - -_arguments $arguments - -if [[ "$state" = language* ]]; then - local -a languages - languages=(`ctags --list-languages | cut -d" " -f1`) - if [ "$state" = "language" ]; then - _wanted languages expl language compadd $languages - elif [ "$state" = "languages" ]; then - _values -s , languages $languages - fi -fi - -return $(( compstate[nmatches] > 0 ? 0 : 1 )) +#compdef ctags arduino-ctags ctags-exuberant ctags-universal + +local context state line expl +local -A opt_args +local -a arguments + +if [ -z "$_ctags_type" ]; then + local output=`ctags --version 2>&1` + if [[ "$output" = *Universal\ Ctags* ]]; then + _ctags_type="universal" + elif [[ "$output" = *Exuberant\ Ctags* ]]; then + _ctags_type="exuberant" + elif [[ "$output" = *usage:\ ctags* ]]; then + _ctags_type="bsd" + elif [[ "$output" = *Emacs* ]]; then + _ctags_type="etags" + else + _ctags_type="universal" + fi +fi + +if [ "$_ctags_type" = "etags" ]; then + _etags + return $? +fi + +_ctags_languages() { + _call_program languages $service --list-languages | sed -n 's/^\([A-Za-z][A-Za-z0-9#_+]*\).*/\1/p' +} + +if [[ "$PREFIX" = --alias-*=* ]]; then + _message pattern + return 1 +elif [[ "$PREFIX" = --extras-*=* ]]; then + _message flags + return 1 +elif [[ "$PREFIX" = --fields-*=* ]]; then + _message flags + return 1 +elif [[ "$PREFIX" = --input-encoding-*=* ]]; then + _message encoding + return 1 +elif [[ "$PREFIX" = --kinddef-*=* ]]; then + _message kind + return 1 +elif [[ "$PREFIX" = --kinds-*=* ]]; then + _message kind + return 1 +elif [[ "$PREFIX" = --map-*=* ]]; then + _message pattern + return 1 +elif [[ "$PREFIX" = --mline-regex-*=* ]]; then + _message pattern + return 1 +elif [[ "$PREFIX" = --param-*=* ]]; then + _message argument + return 1 +elif [[ "$PREFIX" = --regex-*=* ]]; then + _message pattern + return 1 +elif [[ "$PREFIX" = --roles-*.*=* ]] then + _message role + return 1 +elif [[ "$PREFIX" = --roles-*.* ]] then + _message kind + return 1 +fi + +if [ "$_ctags_type" = "universal" ]; then + arguments=( + "-a[append to tags file]" + "-B[use backward searching patterns (?...?)]" + "-D[give definition for macro]:macro definition:" + "-e[output tag file for use with emacs]" + {-f+,-o+}"[write tags to specified file]:output file:_files" + "-F[use forward searching patterns (/.../)]" + "-h[specify a list of file extensions to be treated as include files]:extensions" + "-I[specify a list of tokens to be specially handled]:identifier list" + "-L[read a list of input file names from the specified file]:input file:_files" + "-n[equivalent to --excmd=number]" + "-N[equivalent to --excmd=pattern]" + "(--recurse -R)--recurse=-[search files recursively]::bool:(yes no)" + "(--recurse -R)-R[search files recursively]" + "-u[equivalent to --sort=no]" + "-x[print a tabular cross reference file to stdout]" + "--alias--[add a pattern detecting a name, can be used as an alt name for lang]:language:->languageequals" + "--append=-[should tags be appended to existing tag file]:bool:(yes no)" + "--etags-include=-[include reference to file in emacs style tag file]:file:_files" + "--exclude=-[exclude files and directories matching pattern]:pattern" + "--exclude-exception=-[don't exclude files and directories matching pattern even if they match the pattern specified with --exclude]:pattern" + "--excmd=-[uses the specified type of ex command to locate tags]:ex command type:(number pattern mix combine)" + "--extras=-[include extra tag entries for selected information]:flags (fFgpqrs)" + "--extras--[include <lang> own extra tag entries for selected information]:language:->languageequals" + "--fields=-[include selected extension fields]:flags (aCeEfFikKlmnNpPrRsStxzZ)" + "--fields--[include selected <lang> own extension fields]:language:->languageequals" + "--filter=-[behave as a filter, reading file names from stdin and writing tags to stdout]:bool:(yes no)" + "--filter-terminator=-[specify string to print to stdout following the tags for each file parsed when --filter is enabled]:string" + "--format=-[force output of specified tag file format]:level" + "(--guess-language-eagerly -G)"{--guess-language-eagerly,-G}"[guess the language of input file more eagerly]" + {--help,-?}"[display help text]" + "--help-full[display help text with experimental features]" + "--if0=-[should code within #if 0 conditionals be parsed]:bool:(yes no)" + "--input-encoding=-[specify encoding of all input files]:encoding" + "--input-encoding--[specify encoding of the <lang> input files]:language:->languageequals" + "--kinddef--[define new kind for <lang>]:language:->languageequals" + "--kinds--[enable/disable tag kinds for <lang>]:language:->languageequals" + "--langdef=-[define a new language to be parsed with regular expressions]:name" + "--langmap=-[override default mapping of language to input file extension]:maps" + "--language-force=-[force all files to be interpreted using specified language]:language:->language" + "--languages=-[restrict files scanned to these comma-separated languages]:language:->languages" + "--license[print details of software license]" + "--line-directives=-[should #line directives be processed]:bool:(yes no)" + "--links=-[indicate whether symlinks should be followed]:bool:(yes no)" + "--list-aliases=-[list of alias patterns]:language:->language" + "--list-excludes[list of exclude patterns for files/dirs]" + "--list-extras=-[list of extra tag flags]:language:->language" + "--list-features[list of compiled features]" + "--list-fields=-[list of fields]:language:->language" + "--list-kinds=-[list of all tag kinds for lang]:language:->language" + "--list-kinds-full=-[list details of all tag kinds for lang]:language:->language" + "--list-languages[list of supported languages]" + "--list-map-extensions=-[list of language extensions in mapping]:language:->language" + "--list-map-patterns=-[list of language patterns in mapping]:language:->language" + "--list-maps=-[list of language mappings (both extensions and patterns)]:language:->language" + "--list-mline-regex-flags[list of flags which can be used in a multiline regex parser definition]" + "--list-params=-[list of language parameters. works with --machinable]:language:->language" + "--list-pseudo-tags[list of pseudo tags]" + "--list-regex-flags[list of flags which can be used in a regex parser definition]" + "--list-roles=-[list of all roles of tag kinds specified for langs]:language:->language" + "--list-subparsers=-[list of subparsers for the base lang]:language:->language" + "--machinable=-[use tab separated representation in --list-* output]:bool:(yes no)" + "--map--[set, add(+), or remove(-) the map for <lang>]:language:->languageequals" + "--maxdepth=-[specify maximum recursion depth]:depth" + "--mline-regex--[define multiline regex for locating tags in <lang>]:language:->languageequals" + "--options=-[specify file (or dir) from which command line options should be read]:file:_files" + "--options-maybe=-[same as --options but doesn't error]:file:_files" + "--optlib-dir=-[add or set dir to optlib search path]:dir:_files -/" + "--output-encoding=-[the encoding to write the tag file in]:encoding" + "--output-format=-[specify the output format]:format:(u-ctags e-ctags etags xref)" + "--param--[set <lang> specific parameter]:language:->languageequals" + "--pattern-length-limit=-[cutoff patterns of tag entries after N characters]:number" + "--print-language[don't make tags file but just print the guessed lang name for input file]" + "--pseudo-tags=-[enable/disable emitting pseudo tag named ptag. if *, enable emitting all pseudo tags]:ptag" + "--put-field-prefix[put UCTAGS as prefix for the name of fields newly introducted in universal ctags]" + "--quiet=-[don't print notice class messages]:bool:(yes no)" + "--regex--[define regex for locating tags in specific lang]:language:->languageequals" + "--roles--[enable/disable tag roles for kinds of <lang>]:language:->languagedot" + "--sort=-[should tags be sorted]:argument:(yes no foldcase)" + "--tag-relative=-[should paths be relative to location of tag file]:argument:(yes no always never)" + "--totals=-[print stats about input and tag files]:arguments:(yes no extra)" + "(--verbose -V)--verbose=-[enable verbose messages describing actions]:bool:(yes no)" + "(--verbose -V)-V[enable verbose messages describing actions]" + "--version[print version]" + "--with-list-header=-[prepend the column descriptions in --list-* output]:bool:(yes no)" + "*:file:_files" + ) +elif [ "$_ctags_type" = "exuberant" ]; then + arguments=( + "-a[append to tags file]" + "-B[use backward searching patterns (?...?)]" + "-e[output tag file for use with emacs]" + {-f+,-o+}"[write tags to specified file]:output file:_files" + "-F[use forward searching patterns (/.../)]" + "-h[specify a list of file extensions to be treated as include files]:extensions" + "-I[specify a list of tokens to be specially handled]:identifier list" + "-L[read a list of input file names from the specified file]:input file:_files" + "-n[equivalent to --excmd=number]" + "-N[equivalent to --excmd=pattern]" + "(--recurse -R)--recurse=-[search files recursively]::bool:(yes no)" + "(--recurse -R)-R[search files recursively]" + "-u[equivalent to --sort=no]" + "-x[print a tabular cross reference file to stdout]" + "--append=-[should tags be appended to existing tag file]:bool:(yes no)" + "--etags-include=-[include reference to file in emacs style tag file]:file:_files" + "--exclude=-[exclude files and directories matching pattern]:pattern" + "--excmd=-[uses the specified type of ex command to locate tags]:ex command type:(number pattern mix)" + "--extra=-[include extra tag entries for selected information]:flags (fg)" + "--fields=-[include selected extension fields]:flags (afmikKlnsStz)" + "--file-scope=-[should tags scoped only for a single file be included in output]:bool:(yes no)" + "--filter=-[behave as a filter, reading file names from stdin and writing tags to stdout]:bool:(yes no)" + "--filter-terminator=-[specify string to print to stdout following the tags for each file parsed when --filter is enabled]:string" + "--format=-[force output of specified tag file format]:level" + "--help[display help text]" + "--if0=-[should code within #if 0 conditionals be parsed]:bool:(yes no)" + "--langdef=-[define a new language to be parsed with regular expressions]:name" + "--langmap=-[override default mapping of language to input file extension]:maps" + "--language-force=-[force all files to be interpreted using specified language]:language:->language" + "--languages=-[restrict files scanned to these comma-separated languages]:language:->languages" + "--license[print details of software license]" + "--line-directives=-[should #line directives be processed]:bool:(yes no)" + "--links=-[indicate whether symlinks should be followed]:bool:(yes no)" + "--list-kinds=-[list of all tag kinds for lang]:language:->language" + "--list-languages[list of supported languages]" + "--list-maps=-[list of language mappings (both extensions and patterns)]:language:->language" + "--options=-[specify file (or dir) from which command line options should be read]:file:_files" + "--regex--[define regex for locating tags in specific lang]:language:->language" + "--sort=-[should tags be sorted]:argument:(yes no foldcase)" + "--tag-relative=-[should paths be relative to location of tag file]:argument:(yes no)" + "--totals=-[print stats about input and tag files]:arguments:(yes no)" + "(--verbose -V)--verbose=-[enable verbose messages describing actions]:bool:(yes no)" + "(--verbose -V)-V[enable verbose messages describing actions]" + "--version[print version]" + "*:file:_files" + ) + if [[ "$PREFIX" = -* ]]; then + local -a languages=(`_ctags_languages`) + local -a languages2 + for language in $languages; do + arguments+=("--$language-kinds=-:kinds") + done + fi +elif [ "$_ctags_type" = "bsd" ]; then + arguments=( + "-a[append to tags file]" + "-B[use backward searching patterns (?...?)]" + "-d[create tags for #defines that don't take arguments]" + "-F[use forward searching patterns (/.../)]" + "-f+[write tags to specified file]:output file:_files" + "-t[create tags for typedefs, structs, unions, and enums]" + "-u[update the specified files in the tags file]" + "-v[an index of the form expected by vgrind(1) is produced]" + "-w[suppress warning diagnostics]" + "-x[ctags produces a simple function index]" + "*:file:_files" + ) +fi + +_arguments -s $arguments + +if [ "$state" = "language" ]; then + local -a languages=(`_ctags_languages`) + _wanted languages expl language compadd -a languages +elif [ "$state" = "languageequals" ]; then + local -a languages=(`_ctags_languages`) + _wanted languages expl language compadd -S = -a languages +elif [ "$state" = "languagedot" ]; then + local -a languages=(`_ctags_languages`) + _wanted languages expl language compadd -S . -a languages +elif [ "$state" = "languages" ]; then + local -a languages=(`_ctags_languages`) + _values -s , languages $languages +fi + +return $(( compstate[nmatches] > 0 ? 0 : 1 )) -- cgit v1.2.3 From 7518b20a01bd27a9246d9b040ba5f972ab686e62 Mon Sep 17 00:00:00 2001 From: Marc Chantreux <eiro@phear.org> Date: Sat, 27 Feb 2021 16:27:35 +0100 Subject: users/26557: add bookmarks support and remove the header from the final list in surfraw completion --- ChangeLog | 5 +++++ Completion/Unix/Command/_surfraw | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 83bd3c3a7..204a71296 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-03-31 Oliver Kiddle <opk@zsh.org> + + * Marc Chantreux: users/26557: Completion/Unix/Command/_surfraw: + add bookmarks support and remove the header from the final list + 2021-03-29 Aleksandr Mezin <mezin.alexander@gmail.com> * 47561 (the git and cvs parts) (compare 44919 + 44920): diff --git a/Completion/Unix/Command/_surfraw b/Completion/Unix/Command/_surfraw index f945f1ca9..343d275cc 100644 --- a/Completion/Unix/Command/_surfraw +++ b/Completion/Unix/Command/_surfraw @@ -424,12 +424,26 @@ case $state in yubnub) _message -e command 'Yubnub Command' ;; + *) + _message -e string 'search string' + ;; esac ;; elvi) + local -UT XDG_CONFIG_DIRS xcd + # as it starts with a space, the header becomes an empty + # string removed by the list expansion _wanted elvi expl elvi compadd \ - ${${${(f)"$(_call_program elvi surfraw -elvi)"}%%[[:space:]]##--*}%:*} && ret=0 + ${${(f)"$(surfraw -elvi)"}%%[[:space:]]*} $( + # extract the keys of all bookmarks (should be in surfraw itself) + awk '{keys[$1]=1} END {for (k in keys) print k}' \ + $^xcd/surfraw/bookmarks(Nr) \ + /etc/xdg/surfraw/bookmarks(Nr) \ + /etc/surfraw.bookmarks(Nr) \ + ${XDG_CONFIG_HOME-${HOME?homeless}/.config}/surfraw/bookmarks(Nr) \ + ${HOME?homeless}/.surfraw.bookmarks(Nr) + ) && ret=0 ;; -esac +esac return ret -- cgit v1.2.3 From 5d0bb152ef1486e1b38326e37e91e98295bc6946 Mon Sep 17 00:00:00 2001 From: Syphdias <syphdias+git@gmail.com> Date: Thu, 18 Mar 2021 23:23:16 +0100 Subject: 48192: Fix _openstack completion for new style clients --- ChangeLog | 3 + Completion/Unix/Command/_openstack | 117 ++++++++++++++++++++----------------- 2 files changed, 67 insertions(+), 53 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 204a71296..e8be1f36d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-03-31 Oliver Kiddle <opk@zsh.org> + * Christian K: 48192: Completion/Unix/Command/_openstack: + Fix openstack completion for new style clients + * Marc Chantreux: users/26557: Completion/Unix/Command/_surfraw: add bookmarks support and remove the header from the final list diff --git a/Completion/Unix/Command/_openstack b/Completion/Unix/Command/_openstack index fcb704ac8..d55686b80 100644 --- a/Completion/Unix/Command/_openstack +++ b/Completion/Unix/Command/_openstack @@ -34,8 +34,6 @@ if (( ! $+_cache_openstack_clnt_opts )); then typeset -gA _cache_openstack_clnt_opts typeset -gA _cache_openstack_clnt_cmds typeset -gA _cache_openstack_clnt_cmds_opts - typeset -gA _cache_openstack_clnt_cmds_subcmds - typeset -gA _cache_openstack_clnt_cmds_subcmd_opts fi local -a conn_opts @@ -61,65 +59,78 @@ if [[ -n ${clnts_compl_new[(r)$service]} ]]; then # Populate caches - clnt_outputs is command raw output used later _cache_openstack_clnt_outputs[$service]=${:-"$($service ${(Q)conn_opts} complete 2>/dev/null)"} _cache_openstack_clnt_opts[$service]=${${${${(M)${${${${=${(f)"$($service help 2>/dev/null)"}}/\[}/\]}/\;}:#-[-0-9A-Za-z]*}/,}/\.}%--os-} - _cache_openstack_clnt_cmds[$service]=${${${${_cache_openstack_clnt_outputs[$service]}/* cmds=\'}/\'*}/complete} fi - local cmd subcmd - # Determine the command - for word in ${words:1}; do - local s=${_cache_openstack_clnt_cmds[$service]} - [[ $s[(wI)$word] -gt 0 ]] && cmd=$word && break - done - # Populate the subcommand cache - if [[ -n $cmd && -z $_cache_openstack_clnt_cmds_subcmds[$service$cmd] ]]; then - local t=cmds_${cmd//-/_} - _cache_openstack_clnt_cmds_subcmds[$service$cmd]=${${${_cache_openstack_clnt_outputs[$service]}/* $t=\'}/\'*} + + # get worlds left of the curser into an array + local -a left_words + left_words=(${=LBUFFER}) + + # if curser is directly at a word (no space at the end), + # exclude the last word to offer right matches + # the last word could be a partial match that is later checked (prefix-needed) + local partial="" + if [[ "${LBUFFER[-1]}" != " " ]]; then + partial=${(@)left_words[-1]} + left_words=(${(@)left_words[1,$#left_words-1]}) fi - # Determine the subcommand - if [[ -n $cmd ]]; then - for word in ${words:2}; do - local s=${_cache_openstack_clnt_cmds_subcmds[$service$cmd]} - [[ $s[(wI)$word] -gt 0 ]] && subcmd=$word && break - done - # Populate subcommand option cache - if [[ -n $subcmd && -z $_cache_openstack_clnt_cmds_subcmd_opts[$service${cmd}--$subcmd] ]]; then - local t=cmds_${cmd//-/_}_${subcmd//-/_} - _cache_openstack_clnt_cmds_subcmd_opts[$service${cmd}--$subcmd]=${${${_cache_openstack_clnt_outputs[$service]}/* $t=\'}/\'*} - fi + # remove $service + left_words=(${left_words:1}) + + # filter out "help" + if [[ $left_words[1] == help ]]; then + left_words=(${(@)left_words[2,$#left_words]}) fi - # Special treatment for the help command - if [[ $cmd == help ]]; then - if [[ $words[CURRENT-1] == $cmd && $words[CURRENT] != -* ]]; then - # Offer commands - [[ -n $_cache_openstack_clnt_cmds[$service] ]] && _values -w option ${(u)=_cache_openstack_clnt_cmds[$service]} && ret=0 - elif [[ $words[CURRENT-2] == $cmd && $words[CURRENT-1] != -* && $words[CURRENT] != -* ]]; then - # Offer subcommands - local cmd=$words[CURRENT-1] - local t=cmds_${cmd//-/_} - [[ -z $_cache_openstack_clnt_cmds_subcmds[$service$cmd] ]] && _cache_openstack_clnt_cmds_subcmds[$service$cmd]=${${${_cache_openstack_clnt_outputs[$service]}/* $t=\'}/\'*} - [[ -n $_cache_openstack_clnt_cmds_subcmds[$service$cmd] ]] && _values -w option ${(u)=_cache_openstack_clnt_cmds_subcmds[$service$cmd]} && ret=0 - else - # Handle help<TAB> properly - _values -w option help && ret=0 - fi - # Client options - elif [[ -z $cmd && $words[CURRENT] == -* ]]; then - _values -w option ${(u)=_cache_openstack_clnt_opts[$service]} && ret=0 - # Commands - elif [[ -z $cmd ]]; then - if [[ -z $_cache_openstack_clnt_cmds[$service] ]]; then - _message "missing authentication options" + + # filter out options (-*) + left_words=(${left_words//-*}) + + local -a subcmd_array cmds_array cache_key_array cache_values + subcmd_array=() + cmds_array=(cmds) + cache_key_array=(${service}) + cache_values=() + local cache_key cmds + cache_key="" + cmds="" + + # Check for matches one level at a time + # example: "" server create + for word in "" ${(@)left_words}; do # first loop second loop third loop + subcmd_array=(${(@)subcmd_array} ${word}) # () (server) (server create) + cmds_array=(${(@)cmds_array} ${word}) # (cmds) (cmds server) (cmds server create) + cmds=${${(j:_:)cmds_array}/-/_} # cmds cmds_openstack cmds_server_create + cache_key_array=(${(@)cache_key_array} ${word}) # (openstack) (openstack server) (openstack server create) + cache_key=${${(j:_:)cache_key_array}/-/_} # openstack openstack_server openstack_server_create + + # lookup if current word is in cache_values of last elements + if [[ ${cache_values[(wI)${word}]} -gt 0 || $word == "" ]]; then + _cache_openstack_clnt_cmds[${cache_key}]=${${${_cache_openstack_clnt_outputs[${service}]}/* ${cmds}=\'}/\'*} else - _values -w option ${(u)=_cache_openstack_clnt_cmds[$service]} && ret=0 + # unknown word: set cache_key to last cache_key and break + cache_key=${${(j:_:)${cache_key_array:0:${#cache_key_array}-1}}/-/_} + break fi - # Subcommands - elif [[ -z $subcmd ]]; then - [[ -n $_cache_openstack_clnt_cmds_subcmds[$service$cmd] ]] && _values -w option ${(u)=_cache_openstack_clnt_cmds_subcmds[$service$cmd]} && ret=0 - # Subcommand options + # set cache_values for next loop + cache_values=${_cache_openstack_clnt_cmds[${cache_key}]} + done + + # Populate the command cache + if [[ -z $_cache_openstack_clnt_cmds[${cache_key}] ]]; then + _message "missing authentication options" else - { ! zstyle -T ":completion:${curcontext}:options" prefix-needed || [[ -prefix - ]] } && \ - [[ -n $_cache_openstack_clnt_cmds_subcmd_opts[$service${cmd}--$subcmd] ]] && _values -w option ${(u)=_cache_openstack_clnt_cmds_subcmd_opts[$service${cmd}--$subcmd]//\:/\\\:} && ret=0 + # add global options to completion list if current word start with -* + local extra_opts + if [[ $words[CURRENT] == -* ]]; then; + extra_opts=${_cache_openstack_clnt_opts[$service]} + fi + + { ! zstyle -T ":completion:${curcontext}:options" prefix-needed \ + || [[ -n "${partial}" && ${${_cache_openstack_clnt_cmds[${cache_key}]}[(Iw)${partial}*]} -gt 0 || -prefix - ]] } \ + && _values -w option ${(u)=_cache_openstack_clnt_cmds[${cache_key}]} ${(u)=extra_opts} \ + && ret=0 fi + # Old style clients elif [[ -n ${clnts_compl_old[(r)$service]} ]]; then if [[ -z $_cache_openstack_clnt_cmds[$service] ]]; then -- cgit v1.2.3 From 3afdfef31cf5da224c2e69bb0b942412cbf78b59 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan <caleb@alerque.com> Date: Wed, 31 Mar 2021 00:00:18 +0300 Subject: github #74: Drop vcsh completions, maintained upstream See discussion on upstream project here: https://github.com/RichiH/vcsh/issues/270 --- ChangeLog | 3 ++ Completion/Unix/Command/_vcsh | 89 ------------------------------------------- 2 files changed, 3 insertions(+), 89 deletions(-) delete mode 100644 Completion/Unix/Command/_vcsh (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index eafcd2fa5..237a1bb3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-03-31 Oliver Kiddle <opk@zsh.org> + * github #74: Caleb Maclennan: Completion/Unix/Command/_vcsh: + Drop vcsh completions, maintained upstream + * Marlon Richert: 48214: Completion/Base/Completer/_expand, Test/Y01completion.ztst: add file types to _expand completions, so they can be colored through complist diff --git a/Completion/Unix/Command/_vcsh b/Completion/Unix/Command/_vcsh deleted file mode 100644 index 00aed7d28..000000000 --- a/Completion/Unix/Command/_vcsh +++ /dev/null @@ -1,89 +0,0 @@ -#compdef vcsh - -function __vcsh_repositories () { - local -a repos - repos=( ${(f)"$(_call_program repositories vcsh list)"} ) - _describe -t repositories 'repository' repos -} - -function _vcsh-clone () { - _default #TODO -} - -local func -for func in help init list list-tracked pull push version; do - _vcsh-$func() { _nothing } -done -for func in delete enter list-tracked-by upgrade write-gitignore; do - _vcsh-$func() { (( CURRENT == 2 )) && __vcsh_repositories } -done - -function _vcsh-rename () { - case $CURRENT in - 2) __vcsh_repositories ;; - 3) _message "new repository name" ;; - *) _nothing ;; - esac -} - -function _vcsh-run () { - (( CURRENT == 2 )) && __vcsh_repositories - if (( CURRENT >= 3 )); then - words=( "${(@)words[3,-1]}" ) - (( CURRENT -= 2 )) - _complete - fi -} - -function _vcsh () { - local curcontext="${curcontext}" ret=1 - local state vcshcommand - local -a args subcommands - - subcommands=( - "clone:clone an existing repository" - "delete:delete an existing repository" - "enter:enter repository; spawn new <\$SHELL>" - "help:display help" - "init:initialize an empty repository" - "list:list all local vcsh repositories" - "list-tracked:list all files tracked by vcsh" - "list-tracked-by:list files tracked by a repository" - "pull:pull from all vcsh remotes" - "rename:rename a repository" - "run:run command with <\$GIT_DIR> and <\$GIT_WORK_TREE> set" - "upgrade:upgrade repository to currently recommended settings" - "version:print version information" - "which:find <substring> in name of any tracked file" - "write-gitignore:write .gitignore.d/<repo> via git ls-files" - ) - - args=( - '-c[source <file> prior to other configuration files]:config files:_path_files' - '-d[enable debug mode]' - '-v[enable verbose mode]' - '*:: :->subcommand_or_options_or_repo' - ) - - _arguments -C ${args} && ret=0 - - if [[ ${state} == "subcommand_or_options_or_repo" ]]; then - if (( CURRENT == 1 )); then - _describe -t subcommands 'vcsh sub-commands' subcommands && ret=0 - __vcsh_repositories && ret=0 - else - vcshcommand="${words[1]}" - if ! (( ${+functions[_vcsh-$vcshcommand]} )); then - # There is no handler function, so this is probably the name - # of a repository. Act accordingly. - _dispatch git git && ret=0 - else - curcontext="${curcontext%:*:*}:vcsh-${vcshcommand}:" - _call_function ret _vcsh-${vcshcommand} - fi - fi - fi - return ret -} - -_vcsh "$@" -- cgit v1.2.3 From 7a81e6344f233f8f8c3863f0835277582fb7de58 Mon Sep 17 00:00:00 2001 From: Jacob Gelbman <gelbman@gmail.com> Date: Sun, 4 Apr 2021 13:39:32 +0900 Subject: 48218 (+ 48354): various improvements for _gcc --- ChangeLog | 5 + Completion/Unix/Command/_gcc | 3041 ++++++++++++++++++++++++++++-------------- 2 files changed, 2057 insertions(+), 989 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 03ea15ad4..93f2c8678 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-04-04 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + + * Jacob Gelbman: 48218 (+ 48354): Completion/Unix/Command/_gcc: + various improvements for _gcc + 2021-04-02 Oliver Kiddle <opk@zsh.org> * 47510: Src/prompt.c, Src/zsh.h: drop code that avoided diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index 20b3abe59..22d3083de 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -1,6 +1,7 @@ #compdef gcc g++ cc c++ llvm-gcc llvm-g++ clang clang++ -value-,LDFLAGS,-default- -value-,CFLAGS,-default- -value-,CXXFLAGS,-default- -value-,CPPFLAGS,-default- -P gcc-* -P g++-* -P c++-* -local curcontext="$curcontext" state line ret=1 expl args args2 march +local curcontext="$curcontext" state line ret=1 expl i +local -a args args2 warnings arch typeset -A opt_args if [[ "$service" = -value-* ]]; then @@ -23,6 +24,7 @@ fi args=() case $MACHTYPE in + m68*) args=( -m68000 -m68020 -m68020-40 -m68030 -m68040 -m68881 @@ -56,6 +58,16 @@ amd290?0) arm) args=( -mapcs -m2 -m3 -m6 -mbsd -mxopen -mno-symrename + '-faapcs-bitfield-load[all volatile bit-field write generates at least one load]' + '-faapcs-bitfield-width[volatile bit-field width is dictated by the field container type]' + '-mcmse[allow use of CMSE]' + '-mexecute-only[disallow generation of data access to code sections]' + '-mno-movt[disallow use of movt/movw pairs]' + '-mno-neg-immediates[disallow converting instructions with negative immediates to their negation]' + '-mnocrc[disallow use of CRC instructions]' + '-mrestrict-it[disallow generation of deprecated IT blocks for ARMv8]' + '-mtp=[thread pointer access method]:arg' + '-munaligned-access[allow memory accesses to be unaligned]' ) ;; m88k) @@ -74,8 +86,8 @@ m88k) ) ;; rs6000|powerpc*) + arch=(rios1 rios2 rsc 501 603 604 power powerpc 403 common) args=( - '-mcpu=:CPU type:(rios1 rios2 rsc 501 603 604 power powerpc 403 common)' -mpower -mno-power -mpower2 -mno-power2 -mpowerpc -mno-powerpc -mpowerpc-gpopt -mno-powerpc-gpopt @@ -88,6 +100,32 @@ rs6000|powerpc*) -mtoc -mno-toc -mtraceback -mno-traceback -mlittle -mlittle-endian -mbig -mbig-endian -mcall-aix -mcall-sysv -mprototype + '-mcpu=:CPU type:->arch' + '-maltivec[altivec]' + '-mcmpb[cmpb]' + '-mcrbits[crbits]' + '-mcrypto[crypto]' + '-mdirect-move[direct move]' + '-mefpu2[efpu2]' + '-mfloat128[float128]' + '-mfprnd[fprnd]' + '-mhtm[htm]' + '-minvariant-function-descriptors[invariant function descriptors]' + '-misel[isel]' + '-mlongcall[longcall]' + '-mmfocrf[mfocrf]' + '-mmfcrf[mfcrf]' + '-mmma[mma]' + '-mpaired-vector-memops[paired vector memops]' + '-mpcrel[pcrel]' + '-mpopcntd[popcntd]' + '-mpower10-vector[power10 vector]' + '-mpower8-vector[power8 vector]' + '-mpower9-vector[power9 vector]' + '-mrop-protection[rop protection]' + '-msecure-plt[secure plt]' + '-mspe[spe]' + '-mvsx[vsx]' ) ;; romp) @@ -98,179 +136,233 @@ romp) ) ;; mips*) + arch=(r2000 r3000 r4000 r4400 r4600 r6000) args=( - '-mcpu=:CPU type:(r2000 r3000 r4000 r4400 r4600 r6000)' - -mabicalls -membedded-data - -membedded-pic -mfp32 -mfp64 -mgas -mgp32 -mgp64 - -mgpopt -mhalf-pic -mhard-float -mint64 -mips1 - -mips2 -mips3 -mlong64 -mlong-calls -mmemcpy - -mmips-as -mmips-tfile -mno-abicalls - -mno-embedded-data -mno-embedded-pic - -mno-gpopt -mno-long-calls - -mno-memcpy -mno-mips-tfile -mno-rnames -mno-stats - -mrnames -msoft-float - -m4650 -msingle-float -mmad - -mstats -EL -EB -nocpp - '-G:maximum size for small section objects:' + -membedded-pic -mgas -mgp32 -mgp64 -mhalf-pic -mhard-float -mint64 -mips1 + -mips2 -mips3 -mlong64 -mmemcpy -mmips-as -mmips-tfile -mno-abicalls + -mno-embedded-data -mno-embedded-pic -mno-gpopt -mno-long-calls -mno-memcpy + -mno-mips-tfile -mno-rnames -mno-stats -mrnames -msoft-float -m4650 -mmad + -mstats -nocpp + '-mcpu=:CPU type:->arch' + '-mabicalls[enable SVR4-style position-independent code]' + '-mabs=[abs]:arg' + '-mcheck-zero-division[check zero division]' + '-mcompact-branches=[compact branches]:arg' + '-mdouble-float[double float]' + '-mdsp[dsp]' + '-mdspr2[dspr2]' + '-membedded-data[place constants in the .rodata section instead of the .sdata section]' + '-mextern-sdata[assume that externally defined data is in the small data]' + '-mfp32[use 32-bit floating point registers]' + '-mfp64[use 64-bit floating point registers]' + '-mginv[ginv]' + '-mgpopt[use GP relative accesses for symbols known to be in a small data section]' + '-mindirect-jump=[change indirect jump instructions to inhibit speculation]:arg' + '-mips16[ips16]' + '-mldc1-sdc1[ldc1 sdc1]' + '-mlocal-sdata[extend the -G behaviour to object local data]' + '-mmadd4[enable the generation of 4-operand madd.s, madd.d, etc]' + '-mmicromips[micromips]' + '-mmsa[enable MSA ASE]' + '-mmt[enable MT ASE]' + '-mnan=[nan]:arg' + '-mno-mips16[no mips16]' + '-msingle-float[single float]' + '-mvirt[virt]' + '-mxgot[xgot]' ) ;; i[3456]86|x86_64) - march="native i386 i486 i586 pentium pentium-mmx pentiumpro i686 pentium2 pentium3 pentium3m pentium-m pentium4 pentium4m prescott nocona core2 corei7 corei7-avx core-avx-i core-avx2 atom k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp k8 opteron athlon64 athlon-fx k8-sse3 opteron-sse3 athlon64-sse3 amdfam10 barcelona bdver1 bdver2 bdver3 btver1 btver2 winchip-c6 winchip2 c3 c3-2 geode" + arch=( + native i386 i486 i586 pentium pentium-mmx pentiumpro i686 pentium2 pentium3 + pentium3m pentium-m pentium4 pentium4m prescott nocona core2 corei7 corei7-avx + core-avx-i core-avx2 atom k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp + athlon-mp k8 opteron athlon64 athlon-fx k8-sse3 opteron-sse3 athlon64-sse3 + amdfam10 barcelona bdver1 bdver2 bdver3 btver1 btver2 winchip-c6 winchip2 c3 + c3-2 geode + ) args=( - '-mtune=-[tune code for CPU type]:CPU type:('"$march"')' - #'-mtune-ctrl=-[Fine grain control of tune features]:feature-list:' #for dev use only - '-march=-[generate instructions for CPU type]:CPU type:('"generic $march"')' - -mthreads - '-mreg-alloc=:default register allocation order:' - - # arguments with options - '-mabi=-[Generate code that conforms to the given ABI]:abi:(ms sysv)' - '-maddress-mode=-[Use given address mode]:address mode:(short long)' - '-malign-data=-[Use the given data alignment]:type:(compat abi cacheline)' - '-malign-functions=-[Function starts are aligned to this power of 2]: **2 base for function alignment: ' - '-malign-jumps=-[Jump targets are aligned to this power of 2]: **2 base for jump goal alignment: ' - '-malign-loops=-[Loop code aligned to this power of 2]: **2 base for loop alignment: ' - '-masm=-[Use given assembler dialect]:asm dialect:(att intel)' - '-mbranch-cost=-[Branches are this expensive (1-5, arbitrary units)]:branch cost (1-5): ' - '-mcmodel=-[Use given x86-64 code model]:memory model:(32 small kernel medium large)' - '-mfpmath=-[Generate floating point mathematics using given instruction set]:FPU type:(387 sse sse,387 both)' - '-mfunction-return=-[Convert function return to call and return thunk]:choice:(keep thunk thunk-inline thunk-extern)' - '-mincoming-stack-boundary=-[Assume incoming stack aligned to this power of 2]:assumed size of boundary: ' - '-mindirect-branch=-[Convert indirect call and jump to call and return thunks]:choice:(keep thunk thunk-inline thunk-extern)' - '-mlarge-data-threshold=-[Data greater than given threshold will go into .ldata section in x86-64 medium model]:threshold: ' - '-mmem'{set,cpy}'-strategy=-[Specify memcpy expansion strategy when expected size is known]:strategy:' - '-mpreferred-stack-boundary=-[Attempt to keep stack aligned to this power of 2]:size of boundary: ' - '-mrecip=-[Control generation of reciprocal estimates]::instruction:(all none div divf divd rsqrt rsqrtf rsqrtd)' #TODO comma separated and can have ! - '-mregparm=-[Number of registers used to pass integer arguments]:number of integer argument registers: ' - '-mstack-protector-guard=-[Use given stack-protector guard]:guard:(global tls)' - '-mstringop-strategy=-[Chose strategy to generate stringop using]:stringop strategy:(byte_loop libcall loop rep_4byte rep_8byte rep_byte unrolled_loop)' - '-mtls-dialect=-[Use given thread-local storage dialect]:TLS dialect:(gnu gnu2)' - '-mveclibabi=-[Vector library ABI to use]:vector library ABI:(acml svml)' - - # arguments without options - '-m3dnow[Support 3DNow! built-in functions]' - '-m3dnowa[Support Athlon 3Dnow! built-in functions]' - '-m8bit-idiv[Expand 32bit/64bit integer divide into 8bit unsigned integer divide with run-time check]' - '-m16[Generate 16bit i386 code]' - '-m32[Generate 32bit i386 code]' - '-m64[Generate 64bit x86-64 code]' - '-m96bit-long-double[sizeof(long double) is 12]' '-m128bit-long-double[sizeof(long double) is 16]' - '-m80387[Use hardware fp]' - '-mabm[Support code generation of Advanced Bit Manipulation (ABM) instructions]' - '-maccumulate-outgoing-args[Reserve space for outgoing arguments in the function prologue]' - '-madx[Support flag-preserving add-carry instructions]' - '-maes[Support AES built-in functions and code generation]' - '-malign-double[Align some doubles on dword boundary]' - '-malign-stringops[Align destination of the string operations]' - '-mandroid[Generate code for the Android platform]' - '-mavx2[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX and AVX2 built-in functions and code generation]' - '-mavx256-split-unaligned-load[Split 32-byte AVX unaligned load]' - '-mavx256-split-unaligned-store[Split 32-byte AVX unaligned store]' - '-mavx512bw[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512BW built- in functions and code generation]' - '-mavx512cd[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512CD built- in functions and code generation]' - '-mavx512dq[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512DQ built- in functions and code generation]' - '-mavx512er[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512ER built- in functions and code generation]' - '-mavx512f[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F built-in functions and code generation]' - '-mavx512ifma[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512IFMA built-in functions and code generation]' - '-mavx512pf[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512PF built- in functions and code generation]' - '-mavx512vbmi[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512VBMI built-in functions and code generation]' - '-mavx512vl[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512VL built- in functions and code generation]' - '-mavx512vpopcntdq[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512F and AVX512VPOPCNTDQ built-in functions and code generation]' - '-mavx5124fmaps[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512F and AVX5124FMAPS built- in functions and code generation]' - '-mavx5124vnniw[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512F and AVX5124VNNIW built- in functions and code generation]' - '-mavx[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2 and AVX built-in functions and code generation]' - '-mbionic[Use Bionic C library]' - '-mbmi2[Support BMI2 built-in functions and code generation]' - '-mbmi[Support BMI built-in functions and code generation]' - '-mcld[Generate cld instruction in the function prologue]' - '-mclflushopt[Support CLFLUSHOPT instructions]' - '-mclwb[Support CLWB instruction]' - '-mclzero[Support CLZERO built-in functions and code generation]' - '-mcrc32[Support code generation of crc32 instruction]' - '-mcx16[Support code generation of cmpxchg16b instruction]' - '-mdispatch-scheduler[Do dispatch scheduling if processor is bdver1, bdver2, bdver3, bdver4 or znver1 and Haifa scheduling is selected]' - '-mf16c[Support F16C built-in functions and code generation]' - '-mfancy-math-387[Generate sin, cos, sqrt for FPU]' - '-mfentry[Emit profiling counter call at function entry before prologue]' - '-mfma4[Support FMA4 built-in functions and code generation]' - '-mfma[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX and FMA built-in functions and code generation]' - '-mforce-drap[Always use Dynamic Realigned Argument Pointer (DRAP) to realign stack]' - '-mfp-ret-in-387[Return values of functions in FPU registers]' - '-mfsgsbase[Support FSGSBASE built-in functions and code generation]' - '-mfxsr[Support FXSAVE and FXRSTOR instructions]' - '-mgeneral-regs-only[Generate code which uses only the general registers]' - '-mglibc[Use GNU C library]' - '-mhard-float[Use hardware fp]' - '-mhle[Support Hardware Lock Elision prefixes]' - '-miamcu[Generate code that conforms to Intel MCU psABI]' - '-mieee-fp[Use IEEE math for fp comparisons]' - '-mindirect-branch-register[Force indirect call and jump via register]' - '-minline-all-stringops[Inline all known string operations]' - '-minline-stringops-dynamically[Inline memset/memcpy string operations, but perform inline version only for small blocks]' - '-mlong-double-64[Use 64-bit long double]' - '-mlong-double-80[Use 80-bit long double]' - '-mlong-double-128[Use 128-bit long double]' - '-mlwp[Support LWP built-in functions and code generation]' - '-mlzcnt[Support LZCNT built-in function and code generation]' - '-mmitigate-rop[Attempt to avoid generating instruction sequences containing ret bytes]' - '-mmmx[Support MMX built-in functions]' - '-mmovbe[Support code generation of movbe instruction]' - '-mmpx[Support MPX code generation]' - '-mms-bitfields[Use native (MS) bitfield layout]' - '-mmusl[Use musl C library]' - '-mmwaitx[Support MWAITX and MONITORX built-in functions and code generation]' - '-mno-default[Clear all tune features]' - '-mno-sse4[Do not support SSE4.1 and SSE4.2 built-in functions and code generation]' - '-mnop-mcount[Generate mcount/__fentry__ calls as nops. To activate they need to be patched in]' - '-momit-leaf-frame-pointer[Omit the frame pointer in leaf functions]' - '-mpc32[Set 80387 floating-point precision to 32-bit]' - '-mpc64[Set 80387 floating-point precision to 64-bit]' - '-mpc80[Set 80387 floating-point precision to 80-bit]' - '-mpclmul[Support PCLMUL built-in functions and code generation]' - '-mpku[Support PKU built-in functions and code generation]' - '-mpopcnt[Support code generation of popcnt instruction]' - '-mprefer-avx128[Use 128-bit AVX instructions instead of 256-bit AVX instructions in the auto-vectorizer]' - '-mprefetchwt1[Support PREFETCHWT1 built-in functions and code generation]' - '-mprfchw[Support PREFETCHW instruction]' - '-mpush-args[Use push instructions to save outgoing arguments]' - '-mrdpid[Support RDPID built-in functions and code generation]' - '-mrdrnd[Support RDRND built-in functions and code generation]' - '-mrdseed[Support RDSEED instruction]' - '-mrecip[Generate reciprocals instead of divss and sqrtss]' - '-mrecord-mcount[Generate __mcount_loc section with all mcount or __fentry__ calls]' - '-mred-zone[Use red-zone in the x86-64 code]' - '-mrtd[Alternate calling convention]' - '-mrtm[Support RTM built-in functions and code generation]' - '-msahf[Support code generation of sahf instruction in 64bit x86-64 code]' - '-msgx[Support SGX built-in functions and code generation]' - '-msha[Support SHA1 and SHA256 built-in functions and code generation]' - '-mskip-rax-setup[Skip setting up RAX register when passing variable arguments]' - '-msoft-float[Do not use hardware fp]' - '-msse2[Support MMX, SSE and SSE2 built-in functions and code generation]' - '-msse2avx[Encode SSE instructions with VEX prefix]' - '-msse3[Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation]' - '-msse4.1[Support MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1 built-in functions and code generation]' - '-msse4.2[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions and code generation]' - '-msse4[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions and code generation]' - '-msse4a[Support MMX, SSE, SSE2, SSE3 and SSE4A built-in functions and code generation]' - '-msse[Support MMX and SSE built-in functions and code generation]' - '-msseregparm[Use SSE register passing conventions for SF and DF mode]' - '-mssse3[Support MMX, SSE, SSE2, SSE3 and SSSE3 built-in functions and code generation]' - '-mstack-arg-probe[Enable stack probing]' - '-mstackrealign[Realign stack in prologue]' - '-mstv[Disable Scalar to Vector optimization pass transforming 64-bit integer computations into a vector ones]' - '-mtbm[Support TBM built-in functions and code generation]' - '-mtls-direct-seg-refs[Use direct references against %gs when accessing tls data]' - '-muclibc[Use uClibc C library]' - '-mvect8-ret-in-mem[Return 8-byte vectors in memory]' - '-mvzeroupper[Generate vzeroupper instruction before a transfer of control flow out of the function]' - '-mx32[Generate 32bit x86-64 code]' - '-mxop[Support XOP built-in functions and code generation]' - '-mxsave[Support XSAVE and XRSTOR instructions]' - '-mxsavec[Support XSAVEC instructions]' - '-mxsaveopt[Support XSAVEOPT instruction]' - '-mxsaves[Support XSAVES and XRSTORS instructions]' + '-m16[generate 16bit i386 code]' + '-m32[generate 32bit i386 code]' + '-m3dnowa[support Athlon 3Dnow! built-in functions]' + '-m3dnow[support 3DNow! built-in functions]' + '-m64[generate 64bit x86-64 code]' + '-m80387[use hardware fp]' + '-m8bit-idiv[expand 32bit/64bit integer divide into 8bit unsigned integer divide with run-time check]' + '-m96bit-long-double[sizeof(long double) is 12]' + '-mabi=-[generate code that conforms to the given ABI]:abi:(ms sysv)' + '-mabm[support code generation of Advanced Bit Manipulation (ABM) instructions]' + '-maccumulate-outgoing-args[reserve space for outgoing arguments in the function prologue]' + '-maddress-mode=-[use given address mode]:address mode:(short long)' + '-madx[support flag-preserving add-carry instructions]' + '-maes[support AES built-in functions and code generation]' + '-malign-data=-[use the given data alignment]:type:(compat abi cacheline)' + '-malign-double[align some doubles on dword boundary]' + '-malign-functions=-[function starts are aligned to this power of 2]: **2 base for function alignment: ' + '-malign-jumps=-[jump targets are aligned to this power of 2]: **2 base for jump goal alignment: ' + '-malign-loops=-[loop code aligned to this power of 2]: **2 base for loop alignment: ' + '-malign-stringops[align destination of the string operations]' + '-mamx-bf16[amx bf16]' + '-mamx-int8[amx int8]' + '-mamx-tile[amx tile]' + '-mandroid[generate code for the Android platform]' + '-march=-[generate instructions for CPU type]:CPU type:->archgeneric' + '-masm=-[use given assembler dialect]:asm dialect:(att intel)' + '-mavx256-split-unaligned-load[split 32-byte AVX unaligned load]' + '-mavx256-split-unaligned-store[split 32-byte AVX unaligned store]' + '-mavx2[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX and AVX2 built-in functions and code generation]' + '-mavx5124fmaps[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512F and AVX5124FMAPS built- in functions and code generation]' + '-mavx5124vnniw[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512F and AVX5124VNNIW built- in functions and code generation]' + '-mavx512bf16[avx512bf16]' + '-mavx512bitalg[avx512bitalg]' + '-mavx512bw[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512BW built- in functions and code generation]' + '-mavx512cd[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512CD built- in functions and code generation]' + '-mavx512dq[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512DQ built- in functions and code generation]' + '-mavx512er[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512ER built- in functions and code generation]' + '-mavx512f[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F built-in functions and code generation]' + '-mavx512ifma[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512IFMA built-in functions and code generation]' + '-mavx512pf[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512PF built- in functions and code generation]' + '-mavx512vbmi2[avx512vbmi2]' + '-mavx512vbmi[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512VBMI built-in functions and code generation]' + '-mavx512vl[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512VL built- in functions and code generation]' + '-mavx512vnni[avx512vnni]' + '-mavx512vp2intersect[avx512vp2intersect]' + '-mavx512vpopcntdq[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512F and AVX512VPOPCNTDQ built-in functions and code generation]' + '-mavx[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2 and AVX built-in functions and code generation]' + '-mavxvnni[avxvnni]' + '-mbionic[use Bionic C library]' + '-mbmi2[support BMI2 built-in functions and code generation]' + '-mbmi[support BMI built-in functions and code generation]' + '-mbranch-cost=-[branches are this expensive (1-5, arbitrary units)]:branch cost (1-5): ' + '-mcldemote[cldemote]' + '-mcld[generate cld instruction in the function prologue]' + '-mclflushopt[support CLFLUSHOPT instructions]' + '-mclwb[support CLWB instruction]' + '-mclzero[support CLZERO built-in functions and code generation]' + '-mcmodel=-[use given x86-64 code model]:memory model:(32 small kernel medium large)' + '-mcpu=-[set CPU type]:CPU type:->arch' + '-mcrc32[support code generation of crc32 instruction]' + '-mcx16[support code generation of cmpxchg16b instruction]' + '-mdispatch-scheduler[do dispatch scheduling if processor is bdver1, bdver2, bdver3, bdver4 or znver1 and Haifa scheduling is selected]' + '-menqcmd[enqcmd]' + '-mf16c[support F16C built-in functions and code generation]' + '-mfancy-math-387[generate sin, cos, sqrt for FPU]' + '-mfentry[emit profiling counter call at function entry before prologue]' + '-mfma4[support FMA4 built-in functions and code generation]' + '-mfma[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX and FMA built-in functions and code generation]' + '-mforce-drap[always use Dynamic Realigned Argument Pointer (DRAP) to realign stack]' + '-mfpmath=-[generate floating point mathematics using given instruction set]:FPU type:(387 sse sse,387 both)' + '-mfp-ret-in-387[return values of functions in FPU registers]' + '-mfsgsbase[support FSGSBASE built-in functions and code generation]' + '-mfunction-return=-[convert function return to call and return thunk]:choice:(keep thunk thunk-inline thunk-extern)' + '-mfxsr[support FXSAVE and FXRSTOR instructions]' + '-mgeneral-regs-only[generate code which uses only the general registers]' + '-mgfni[gfni]' + '-mglibc[use GNU C library]' + '-mhard-float[use hardware fp]' + '-mhle[support Hardware Lock Elision prefixes]' + '-mhreset[hreset]' + '-miamcu[generate code that conforms to Intel MCU psABI]' + '-mieee-fp[use IEEE math for fp comparisons]' + '-mincoming-stack-boundary=-[assume incoming stack aligned to this power of 2]:assumed size of boundary: ' + '-mindirect-branch=-[convert indirect call and jump to call and return thunks]:choice:(keep thunk thunk-inline thunk-extern)' + '-mindirect-branch-register[force indirect call and jump via register]' + '-minline-all-stringops[inline all known string operations]' + '-minline-stringops-dynamically[inline memset/memcpy string operations, but perform inline version only for small blocks]' + '-minvpcid[invpcid]' + '-mkl[kl]' + '-mlarge-data-threshold=-[data greater than given threshold will go into .ldata section in x86-64 medium model]:threshold: ' + '-mlong-double-128[use 128-bit long double]' + '-mlong-double-64[use 64-bit long double]' + '-mlong-double-80[use 80-bit long double]' + '-mlwp[support LWP built-in functions and code generation]' + '-mlzcnt[support LZCNT built-in function and code generation]' + {'-mmemset-strategy=-','-mmemcpy-strategy=-'}'[specify memcpy expansion strategy when expected size is known]:strategy:' + '-mmitigate-rop[attempt to avoid generating instruction sequences containing ret bytes]' + '-mmmx[support MMX built-in functions]' + '-mmovbe[support code generation of movbe instruction]' + '-mmovdir64b[movdir64b]' + '-mmovdiri[movdiri]' + '-mmpx[support MPX code generation]' + '-mms-bitfields[use native (MS) bitfield layout]' + '-mmusl[use musl C library]' + '-mmwaitx[support MWAITX and MONITORX built-in functions and code generation]' + '-mno-default[clear all tune features]' + '-mnop-mcount[generate mcount/__fentry__ calls as nops. To activate they need to be patched in]' + '-mno-sse4[do not support SSE4.1 and SSE4.2 built-in functions and code generation]' + '-momit-leaf-frame-pointer[omit the frame pointer in leaf functions]' + '-mpc32[set 80387 floating-point precision to 32-bit]' + '-mpc64[set 80387 floating-point precision to 64-bit]' + '-mpc80[set 80387 floating-point precision to 80-bit]' + '-mpclmul[support PCLMUL built-in functions and code generation]' + '-mpconfig[pconfig]' + '-mpku[support PKU built-in functions and code generation]' + '-mpopcnt[support code generation of popcnt instruction]' + '-mprefer-avx128[use 128-bit AVX instructions instead of 256-bit AVX instructions in the auto-vectorizer]' + '-mpreferred-stack-boundary=-[attempt to keep stack aligned to this power of 2]:size of boundary: ' + '-mprefetchwt1[support PREFETCHWT1 built-in functions and code generation]' + '-mprfchw[support PREFETCHW instruction]' + '-mptwrite[ptwrite]' + '-mpush-args[use push instructions to save outgoing arguments]' + '-mrdpid[support RDPID built-in functions and code generation]' + '-mrdrnd[support RDRND built-in functions and code generation]' + '-mrdseed[support RDSEED instruction]' + '-mrecip=-[control generation of reciprocal estimates]::instruction:(all none div divf divd rsqrt rsqrtf rsqrtd)' # TODO comma separated and can have ! + '-mrecip[generate reciprocals instead of divss and sqrtss]' + '-mrecord-mcount[generate __mcount_loc section with all mcount or __fentry__ calls]' + '-mred-zone[use red-zone in the x86-64 code]' + '-mreg-alloc=[control the default allocation order of integer registers]:default register allocation order:' + '-mregparm=-[number of registers used to pass integer arguments]:number of integer argument registers: ' + '-mretpoline-external-thunk[retpoline external thunk]' + '-mrtd[alternate calling convention]' + '-mrtm[support RTM built-in functions and code generation]' + '-msahf[support code generation of sahf instruction in 64bit x86-64 code]' + '-mserialize[serialize]' + '-msgx[support SGX built-in functions and code generation]' + '-msha[support SHA1 and SHA256 built-in functions and code generation]' + '-mshstk[shstk]' + '-mskip-rax-setup[skip setting up RAX register when passing variable arguments]' + '-msoft-float[do not use hardware fp]' + '-msse2avx[encode SSE instructions with VEX prefix]' + '-msse2[support MMX, SSE and SSE2 built-in functions and code generation]' + '-msse3[support MMX, SSE, SSE2 and SSE3 built-in functions and code generation]' + '-msse4.1[support MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1 built-in functions and code generation]' + '-msse4.2[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions and code generation]' + '-msse4a[support MMX, SSE, SSE2, SSE3 and SSE4A built-in functions and code generation]' + '-msse4[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions and code generation]' + '-msseregparm[use SSE register passing conventions for SF and DF mode]' + '-msse[support MMX and SSE built-in functions and code generation]' + '-mssse3[support MMX, SSE, SSE2, SSE3 and SSSE3 built-in functions and code generation]' + '-mstack-arg-probe[enable stack probing]' + '-mstack-protector-guard=-[use given stack-protector guard]:guard:(global tls)' + '-mstackrealign[realign stack in prologue]' + '-mstringop-strategy=-[chose strategy to generate stringop using]:stringop strategy:(byte_loop libcall loop rep_4byte rep_8byte rep_byte unrolled_loop)' + '-mstv[disable Scalar to Vector optimization pass transforming 64-bit integer computations into a vector ones]' + '-mtbm[support TBM built-in functions and code generation]' + '-mthreads[support thread-safe exception handling on MinGW]' + '-mtls-dialect=-[use given thread-local storage dialect]:TLS dialect:(gnu gnu2)' + '-mtls-direct-seg-refs[use direct references against %gs when accessing tls data]' + '-mtsxldtrk[tsxldtrk]' + #'-mtune-ctrl=-[fine grain control of tune features]:feature-list:' #for dev use only + '-mtune=-[tune code for CPU type]:CPU type:->arch' + '-muclibc[use uClibc C library]' + '-muintr[uintr]' + '-mvaes[vaes]' + '-mveclibabi=-[vector library ABI to use]:vector library ABI:(acml svml)' + '-mvect8-ret-in-mem[return 8-byte vectors in memory]' + '-mvpclmulqdq[vpclmulqdq]' + '-mvzeroupper[generate vzeroupper instruction before a transfer of control flow out of the function]' + '-mwaitpkg[waitpkg]' + '-mwbnoinvd[wbnoinvd]' + '-mwidekl[widekl]' + '-mx32[generate 32bit x86-64 code]' + '-mx87[x87]' + '-mxop[support XOP built-in functions and code generation]' + '-mxsavec[support XSAVEC instructions]' + '-mxsaveopt[support XSAVEOPT instruction]' + '-mxsaves[support XSAVES and XRSTORS instructions]' + '-mxsave[support XSAVE and XRSTOR instructions]' ) ;; hppa*) @@ -298,6 +390,10 @@ i960) ) ;; sparc) + arch=( + v7 cypress v8 supersparc sparclite f930 f934 hypersparc sparclite86x sparclet + tsc701 v9 ultrasparc ultrasparc3 + ) args=( -mapp-regs -mno-app-regs -mfpu -mhard-float @@ -308,8 +404,8 @@ sparc) -munaligned-doubles -mfaster-structs -mno-faster-structs -mimpure-text - '-mcpu=:CPU type:(v7 cypress v8 supersparc sparclite f930 f934 hypersparc sparclite86x sparclet tsc701 v9 ultrasparc ultrasparc3)' - '-mtune=:CPU type:(cypress supersparc hypersparc f930 f934 sparclite86x tsc701 ultrasparc ultrasparc3)' + '-mcpu=:CPU type:->arch' + '-mtune=:CPU type:->arch' -mv8plus -mno-v8plus -mvis -mno-vis -mlittle-endian @@ -341,863 +437,1798 @@ h8/300) -mrelax -mh ) ;; +aarch64) + args=( + '-mmark-bti-property[add .note.gnu.property with BTI to assembly files]' + '-moutline[enable function outlining (AArch64 only)]' + '-msve-vector-bits=[specify the size in bits of an SVE vector register]:bits' + ) + ;; +amdgpu) + args=( + '-mcumode[specify CU wavefront execution mode]' + '-mtgsplit[enable threadgroup split execution mode (AMDGPU only)]' + ) + ;; +hexagon) + args=( + '-mieee-rnd-near[ieee rnd near]' + '-mmemops[enable generation of memop instructions]' + '-mnvj[enable generation of new-value jumps]' + '-mnvs[enable generation of new-value stores]' + '-mpackets[enable generation of instruction packets]' + '-mhvx[enable Hexagon Vector eXtensions]' + '-mhvx-length=[set Hexagon Vector Length]:arg' + '-mhvx=[enable Hexagon Vector eXtensions]:arg' + ) + ;; +webassembly*) + args=( + '-matomics[atomics]' + '-mbulk-memory[bulk memory]' + '-mexception-handling[exception handling]' + '-mmultivalue[multivalue]' + '-mmutable-globals[mutable globals]' + '-mnontrapping-fptoint[no ntrapping fptoint]' + '-mreference-types[reference types]' + '-msign-ext[sign ext]' + '-msimd128[simd128]' + '-mtail-call[tail call]' + '-munimplemented-simd128[unimplemented simd128]' + '-mexec-model=[execution model]:arg' + ) + ;; +riscv) + args=( + '-msave-restore[enable using library calls for save and restore]' + ) + ;; esac if [[ "$service" = clang* ]]; then - args+=( - "-flto=-[generate output files suitable for link time optimization]::style:(full thin)" - -emit-llvm - "-Qunused-arguments[don't emit warning for unused driver arguments]" - --analyze - -fshow-column -fshow-source-location -fcaret-diagnostics -fdiagnostics-fixit-info - -fdiagnostics-parseable-fixits -fdiagnostics-print-source-range-info - -fprint-source-range-info -fdiagnostics-show-option -fmessage-length - "-nostdinc[Do not search standard system directories or compiler builtin directories for include files]" - "-nostdlibinc[Do not search standard system directories for include files]" - "-nobuiltininc[Do not search builtin directory for include files]" - "--help[Display this information]" - ) + args+=( + '-all_load[undocumented option]' + '-allowable_client[undocumented option]:argument' + '--analyzer-no-default-checks[analyzer does no default checks]' + '--analyzer-output[static analyzer report output format]:format:(html plist plist-multi-file plist-html sarif sarif-html text)' + '--analyze[run the static analyzer]' + '-arch[arch]:argument' + '-arch_errors_fatal[arch errors fatal]' + '-arch_only[arch only]:argument' + '-arcmt-migrate-emit-errors[emit ARC errors even if the migrator can fix them]' + '-arcmt-migrate-report-output[output path for the plist report]:file:_files' + '-a-[undocumented option]:argument' + '--autocomplete=[autocomplete]:argument' + '-bind_at_load[bind at load]' + '--bootclasspath=[bootclasspath]:arg' + '-bundle[bundle]' + '-bundle_loader[bundle loader]:argument' + '--CLASSPATH=[CLASSPATH]:arg' + '--classpath=[classpath]:arg' + '-cl-denorms-are-zero[allow denormals to be flushed to zero]' + '-cl-fast-relaxed-math[cl fast relaxed math]' + '-cl-finite-math-only[allow floating-point optimizations]' + '-cl-fp32-correctly-rounded-divide-sqrt[specify that divide and sqrt are correctly rounded]' + '-client_name[client name]:argument' + '-cl-kernel-arg-info[generate kernel argument metadata]' + '-cl-mad-enable[allow use of less precise MAD computations]' + '-cl-no-signed-zeros[allow use of no signed zeros computations]' + '-cl-no-stdinc[disables all standard includes]' + '-cl-opt-disable[disables all optimizations]' + '-cl-single-precision-constant[treat double float constant as single precision]' + '-cl-std=[openCL language standard to compile for]:arg' + '-cl-strict-aliasing[this option is added for compatibility with OpenCL 1.0]' + '-cl-uniform-work-group-size[defines that the global work-size be uniform]' + '-cl-unsafe-math-optimizations[allow unsafe floating-point optimizations]' + '-compatibility_version[compatibility version]:compatibility version' + '--config[specifies configuration file]:configuration file:_files' + '--constant-cfstrings[use constant cfstrings]' + '--coverage[coverage]' + '-coverage[coverage]' + '-cpp[cpp]' + '--cuda-compile-host-device[compile CUDA code for both host and device]' + '--cuda-device-only[compile CUDA code for device only]' + '--cuda-gpu-arch=[cUDA offloading device architecture]:arg' + '--cuda-host-only[compile CUDA code for host only]' + '*--cuda-include-ptx=[include ptx for the following gpu architecture]:argument' + '--cuda-noopt-device-debug[enable device-side debug info generation]' + '--cuda-path=[cUDA installation path]:arg' + '--cuda-path-ignore-env[ignore environment variables to detect CUDA installation]' + '-cuid=[an id for compilation unit]:argument' + '-current_version[current version]:current version' + '-cxx-isystem[add directory to the C++ SYSTEM include search path]:directory:_files -/' + '-dead_strip[dead strip]' + '-dependency-dot[file to write dot-formatted header dependencies to]:file:_files' + '-dependency-file[file to write dependency output to]:file:_files' + '--dyld-prefix=[dyld prefix]:prefix' + '--dylib_file[dyld file]:file:_files' + '-dylinker[dylinker]' + '-dylinker_install_name[dylinker install name]:name' + '-dynamic[dynamic]' + '-dynamiclib[dynamic lib]' + '-EB[big endian]' + '-EL[little endian]' + '-emit-ast[emit Clang AST files for source inputs]' + '-emit-interface-stubs[generate Interface Stub Files]' + '-emit-llvm[use the LLVM representation for assembler and object files]' + '-emit-merged-ifs[generate Interface Stub Files, emit merged text not binary]' + '--emit-static-lib[enable linker job to emit a static library]' + #'-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang[trivial automatic variable initialization to zero is only here for benchmarks]' + '--encoding=[encoding]:arg' + '-exported_symbols_list[exported symbols list]:argument' + '--extdirs=[extdirs]:arg' + '--extra-warnings[enable extra warnings]' + '-faccess-control[access control]' + '*-F+[add directory to framework search path]:framework directory:_files -/' + '-faddrsig[emit an address-significance table]' + '-faggressive-function-elimination[aggressive function elimination]' + '-falign-commons[align commons]' + '-faligned-allocation[aligned allocation]' + '-faligned-new[enable C++17 aligned allocation functions]' + '-fall-intrinsics[all intrinsics]' + '-fallow-editor-placeholders[treat editor placeholders as valid source code]' + '-fallow-unsupported[allow unsupported]' + '-falternative-parameter-statement[enable the old style PARAMETER statement]' + '-faltivec[altivec]' + '-fansi-escape-codes[use ANSI escape codes for diagnostics]' + "-fapple-kext[use Apple's kernel extensions ABI]" + '-fapple-link-rtlib[force linking the clang builtins runtime library]' + '-fapple-pragma-pack[enable Apple GCC-compatible #pragma pack handling]' + '-fapplication-extension[restrict code to those available for App Extensions]' + '-fasm-blocks[asm blocks]' + '-fassume-sane-operator-new[assume sane operator new]' + '-fast[ast]' + '-fastcp[astcp]' + '-fastf[astf]' + '-fautolink[autolink]' + '-fautomatic[automatic]' + '-fauto-profile-accurate[auto profile accurate]' + '-fauto-profile=[enable sample-based profile guided optimizations]::arg' + '-fbackslash[change the interpretation of backslashes in string literals]' + '-fbacktrace[backtrace]' + '-fbasic-block-sections=[generate labels for each basic block]:arg' + '-fbinutils-version=[produced object files can use all ELF features supported by this version]:major.minor' + '-fblas-matmul-limit=[blas matmul limit]:arg' + '-fblocks[enable the blocks language feature]' + '-fbootclasspath=[bootclasspath]:arg' + '-fborland-extensions[accept non-standard constructs supported by the Borland compiler]' + '-fbracket-depth=[bracket depth]:arg' + '-fbuild-session-file=[use the last modification time of <file> as the build session timestamp]:file:_files' + '-fbuild-session-timestamp=[time when the current build session started]:time since Epoch in seconds' + '-fbuiltin-module-map[load the clang builtins module map file]' + '-fcaret-diagnostics[show diagnostic messages using a caret]' + '-fcf-protection=[instrument control-flow architecture protection]::arg (options\: return, branch, full, none)' + '-fcf-runtime-abi=[cf runtime abi]:arg' + '-fchar8_t[enable C++ builtin type char8_t]' + '-fcheck-array-temporaries[check array temporaries]' + '-fcheck=[check]:arg' + '-fclang-abi-compat=[attempt to match the ABI of Clang <version>]:version' + '-fclasspath=[classpath]:arg' + '-fcoarray=[coarray]:arg' + '-fcolor-diagnostics[enable colors in diagnostics]' + '-fcomment-block-commands=[treat each comma separated argument in <arg> as a documentation comment block command]:arg' + '-fcompile-resource=[compile resource]:arg' + '-fcomplete-member-pointers[require member pointer base types to be complete if they would be significant under the Microsoft ABI]' + '-fconstant-cfstrings[constant cfstrings]' + '-fconstant-string-class=[constant string class]:arg' + '-fconstexpr-backtrace-limit=[constexpr backtrace limit]:arg' + '-fconstexpr-depth=[constexpr depth]:arg' + '-fconstexpr-steps=[constexpr steps]:arg' + '-fconvergent-functions[assume functions may be convergent]' + '-fconvert=[convert]:arg' + '-fcoroutines-ts[enable support for the C++ Coroutines TS]' + '-fcoverage-compilation-dir=[the compilation directory to embed in the coverage mapping]:arg' + '-fcoverage-mapping[generate coverage mapping to enable code coverage analysis]' + '-fcoverage-prefix-map=[remap file source paths in coverage mapping]:arg' + '-fcrash-diagnostics-dir=[crash diagnostics dir]:arg' + '-fcray-pointer[cray pointer]' + '-fcreate-profile[create profile]' + '-fcs-profile-generate[generate instrumented code to collect context sensitive execution counts]' + '-fcs-profile-generate=[generate instrumented code to collect context sensitive execution counts]:directory:_files -/' + '-fc\+\+-static-destructors[c++ static destructors]' + '-fcuda-approx-transcendentals[use approximate transcendental functions]' + '-fcuda-flush-denormals-to-zero[flush denormal floating point values to zero in CUDA device mode]' + '-fcuda-rdc[cuda rdc]' + '-fcuda-short-ptr[use 32-bit pointers for accessing const/local/shared address spaces]' + '-fcxx-exceptions[enable C++ exceptions]' + '-fcxx-modules[cxx modules]' + '-fdebug-compilation-dir=[the compilation directory to embed in the debug info]:arg' + '-fdebug-default-version=[default DWARF version to use]:arg' + '-fdebug-dump-parse-tree[dump the parse tree]' + '-fdebug-dump-provenance[dump provenance]' + '-fdebug-dump-symbols[dump symbols after the semantic analysis]' + '-fdebug-info-for-profiling[emit extra debug info to make sample profile more accurate]' + '-fdebug-macro[emit macro debug information]' + '-fdebug-measure-parse-tree[measure the parse tree]' + '-fdebug-pass-arguments[debug pass arguments]' + '-fdebug-pass-structure[debug pass structure]' + '-fdebug-pre-fir-tree[dump the pre-FIR tree]' + '-fdebug-ranges-base-address[use DWARF base address selection entries in .debug_ranges]' + '-fdebug-unparse[unparse and stop]' + '-fdebug-unparse-with-symbols[unparse and stop]' + '-fdeclspec[allow __declspec as a keyword]' + '-fdefault-double-8[set the default double precision kind to an 8 byte wide type]' + '-fdefault-integer-8[set the default integer kind to an 8 byte wide type]' + '-fdefault-real-8[set the default real kind to an 8 byte wide type]' + '-fdelayed-template-parsing[parse templated function definitions at the end of the translation unit]' + '-fdenormal-fp-math=[denormal fp math]:arg' + '-fdepfile-entry=[depfile entry]:arg' + '-fdiagnostics-absolute-paths[print absolute paths in diagnostics]' + '-fdiagnostics-fixit-info[supply fixit into with diagnostic messages]' + '-fdiagnostics-format=[diagnostics format]:arg' + '-fdiagnostics-hotness-threshold=[prevent optimization remarks from being output if they do not meet threshold]:value' + '-fdiagnostics-parseable-fixits[print fixits in a machine parseable form]' + '-fdiagnostics-print-source-range-info[print source range spans in numeric form]' + '-fdiagnostics-show-category=[diagnostics show category]:arg' + '-fdiagnostics-show-hotness[enable profile hotness information in diagnostic line]' + '-fdiagnostics-show-note-include-stack[display include stacks for diagnostic notes]' + '-fdiagnostics-show-option[enable -Woption information in diagnostic line]' + '-fdiagnostics-show-template-tree[print a template comparison tree for differing templates]' + '-fdigraphs[enable alternative token representations]' + "-fdirect-access-external-data[don't use GOT indirection to reference external data symbols]" + '-fdiscard-value-names[discard value names in LLVM IR]' + '-fd-lines-as-code[d lines as code]' + '-fd-lines-as-comments[d lines as comments]' + '-fdollar-ok[dollar ok]' + '-fdouble-square-bracket-attributes[enable double square bracket attributes]' + '-fdump-fortran-optimized[dump fortran optimized]' + '-fdump-fortran-original[dump fortran original]' + '-fdump-parse-tree[dump parse tree]' + '-fdwarf-directory-asm[DWARF directory asm]' + '-fdwarf-exceptions[use DWARF style exceptions]' + '-felide-constructors[elide constructors]' + '-felide-type[elide types when printing diagnostics]' + '-fembed-bitcode=[embed LLVM bitcode (option: off, all, bitcode, marker)]:option' + '-fembed-bitcode[equivalent to -fembed-bitcode=all]' + '-fembed-bitcode-marker[equivalent to -fembed-bitcode=marker]' + '-femit-all-decls[emit all declarations]' + '-femulated-tls[use emutls functions to access thread_local variables]' + '-fenable-matrix[enable matrix data type and related builtin functions]' + '-fencoding=[encoding]:arg' + '-ferror-limit=[error limit]:arg' + '-fescaping-block-tail-calls[escaping block tail calls]' + '-fexperimental-isel[experimental isel]' + '-fexperimental-new-constant-interpreter[enable the experimental new constant interpreter]' + '-fexperimental-relative-c\+\+-abi-vtables[use the experimental C++ class ABI for classes with vtables]' + '-fexperimental-strict-floating-point[enables experimental strict floating point in LLVM]' + '-fextdirs=[extdirs]:arg' + '-fexternal-blas[external blas]' + '-ff2c[f2c]' + '-ffile-compilation-dir=[the compilation directory to embed in the debug info]:arg' + '-ffile-prefix-map=[remap file source paths in debug info and predefined preprocessor macros]:arg' + '-ffine-grained-bitfield-accesses[use separate accesses for consecutive bitfield runs with legal widths and alignments]' + '-ffinite-loops[assume all loops are finite]' + '-ffixed-form[process source files in fixed form]' + '-ffixed-line-length=[set column after which characters are ignored]:arg' + '-ffixed-point[enable fixed point types]' + '-fforce-dwarf-frame[always emit a debug frame section]' + '-fforce-emit-vtables[emits more virtual tables to improve devirtualization]' + '-fforce-enable-int128[enable support for int128_t type]' + '-ffor-scope[for scope]' + '-ffpe-trap=[fpe trap]:arg' + '-ffp-exception-behavior=[specifies the exception behavior of floating-point operations]:arg' + '-ffp-model=[controls the semantics of floating-point calculations]:arg' + '-ffree-form[process source files in free form]' + '-ffree-line-length-[free line length]:arg' + '-ffrontend-optimize[frontend optimize]' + '-fglobal-isel[enables the global instruction selector]' + '-fgnuc-version=[sets various macros to claim compatibility with the given GCC version]:version' + '-fgnu-inline-asm[gnu inline asm]' + '-fgnu-keywords[allow GNU-extension keywords regardless of language standard]' + '-fgnu-runtime[generate output compatible with the standard GNU Objective-C runtime]' + '-fgpu-allow-device-init[allow device side init function in HIP]' + '-fgpu-defer-diag[defer host/device related diagnostic messages for CUDA/HIP]' + '-fgpu-rdc[generate relocatable device code, also known as separate compilation mode]' + '-fgpu-sanitize[enable sanitizer for AMDGPU target]' + '-fheinous-gnu-extensions[heinous GNU extensions]' + '-fhip-new-launch-api,[-fno-hip-new-launch-api Use new kernel launching API for HIP]' + '-fhonor-infinites[honor infinites]' + '-fhonor-infinities[honor infinities]' + '-fhonor-nans[honor nans]' + '-fignore-exceptions[enable support for ignoring exception handling constructs]' + '-filelist[ilelist]:arg' + '-fimplicit-module-maps[implicit module maps]' + '-fimplicit-modules[implicit modules]' + '-fimplicit-none[no implicit typing allowed unless overridden by IMPLICIT statements]' + '-findirect-virtual-calls[indirect virtual calls]' + '-finit-character=[init character]:arg' + '-finit-integer=[init integer]:arg' + '-finit-local-zero[init local zero]' + '-finit-logical=[init logical]:arg' + '-finit-real=[init real]:arg' + '-finline-hint-functions[inline functions which are (explicitly or implicitly) marked inline]' + '-finstrument-function-entry-bare[instrument function entry only]' + '-finstrument-functions-after-inlining[insert the calls after inlining]' + '-finteger-4-integer-8[integer 4 integer 8]' + '-fintegrated-as[enable the integrated assembler]' + '-fintegrated-cc1[run cc1 in-process]' + '-fintrinsic-modules-path[intrinsic modules path]' + '-flarge-sizes[use INTEGER(KIND=8) for the result type in size-related intrinsics]' + '-flat_namespace[flat namespace]' + '-flegacy-pass-manager[use the legacy pass manager in LLVM]' + '-flimited-precision=[limited precision]:arg' + '-flogical-abbreviations[enable logical abbreviations]' + '-flto=-[generate output files suitable for link time optimization]::style:(full thin)' + '-flto-jobs=[controls the backend parallelism]:arg' + '-fmacro-backtrace-limit=[macro backtrace limit]:limit' + '-fmacro-prefix-map=[remap file source paths in predefined preprocessor macros]:arg' + '-fmax-array-constructor=[max array constructor]:arg' + '-fmax-identifier-length[max identifier length]' + '-fmax-stack-var-size=[max stack var size]:arg' + '-fmax-subrecord-length=[max subrecord length]:arg' + '-fmax-tokens=[max total number of preprocessed tokens for -Wmax-tokens]:number' + '-fmax-type-align=[specify the maximum alignment to enforce on pointers lacking an explicit alignment]:arg' + '-fmemory-profile=[enable heap memory profiling and dump results into <directory>]::directory:_files -/' + '-fmodule-file-deps[module file deps]' + '-fmodule-file=[specify the mapping of module name to precompiled module file]:file:_files' + '-fmodule-implementation-of[module implementation of]:name' + '-fmodule-map-file=[load this module map file]:file:_files' + '-fmodule-maps[implicitly search the file system for module map files.]' + '-fmodule-name=[specify the name of the module to build]:name' + '-fmodule-private[module private]' + '-fmodules-cache-path=[specify the module cache path]:directory:_files -/' + '-fmodules-decluse[require declaration of modules used within a module]' + '-fmodules-disable-diagnostic-validation[disable validation of the diagnostic options when loading the module]' + '-fmodules[enable the modules language feature]' + '-fmodules-ignore-macro=[ignore the definition of the given macro when building and loading modules]:macro' + '-fmodules-prune-after=[specify the interval after which a module file will be considered unused]:seconds' + '-fmodules-prune-interval=[specify the interval between attempts to prune the module cache]:seconds' + '-fmodules-search-all[search even non-imported modules to resolve references]' + '-fmodules-strict-decluse[requires all headers to be in modules]' + '-fmodules-ts[enable support for the C++ Modules TS]' + '-fmodules-user-build-path[specify the module user build path]:directory:_files -/' + '-fmodules-validate-input-files-content[validate PCM input files based on content if mtime differs]' + "-fmodules-validate-once-per-build-session[don't verify input files for the modules]" + '-fmodules-validate-system-headers[validate the system headers that a module depends on when loading the module]' + '-fms-compatibility[enable full Microsoft Visual C++ compatibility]' + '-fms-compatibility-version=[microsoft compiler version number]:arg' + '-fmsc-version=[microsoft compiler version number to report]:arg' + '-fms-memptr-rep=[ms memptr rep]:arg' + '-fms-volatile[ms volatile]' + '-fnested-functions[nested functions]' + '-fnew-alignment=[specifies the largest alignment guaranteed]:align' + '-fnext-runtime[next runtime]' + '-fno-builtin-[disable implicit builtin knowledge of a specific function]:arg' + '-fno-crash-diagnostics[disable auto-generation of preprocessed source files and a script for reproduction during a clang crash]' + '-fno-limit-debug-info[no limit debug info]' + '-fno-max-type-align[no max type align]' + '-fno_modules-validate-input-files-content[no modules validate input files content]' + '-fno_pch-validate-input-files-content[no pch validate input files content]' + '-fno-strict-modules-decluse[no strict modules decluse]' + '-fno-temp-file[directly create compilation output files]' + '-fno-working-directory[no working directory]' + '-fnoxray-link-deps[no xray link deps]' + '-fobjc-abi-version=-[set Objective-C ABI version]:version' + '-fobjc-arc-exceptions[use EH-safe code when synthesizing retains and releases in -fobjc-arc]' + '-fobjc-arc[synthesize retain and release calls for Objective-C pointers]' + '-fobjc-convert-messages-to-runtime-calls[convert messages to runtime calls]' + '-fobjc-encode-cxx-class-template-spec[fully encode C++ class template specialization]' + '-fobjc-exceptions[enable Objective-C exceptions]' + '-fobjc-infer-related-result-type[infer related result type]' + '-fobjc-legacy-dispatch[use legacy dispatch]' + '-fobjc-link-runtime[set link runtime]' + '-fobjc-nonfragile-abi[set nonfragile abi]' + '-fobjc-nonfragile-abi-version=-[set nonfragile abi version]:version' + '-fobjc-runtime=-[specify the target Objective-C runtime kind and version]:runtime' + '-fobjc-sender-dependent-dispatch[set sender dependent dispatch]' + '-fobjc-weak[enable ARC-style weak references in Objective-C]' + '-fopenmp-targets=[specify comma-separated list of triples OpenMP offloading targets to be supported]:targets' + '-fopenmp-version=[openmp version]:version' + '-foperator-arrow-depth=[operator arrow depth]:arg' + '-foperator-names[treat C++ operator name keywords as synonyms for operators]' + '-foptimization-record-file=[specify the output name of the file containing the optimization remarks]:file:_files' + '-foptimization-record-passes=[only include passes which match a specified regex]:regex' + '-force_cpusubtype_ALL[force cpusubtype all]' + '-force_flat_namespace[force flat namespace]' + '--force-link=[force link]:arg' + '-force_load[force load]:argument' + '-forder-file-instrumentation[generate instrumented code to collect order file]' + '-foutput-class-dir=[output class dir]:arg' + '-fpack-derived[pack derived]' + '-fparse-all-comments[parse all comments]' + '-fpascal-strings[recognize and construct Pascal-style string literals]' + '-fpass-plugin=[load pass plugin from a dynamic shared object file]:dsopath' + '-fpatchable-function-entry=[generate NOPs around function entry]:N,M' + '-fpch-codegen[generate code for uses of this PCH]' + '-fpch-debuginfo[generate debug info for types in an object file built from this PCH]' + '-fpch-instantiate-templates[instantiate templates already while building a PCH]' + '-fpch-validate-input-files-content[validate PCH input files based on content]' + '-fprebuilt-implicit-modules[look up implicit modules]' + '-fprebuilt-module-path=[specify the prebuilt module path]:directory:_files -/' + '-fpreserve-as-comments[preserve as comments]' + '-fproc-stat-report=[save subprocess statistics to the given file]:arg' + '-fprofile-exclude-files=[exclude files from profile]:arg' + '-fprofile-filter-files=[filter files for profile]:arg' + '-fprofile-instr-generate=[generate instrumented profile into file]::file:_files' + '-fprofile-instr-use=[use instrumentation data for profile-guided optimization]::arg' + '-fprofile-list=[filename defining the list of items to instrument]:file:_files' + '-fprofile-remapping-file=[use the remappings described in file in profile]:file:_files' + '-fprofile-sample-accurate[specifies that the sample profile is accurate]' + '-fprofile-sample-use=[profile sample use]::arg' + '-fprofile-update=[set update method of profile counters]:method' + '-fprotect-parens[protect parens]' + '-fpseudo-probe-for-profiling[emit pseudo probes for sample profiling]' + '*-framework[include framework found in search path]:framework:->framework' + '-frange-check[range check]' + '-freal-4-real-10[real 4 real 10]' + '-freal-4-real-16[real 4 real 16]' + '-freal-4-real-8[real 4 real 8]' + '-freal-8-real-10[real 8 real 10]' + '-freal-8-real-16[real 8 real 16]' + '-freal-8-real-4[real 8 real 4]' + '-frealloc-lhs[realloc lhs]' + '-frecord-command-line[record command line]' + '-frecord-marker=[record marker]:arg' + '-frecursive[recursive]' + '-fregister-global-dtors-with-atexit[use atexit to register global destructors]' + '-frelaxed-template-template-args[enable C++17 relaxed template template argument matching]' + '-frepack-arrays[repack arrays]' + '-freroll-loops[turn on loop reroller]' + '-fretain-comments-from-system-headers[retain comments from system headers]' + '-frewrite-imports[rewrite imports]' + '-frewrite-includes[rewrite includes]' + '-frewrite-map-file=[rewrite map file]:arg' + '-fropi[generate read-only position independent code (ARM only)]' + '-frtlib-add-rpath[add -rpath with architecture-specific resource directory to the linker flags]' + '-frtti-data[rtti data]' + '-frwpi[generate read-write position independent code (ARM only)]' + '-fsanitize-address-destructor-kind=[set destructor type used in ASan instrumentation]:kind' + '-fsanitize-address-field-padding=[level of field padding for AddressSanitizer]:arg' + '-fsanitize-address-globals-dead-stripping[enable linker dead stripping of globals in AddressSanitizer]' + '-fsanitize-address-poison-custom-array-cookie[enable poisoning array cookies when using custom operator new in AddressSanitizer]' + '-fsanitize-address-use-after-scope[enable use-after-scope detection in AddressSanitizer]' + '-fsanitize-address-use-odr-indicator[enable ODR indicator globals]' + '-fsanitize-blacklist=[path to blacklist file for sanitizers]:arg' + '-fsanitize-cfi-canonical-jump-tables[make the jump table addresses canonical in the symbol table]' + '-fsanitize-cfi-cross-dso[enable control flow integrity (CFI) checks for cross-DSO calls]' + '-fsanitize-cfi-icall-generalize-pointers[generalize pointers in CFI indirect call type signature checks]' + '-fsanitize-coverage-allowlist=[sanitize coverage allowlist]:arg' + '-fsanitize-coverage-blacklist=[disable sanitizer coverage instrumentation]:arg' + '-fsanitize-coverage-blocklist=[sanitize coverage blocklist]:arg' + '-fsanitize-coverage=[specify the type of coverage instrumentation for Sanitizers]:arg' + '-fsanitize-coverage-whitelist=[restrict sanitizer coverage instrumentation]:arg' + '-fsanitize-hwaddress-abi=[select the HWAddressSanitizer ABI to target]:arg' + '-fsanitize-link-c\+\+-runtime[sanitize link c++ runtime]' + '-fsanitize-link-runtime[sanitize link runtime]' + '-fsanitize-memory-track-origins=[enable origins tracking in MemorySanitizer]::arg' + '-fsanitize-memory-use-after-dtor[enable use-after-destroy detection in MemorySanitizer]' + '-fsanitize-minimal-runtime[sanitize minimal runtime]' + '-fsanitize-recover=[enable recovery for specified sanitizers]::arg' + '-fsanitize-stats[enable sanitizer statistics gathering]' + '-fsanitize-system-blacklist[path to system blacklist file for sanitizers]:file:_files' + '-fsanitize-thread-atomics[enable atomic operations instrumentation in ThreadSanitizer (default)]' + '-fsanitize-thread-func-entry-exit[enable function entry/exit instrumentation in ThreadSanitizer]' + '-fsanitize-thread-memory-access[enable memory access instrumentation in ThreadSanitizer]' + '-fsanitize-trap=[enable trapping for specified sanitizers]::arg' + '-fsanitize-undefined-strip-path-components=[strip a given number of path components when emitting check metadata]:number' + '-fsanitize-undefined-trap-on-error[equivalent to -fsanitize-trap=undefined]' + '-fsave-optimization-record=[generate an optimization record file in a specific format]::format' + '-fsecond-underscore[second underscore]' + '-fseh-exceptions[use SEH style exceptions]' + '-fsemantic-interposition[semantic interposition]' + '-fshow-column[show the column]' + '-fshow-overloads=[which overload candidates to show when overload resolution fails]:arg' + '-fshow-source-location[show source location]' + '-fsignaling-math[signaling math]' + '-fsign-zero[sign zero]' + '-fsized-deallocation[enable C++14 sized global deallocation functions]' + '-fsjlj-exceptions[use SjLj style exceptions]' + '-fslp-vectorize[enable the superword-level parallelism vectorization passes]' + '-fspell-checking-limit=[spell checking limit]:arg' + '-fspell-checking[spell checking]' + '-fsplit-dwarf-inlining[provide minimal debug info in the object]' + '-fsplit-lto-unit[enables splitting of the LTO unit]' + '-fsplit-machine-functions[enable late function splitting using profile information]' + '-fstack-arrays[stack arrays]' + '-fstack-clash-protection[enable stack clash protection]' + '-fstack-size-section[emit section containing metadata on function stack sizes]' + '-fstandalone-debug[emit full debug info for all types used by the program]' + '-fstrict-float-cast-overflow[assume that overflowing float-to-int casts are undefined]' + '-fstrict-return[strict return]' + '-fstrict-vtable-pointers[enable optimizations based on the strict vtables]' + '-fstruct-path-tbaa[struct path tbaa]' + '-fsycl[enable SYCL kernels compilation for device]' + '-fsymbol-partition=[symbol partition]:arg' + '-fsystem-module[build this module as a system module. only used with -emit-module]' + '-ftemplate-backtrace-limit=[template backtrace limit]:arg' + '-ftemplate-depth--[template depth]:arg' + '-ftemplate-depth=[template depth]:arg' + '-fterminated-vtables[terminated vtables]' + '-fthin-link-bitcode=[write minimized bitcode to <file>]:file:_files' + '-fthinlto-index=[perform ThinLTO importing using provided index]:arg' + '-fthreadsafe-statics[threadsafe statics]' + '-ftime-trace-granularity=[minimum time granularity traced by time profiler]:microseconds' + '-ftime-trace[turn on time profiler]' + '-ftrap-function=[issue call to specified function rather than a trap instruction]:function name' + '-ftrapv-handler=[specify the function to be called on overflow]:function name' + '-ftrigraphs[process trigraph sequences]' + '-ftrivial-auto-var-init=[initialize trivial automatic stack variables]:arg' + '-ftrivial-auto-var-init-stop-after=[stop initializing trivial automatic stack variables after the specified number of instances]:arg' + '-funderscoring[underscoring]' + '-funique-basic-block-section-names[use unique names for basic block sections]' + '-funique-internal-linkage-names[uniqueify Internal Linkage Symbol Names]' + '-funique-section-names[unique section names]' + '-funit-at-a-time[unit at a time]' + '-fuse-cuid=[method to generate ids for compilation units for single source offloading languages CUDA and HIP]:argument' + '-fuse-cxa-atexit[use cxa atexit]' + '-fuse-init-array[use init array]' + '-fuse-line-directives[use #line in preprocessed output]' + '-fvalidate-ast-input-files-content[compute and store the hash of input files used to build an AST]' + '-fveclib=[use the given vector functions library]:arg' + '-fvectorize[enable the loop vectorization passes]' + '-fvirtual-function-elimination[enables dead virtual function elimination optimization]' + '-fvisibility-dllexport=[the visibility for dllexport defintions]:arg' + '-fvisibility-externs-dllimport=[the visibility for dllimport external declarations]:arg' + '-fvisibility-externs-nodllstorageclass=[the visibility for external declarations without an explicit DLL dllstorageclass]:arg' + '-fvisibility-from-dllstorageclass[set the visiblity of symbols in the generated code from their DLL storage class]' + '-fvisibility-global-new-delete-hidden[give global C++ operator new and delete declarations hidden visibility]' + '-fvisibility-inlines-hidden[give inline C++ member functions hidden visibility by default]' + '-fvisibility-inlines-hidden-static-local-var[visibility inlines hidden static local var]' + '-fvisibility-ms-compat[give global types and functions a specific visibility]' + '-fvisibility-nodllstorageclass=[the visibility for defintiions without an explicit DLL export class]:arg' + '-fwasm-exceptions[use WebAssembly style exceptions]' + '-fwhole-file[whole file]' + '-fwhole-program-vtables[enables whole-program vtable optimization]' + '-fwritable-strings[store string literals as writable data]' + '-fxl-pragma-pack[enable IBM XL #pragma pack handling]' + '-fxor-operator[enable .XOR. as a synonym of .NEQV.]' + '-fxray-always-emit-customevents[always emit xray customevent calls]' + '-fxray-always-emit-typedevents[always emit xray typedevents calls]' + '-fxray-always-instrument=[file defining xray always instrument]:file:_files' + '-fxray-attr-list=[file defining the list of xray attributes]:file:_files' + '-fxray-function-groups=[only instrument 1 of N groups]:arg' + '-fxray-function-index[xray function index]' + "-fxray-ignore-loops[don't instrument functions with loops unless they also meet the minimum function size]" + '-fxray-instruction-threshold=[sets the minimum function size to instrument with XRay]:arg' + '-fxray-instrumentation-bundle=[select which XRay instrumentation points to emit]:arg' + '-fxray-instrument[generate XRay instrumentation sleds on function entry and exit]' + '-fxray-link-deps[tells clang to add the link dependencies for XRay]' + '-fxray-modes=[list of modes to link in by default into XRay instrumented binaries]:arg' + '-fxray-never-instrument=[file defining the whitelist for Xray attributes]:file:_files' + '-fxray-selected-function-group=[select which group of functions to instrument]:arg' + '-fzvector[enable System z vector language extension]' + {-gcc-toolchain=,--gcc-toolchain=}'[use the gcc toolchain at the given directory]:directory:_files -/' + '-gcodeview[generate CodeView debug information]' + {-gcodeview-ghash,-gno-codeview-ghash}'[emit type record hashes is a .debug section]' + '-gcolumn-info[column info]' + '-gdwarf-aranges[DWARF aranges]' + '-gembed-source[embed source text in DWARF debug sections]' + '-gfull[emit debugging information for all symbols and types]' + {-G-,-G=-,-msmall-data-limit=,-msmall-data-threshold}'[put objects of at most size bytes into small data section]:size' + '-ggnu-pubnames[gnu pubnames]' + '-ginline-line-tables[inline line tables]' + '-gline-directives-only[emit debug line info directives only]' + '-gline-tables-only[line tables only]' + '-glldb[lldb]' + '-gmlt[emit debug line number tables only]' + '-gmodules[generate debug info with external references]' + '-gno-column-info[no column info]' + '-gno-embed-source[no embed source]' + '-gno-gnu-pubnames[no gnu pubnames]' + '-gno-inline-line-tables[no inline line tables]' + '-gno-record-command-line[no record command line]' + '--gpu-instrument-lib=[instrument device library for HIP]:argument' + '--gpu-max-threads-per-block=[default max threads per block for kernel launch bounds for HIP]' + '-grecord-command-line[record command line]' + '-gsce[sce]' + '-gused[emit debugging information for symbols that are used]' + '-gz=[DWARF debug sections compression type]::arg' + '-headerpad_max_install_names[headerpad max install names]:argument' + '-help[display this information]' + '--help-hidden[display help for hidden options]' + '--hip-device-lib=[hIP device library]:arg' + '--hip-device-lib-path=[hip device lib path]:arg' + '--hip-link[link clang-offload-bundler bundles for HIP]' + '--hip-version=[HIP version in the format of major.minor.patch]' + '-ibuiltininc[enable builtin #include directories even when -nostdinc is used before or after -ibuiltininc]' + '-iframework[add directory to SYSTEM framework search path]:directory:_files -/' + '-iframeworkwithsysroot[add directory to SYSTEM framework search path, absolute paths are relative to -isysroot]:directory:_files -/' + '-image_base[image base]:argument' + '-include-pch[include precompiled header file]:file:_files' + '-index-header-map[make the next included directory (-I or -F) an indexer header map]' + '-init[init]:arg' + '-install_name[install name]:arg' + '-integrated-as[integrated as]' + '-interface-stub-version=[interface stub version]:arg' + '-isystem-after[add directory to end of the SYSTEM include search path]:directory:_files -/' + '-ivfsoverlay[overlay the virtual filesystem described by file over the real file system]:arg' + '-iwithsysroot[add directory to SYSTEM include search path]:directory:_files -/' + '-J[this option specifies where to put .mod files for compiled modules]:arg' + '-keep_private_externs[keep private externs]' + '*-lazy_framework[lazy framework]:framework:->framework' + '*-lazy_library[lazy library]:arg' + '--ld-path=[ld path]:arg' + '--libomptarget-amdgcn-bc-path=[path to libomptarget-amdgcn bitcode library]:arg' + '--libomptarget-nvptx-bc-path=[path to libomptarget-nvptx bitcode library]:arg' + '--library-directory=[add directory to library search path]:directory:_files -/' + '-maix-struct-return[return all structs in memory]' + "-malign-branch-boundary=[specify the boundary's size to align branches]:size" + '-malign-branch=[specify types of branches to align]:arg' + '-mappletvos-version-min=[appletvos version min]:arg' + '-mappletvsimulator-version-min=[appletvsimulator version min]:arg' + '-mbackchain[link stack frames through backchain on System Z]' + '-mbig-endian[big endian]' + '-mbranches-within-32B-boundaries[align selected branches within 32-byte boundary]' + '-mbranch-protection=[enforce targets of indirect branches and function returns]:arg' + '-mcode-object-v3[legacy option to specify code object ABI V3]' + '-mcode-object-version=[specify code object ABI version]:version' + '-mconsole[console]:arg' + '-mcrc[allow use of CRC instructions]' + '-mdefault-build-attributes[default build attributes]:arg' + '-mdll[dll]:arg' + '-mdouble=[force double to be 32 bits or 64 bits]:arg' + '-mdynamic-no-pic[dynamic no pic]:arg' + '-meabi[set EABI type]:arg' + '-menable-experimental-extensions[enable use of experimental RISC-V extensions]' + '-menable-unsafe-fp-math[allow unsafe floating-point math optimizations which may decrease precision]' + '-mfix-cortex-a53-835769[workaround Cortex-A53 erratum 835769]' + '-mfloat-abi=[float abi]:arg' + '-mfpu=[fpu]:arg' + '-mglobal-merge[enable merging of globals]' + '-mharden-sls=[select straight-line speculation hardening scope]:arg' + '--mhwdiv=[hwdiv]:arg' + '-mhwdiv=[hwdiv]:arg' + '-mhwmult=[hwmult]:arg' + '-mignore-xcoff-visibility[do not emit the visibility attribute for asm]' + '--migrate[run the migrator]' + '-mimplicit-float[implicit float]' + '-mimplicit-it=[implicit it]:arg' + '-mincremental-linker-compatible[emit an object file which can be used with an incremental linker]' + '-mios-simulator-version-min=[ios simulator version min]:arg' + '-mios-version-min=[ios version min]:arg' + '-miphoneos-version-min=[iphoneos version min]:arg' + '-miphonesimulator-version-min=[iphonesimulator version min]:arg' + '-mkernel[kernel]' + '-mlinker-version=[linker version]:arg' + '-mlittle-endian[little endian]' + "-mllvm[additional arguments to forward to LLVM's option processing]:arg" + '-mlong-calls[generate branches with extended addressability]' + '-mlvi-cfi[enable only control-flow mitigations for Load Value Injection]' + '-mlvi-hardening[enable all mitigations for Load Value Injection]' + '-mmacos-version-min=[set Mac OS X deployment target]:arg' + '-mmacosx-version-min=[macosx version min]:arg' + '-mmcu=[mcu]:arg' + '-module-dependency-dir[directory to dump module dependencies to]:arg' + '-module-dir[odule dir]:dir' + '-module-file-info[provide information about a particular module file]' + '-moslib=[oslib]:arg' + '-moutline-atomics[generate local calls to out-of-line atomic operations]' + '-mpacked-stack[use packed stack layout]' + '-mpad-max-prefix-size=[specify maximum number of prefixes to use for padding]:arg' + '-mpie-copy-relocations[pie copy relocations]' + '-mprefer-vector-width=[specifies preferred vector width]:arg' + '-mqdsp6-compat[enable hexagon-qdsp6 backward compatibility]' + '-mrelax-all[relax all machine instructions]' + '-mrelax[enable linker relaxation]' + '-mretpoline[retpoline]' + '-mseses[enable speculative execution side effect suppression (SESES)]' + '-msign-return-address=[select return address signing scope]:arg' + '-msim[sim]' + '-mspeculative-load-hardening[speculative load hardening]' + '-mstack-alignment=[set the stack alignment]:arg' + '-mstack-probe-size=[set the stack probe size]:size' + '-mstack-protector-guard-offset=[use the given offset for addressing the stack-protector guard]:arg' + '-mstack-protector-guard-reg=[use the given reg for addressing the stack-protector guard]:reg' + '-msvr4-struct-return[return small structs in registers]' + '-mthread-model[the thread model to use]:arg' + '-mthumb[thumb]' + '-mtls-size=[specify bit size of immediate TLS offsets]:arg' + '-mtvos-simulator-version-min=[tvos simulator version min]:arg' + '-mtvos-version-min=[tvos version min]:arg' + '-multi_module[multi module]' + '-multiply_defined[multiply defined]:arg' + '-multiply_defined_unused[multiply defined unused]:arg' + '-municode[unicode]:arg' + '-munsafe-fp-atomics[enable unsafe floating point atomic instructions]' + '-mv55[equivalent to -mcpu=hexagonv55]' + '-mv5[equivalent to -mcpu=hexagonv5]' + '-mv60[equivalent to -mcpu=hexagonv60]' + '-mv62[equivalent to -mcpu=hexagonv62]' + '-mv65[equivalent to -mcpu=hexagonv65]' + '-mv66[equivalent to -mcpu=hexagonv66]' + '-mv67[equivalent to -mcpu=hexagonv67]' + '-mv67t[equivalent to -mcpu=hexagonv67t]' + '-mv68[equivalent to -mcpu=hexagonv68]' + '-mvx[vx]' + '-mwarn-nonportable-cfstrings[warn nonportable cfstrings]' + '-mwatchos-simulator-version-min=[watchos simulator version min]:arg' + '-mwatchos-version-min=[watchos version min]:arg' + '-mwatchsimulator-version-min=[watchsimulator version min]:arg' + '-mwavefrontsize64[specify wavefront size 64 mode]' + '-mwindows[windows]:arg' + '-mzvector[zvector]' + '-nobuiltininc[do not search builtin directory for include files]' + '-nocpp[no cpp]' + '-nocudainc[do not add include paths for CUDA/HIP and do not include the default CUDA/HIP wrapper headers]' + '*--no-cuda-include-ptx=[do not include ptx for the following gpu architecture]:argument' + '-nocudalib[do not link device library for CUDA/HIP device compilation]' + '--no-cuda-noopt-device-debug[disable device-side debug info generation]' + "--no-cuda-version-check[don't error out if the detected version of the CUDA install is too low for the requested CUDA gpu architecture]" + '-no_dead_strip_inits_and_terms[no dead strip inits and terms]' + '-nofixprebinding[no fixprebinding]' + '-nogpuinc[no gpuinc]' + '-nogpulib[no gpulib]' + '--no-integrated-cpp[no integrated cpp]' + '-no-integrated-cpp[no integrated cpp]' + '-nolibc[no libc]' + '-nomultidefs[no multidefs]' + '--no-offload-arch=[no offload arch]:arg' + '-no-pie[no pie]' + '-nopie[no pie]' + '-noprebind[no prebind]' + '-noprofilelib[no profilelib]' + '-no-pthread[no pthread]' + '-noseglinkedit[no seglinkedit]' + '--no-standard-libraries[no standard libraries]' + '-nostdinc\+\+[disable standard #include directories for the C++ standard library]' + '-nostdlibinc[do not search standard system directories for include files]' + '-nostdlib\+\+[no stdlib++]' + '--no-system-header-prefix=[no system header prefix]:prefix' + '--no-undefined[no undefined]' + '-objcmt-atomic-property[make migration to atomic properties]' + '-objcmt-migrate-all[enable migration to modern ObjC]' + '-objcmt-migrate-annotation[enable migration to property and method annotations]' + '-objcmt-migrate-designated-init[enable migration to infer NS_DESIGNATED_INITIALIZER for initializer methods]' + '-objcmt-migrate-instancetype[enable migration to infer instancetype for method result type]' + '-objcmt-migrate-literals[enable migration to modern ObjC literals]' + '-objcmt-migrate-ns-macros[enable migration to NS_ENUM/NS_OPTIONS macros]' + '-objcmt-migrate-property-dot-syntax[enable migration of setter/getter messages to property-dot syntax]' + '-objcmt-migrate-property[enable migration to modern ObjC property]' + '-objcmt-migrate-protocol-conformance[enable migration to add protocol conformance on classes]' + '-objcmt-migrate-readonly-property[enable migration to modern ObjC readonly property]' + '-objcmt-migrate-readwrite-property[enable migration to modern ObjC readwrite property]' + '-objcmt-migrate-subscripting[enable migration to modern ObjC subscripting]' + "-objcmt-ns-nonatomic-iosonly[enable migration to use NS_NONATOMIC_IOSONLY macro for setting property's atomic attribute]" + '-objcmt-returns-innerpointer-property[enable migration to annotate property with NS_RETURNS_INNER_POINTER]' + '-objcmt-whitelist-dir-path=[objcmt whitelist dir path]:arg' + '-objcmt-white-list-dir-path=[only modify files with a filename contained in the provided directory path]:arg' + '-ObjC[treat source files as Objective-C]' + '-ObjC\+\+[treat source files as Objective-C++]' + '-object[object]' + '--offload-arch=[offload arch]:arg' + '--output-class-directory=[output class directory]:arg' + '-pagezero_size[pagezero size]:arg' + '-pg[enable mcount instrumentation]' + {-p,--profile}'[enable function profiling for prof]' + '-prebind_all_twolevel_modules[prebind all twolevel modules]' + '-prebind[prebind]' + '--precompile[only precompile the input]' + '-preload[preload]' + '--print-diagnostic-categories[print diagnostic categories]' + '-print-effective-triple[print effective triple]' + '--print-effective-triple[print the effective target triple]' + '--print-file-name=[print the full library path of <file>]:file:_files' + '-print-ivar-layout[enable Objective-C Ivar layout bitmap print trace]' + '--print-libgcc-file-name[print the library path for the currently used compiler runtime library]' + '--print-multi-directory[print multi directory]' + '--print-multi-lib[print multi lib]' + '--print-prog-name=[print the full program path of <name>]:name' + '-print-resource-dir[print resource dir]' + '--print-resource-dir[print the resource directory pathname]' + '--print-search-dirs[print the paths used for finding libraries and programs]' + '--print-supported-cpus[print supported cpus]' + '-print-supported-cpus[print supported cpus]' + '-print-targets[print targets]' + '--print-targets[print the registered targets]' + '-print-target-triple[print target triple]' + '--print-target-triple[print the normalized target triple]' + '-private_bundle[private bundle]' + '--profile-blocks[undocumented option]' + '-pthreads[pthreads]' + '-pthread[support POSIX threads in generated code]' + '--ptxas-path=[path to ptxas (used for compiling CUDA code)]:arg' + "-Qunused-arguments[don't emit warning for unused driver arguments]" + '-read_only_relocs[read only relocs]:arg' + '-relocatable-pch[relocatable pch]' + '--relocatable-pch[whether to build a relocatable precompiled header]' + '-R[enable the specified remark]:remark' + '--resource=[resource]:arg' + '-rewrite-legacy-objc[rewrite Legacy Objective-C source to C++]' + '-rewrite-objc[rewrite Objective-C source to C++]' + '--rocm-device-lib-path=[rOCm device library path]:arg' + '--rocm-path=[rOCm installation path]:arg' + '-Rpass-analysis=[report transformation analysis from optimization passes]:regex' + '-Rpass-missed=[report missed transformations by optimization passes]:arg' + '-Rpass=[report transformations performed by optimization passes]:arg' + '-rpath[rpath]:arg' + '-r[product a relocatable object as output]' + '--rtlib=[compiler runtime library to use]:arg' + '-rtlib=[rtlib]:arg' + '--save-stats=[save llvm statistics]:arg' + '-sectalign[sectalign]:arg' + '-sectcreate[sectcreate]:arg' + '-sectobjectsymbols[sectobjectsymbols]:arg' + '-sectorder[sectorder]:arg' + '-seg1addr[seg1addr]:arg' + '-segaddr[segaddr]:arg' + '-seg_addr_table_filename[seg addr table filename]:arg' + '-seg_addr_table[seg addr table]:arg' + '-segcreate[segcreate]:arg' + '-seglinkedit[seglinkedit]' + '-segprot[segprot]:arg' + '-segs_read_only_addr[segs read only addr]:arg' + '-segs_read_[segs read]:arg' + '-segs_read_write_addr[segs read write addr]:arg' + '--serialize-diagnostics[serialize compiler diagnostics to a file]:arg' + '-serialize-diagnostics[serialize diagnostics]:arg' + '-shared-libasan[dynamically link the sanitizer runtime]' + '-shared-libsan[shared libsan]' + '--shared[shared]' + '--signed-char[signed char]' + '-single_module[single module]' + '--specs=[specs]:arg' + '-static-libgfortran[static libgfortran]' + '-static-libsan[statically link the sanitizer runtime]' + '-static-libstdc\+\+[static libstdc++]' + '-static-openmp[use the static host OpenMP runtime while linking.]' + '-static-pie[static pie]' + '--static[static]' + '-std-default=[std default]:arg' + '--stdlib=[c++ standard library to use]:arg' + '-stdlib\+\+-isystem[use directory as the C++ standard library include path]:directory:_files -/' + '-stdlib=[stdlib]:arg' + '-sub_library[sub library]:arg' + '-sub_umbrella[sub umbrella]:arg' + '-sycl-std=[SYCL language standard to compile for]:standard' + '--system-header-prefix=[treat all #include paths starting with <prefix> as including a system header]:prefix' + '-target[generate code for the given target]:arg' + '--target=[target]:arg' + '-Tbss[set starting address of BSS to <addr>]:addr' + '-Tdata[set starting address of DATA to <addr>]:addr' + '--traditional[traditional]' + '-traditional[traditional]' + '-Ttext[set starting address of TEXT to <addr>]:addr' + '-t[undocumented option]' + '-twolevel_namespace_hints[twolevel namespace hints]' + '-twolevel_namespace[twolevel namespace]' + '-umbrella[umbrella]:arg' + '-undefined[undefined]:arg' + '-unexported_symbols_list[unexported symbols list]:arg' + '--unsigned-char[unsigned char]' + '--unwindlib=[unwind library to use]:arg' + '-unwindlib=[unwindlib]:arg' + '--verify-debug-info[verify the binary representation of debug output]' + '-verify-pch[load and verify that a pre-compiled header file is not stale]' + '--warn-=-[enable the specified warning]:warning:->warning' + '*-weak_framework[weak framework]:framework:->framework' + '*-weak_library[weak library]:arg' + '-weak-l[weak l]:arg' + '-weak_reference_mismatches[weak reference mismatches]:arg' + '-whatsloaded[whatsloaded]' + '-whyload[whyload]' + '-working-directory=[resolve file paths relative to the specified directory]:arg' + '-Xanalyzer[pass <arg> to the static analyzer]:arg' + '-Xarch_device[pass arg to CUDA/HIP device compilation]:argument' + '-Xarch_host[pass arg to CUDA/HIP host compilation]:argument' + '-Xclang[pass <arg> to the clang compiler]:arg' + '-Xcuda-fatbinary[pass arg to fatbinary invocation]:argument' + '-Xcuda-ptxas[pass arg to the ptxas assemler]:argument' + '-Xflang[pass <arg> to the flang compiler]:arg' + '-Xopenmp-target[pass arg to the the target offloading toolchain]:argument' + '-y[the action to perform on the input]:arg' + '-Z-[undocumented option]:argument' + ) else - args+=( - '-flto=-[Enable link-time optimization]::jobs:' - '*--help=-[Display this information]:class:->help' - ) + args+=( + '--dump=[dump information]:argument' + '-flto=-[enable link-time optimization]::jobs:' + '*--help=-[display this information]:class:->help' + ) fi local -a sanitizers - sanitizers=( - address alignment bool bounds enum float-cast-overflow float-divide-by-zero - integer-divide-by-zero memory nonnull-attribute null nullability-arg nullability-assign - nullability-return object-size pointer-overflow return unsigned-integer-overflow - returns-nonnull-attribute shift signed-integer-overflow unreachable vla-bound vptr - ) +sanitizers=( + address alignment bool bounds enum float-cast-overflow float-divide-by-zero + integer-divide-by-zero memory nonnull-attribute null nullability-arg + nullability-assign nullability-return object-size pointer-overflow return + unsigned-integer-overflow returns-nonnull-attribute shift signed-integer-overflow + unreachable vla-bound vptr +) local -a languages languages=( - c c-header cpp-output - c++ c++-header c++-cpp-output - objective-c objective-c-header objective-c-cpp-output - objective-c++ objective-c++-header objective-c++-cpp-output - assembler assembler-with-cpp - ada - f77 f77-cpp-input f95 f95-cpp-input - go - java - brig - none -) - -# generic options (from --help) -args+=( - '-###[print commands to run this compilation]' - '-o:output file:_files -g "^*.(c|h|cc|C|cxx|cpp|hpp)(-.)"' - '-x[Specify the language of the following input files]:input file language:('"$languages"')' - '+e-:virtual function definitions in classes:((0\:only\ interface 1\:generate\ code))' - '-d-:dump:->dump' - '-g-::debugging information type or level:(0 1 2 3 gdb coff stabs stabs+ dwarf dwarf+ dwarf-2 dwarf-3 dwarf-4 xcoff xcoff+)' - '-O-::optimization level:((0 1 2 3 g\:optimize\ for\ debugging\ experience s\:optimize\ for\ space fast\:optimize\ for\ speed\ disregarding\ exact\ standards\ compliance))' - '*-M-::output dependencies:((M\:only\ user\ header\ files MD\:output\ to\ file G\:treat\ missing\ header\ files\ as\ generated))' - '*-A-:define assertion:' - '*-D-:define macro:' - '*-U-:undefine macro:' - '-C[do not discard comments during preprocess]' - '-CC[do not discard comments, including macro expansion]' - '-P[inhibit generation of linkemakers during preprocess]' - '-H[print name of each header file used]' - '-E[Preprocess only; do not compile, assemble or link]' - '-S[Compile only; do not assemble or link]' - '-c[Compile and assemble, but do not link]' - '*-Wp,-:preprocessor option:' - '*-Wl,-:linker option:' - '*-Xpreprocessor:preprocessor option:' - '*-Xlinker:linker option:' - '*-Xassembler:assembler option:' - '*-u:pretend symbol to be undefined:' - '*-Wa,-:assembler option:' - '*-l:library:->library' - '*-L-:library search path:_files -/' - '*-I-:header file search path:_files -/' - '-B-[Add <prefix> to the compiler'\''s search paths]:executable prefix:_files -/' - '-b:target machine:' - '-V:specify compiler version:' - '--version[Display compiler version information]' - '-print-file-name=-[Display the full path to library <library>]:library:->library' - '-print-prog-name=-[Display the full path to compiler component <program>]:program:' - '*-specs=-[Override built-in specs with the contents of <file>]:file:_files' - '-std=-[assume that the input sources are for specified standard]:standard:(c90 c89 iso9899\:1990 iso9899\:199409 c99 iso9899\:1999 c11 iso9899\:2011 gnu90 gnu89 gnu99 gnu11 c++98 c++03 gnu++98 gnu++03 c++11 gnu++11 c++1y gnu++1y c++14 gnu++14 c++1z gnu++1z c++17 iso9899\:2017 gnu++17 c++2a gnu++2a)' - '*-include:include file:_files -g \*.h\(-.\)' - '*-imacros:macro input file:_files -g \*.h\(-.\)' - '*-idirafter:second include path directory:_files -/' - '*-iprefix:prefix:_files' - '*-iwithprefix:second include path directory:_files -/' - '*-iwithprefixbefore:main include path directory:_files -/' - '*-isystem:second include path directory (system):_files -/' - '--sysroot=-[Use <directory> as the root directory for headers and libraries]:directory:_files -/' - '-pass-exit-codes[Exit with highest error code from a phase]' - '--target-help[Display target specific command line options]' - '-dumpspecs[Display all of the built in spec strings]' - '-dumpversion[Display the version of the compiler]' - '-dumpmachine[Display the compiler'\''s target processor]' - '-print-search-dirs[Display the directories in the compiler'\''s search path]' - '-print-libgcc-file-name[Display the name of the compiler'\''s companion library]' - '-print-multiarch[Display the target'\''s normalized GNU triplet, used as a component in the library path]' - '-print-multi-directory[Display the root directory for versions of libgcc]' - '-print-multi-lib[Display the mapping between command line options and multiple library search directories]' - '-print-multi-os-directory[Display the relative path to OS libraries]' - '-print-sysroot[Display the target libraries directory]' - '-print-sysroot-headers-suffix[Display the sysroot suffix used to find headers]' - '-save-stats=-[Save code generation statistics]:location:(cwd obj)' - '-save-temps[Do not delete intermediate files]' - '-no-canonical-prefixes[Do not canonicalize paths when building relative prefixes to other gcc components]' - '-pipe[Use pipes rather than intermediate files]' - '-pie[Create a position independent executable]' - '-shared[Create a shared library]' - '-time[Time the execution of each subprocess]' + c c-header cpp-output c++ c++-header c++-cpp-output objective-c objective-c-header + objective-c-cpp-output objective-c++ objective-c++-header objective-c++-cpp-output + assembler assembler-with-cpp ada f77 f77-cpp-input f95 f95-cpp-input go java + brig none ) # warnings (from --help=warnings), note some -W options are listed by --help=common instead -args+=( -# --help=warnings,^joined - '-W[This switch is deprecated; use -Wextra instead]' - '-Wabi-tag[Warn if a subobject has an abi_tag attribute that the complete object type does not have]' - '-Wabi[Warn about things that will change when compiling with an ABI-compliant compiler]' - '-Waddress[Warn about suspicious uses of memory addresses]' - '-Waggregate-return[Warn about returning structures, unions or arrays]' - '-Waggressive-loop-optimizations[Warn if a loop with constant number of iterations triggers undefined behavior]' - '-Waliasing[Warn about possible aliasing of dummy arguments]' - '-Walign-commons[Warn about alignment of COMMON blocks]' - '-Wall[Enable most warning messages]' - '-Walloc-zero[Warn for calls to allocation functions that specify zero bytes]' - '-Walloca[Warn on any use of alloca]' - '-Wampersand[Warn about missing ampersand in continued character constants]' - '-Wargument-mismatch[Warn about type and rank mismatches between arguments and parameters]' - '-Warray-bounds[Warn if an array is accessed out of bounds]' - '-Warray-temporaries[Warn about creation of array temporaries]' - '-Wassign-intercept[Warn whenever an Objective-C assignment is being intercepted by the garbage collector]' - '-Wattributes[Warn about inappropriate attribute usage]' - '-Wbad-function-cast[Warn about casting functions to incompatible types]' - '-Wbool-compare[Warn about boolean expression compared with an integer value different from true/false]' - '-Wbool-operation[Warn about certain operations on boolean expressions]' - '-Wbuiltin-declaration-mismatch[Warn when a built-in function is declared with the wrong signature]' - '-Wbuiltin-macro-redefined[Warn when a built-in preprocessor macro is undefined or redefined]' - '-Wc++-compat[Warn about C constructs that are not in the common subset of C and C++]' - '-Wc++0x-compat[Deprecated in favor of -Wc++11-compat]' - '-Wc++1z-compat[Warn about C++ constructs whose meaning differs between ISO C++ 2014 and (forthcoming) ISO C++ 201z(7?)]' - '-Wc++11-compat[Warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++ 2011]' - '-Wc++14-compat[Warn about C++ constructs whose meaning differs between ISO C++ 2011 and ISO C++ 2014]' - '-Wc-binding-type[Warn if the type of a variable might be not interoperable with C]' - '-Wc90-c99-compat[Warn about features not present in ISO C90, but present in ISO C99]' - '-Wc99-c11-compat[Warn about features not present in ISO C99, but present in ISO C11]' - '-Wcast-align[Warn about pointer casts which increase alignment]' - '-Wcast-qual[Warn about casts which discard qualifiers]' - '-Wchar-subscripts[Warn about subscripts whose type is "char"]' - '-Wcharacter-truncation[Warn about truncated character expressions]' - '-Wchkp[Warn about memory access errors found by Pointer Bounds Checker]' - '-Wclobbered[Warn about variables that might be changed by "longjmp" or "vfork"]' - '-Wcomment[Warn about possibly nested block comments, and C++ comments spanning more than one physical line]' - '-Wcomments[Synonym for -Wcomment]' - '-Wcompare-reals[Warn about equality comparisons involving REAL or COMPLEX expressions]' - '-Wconditionally-supported[Warn for conditionally-supported constructs]' - '-Wconversion-extra[Warn about most implicit conversions]' - '-Wconversion-null[Warn for converting NULL from/to a non-pointer type]' - '-Wconversion[Warn for implicit type conversions that may change a value]' - '-Wcoverage-mismatch[Warn in case profiles in -fprofile-use do not match]' - '-Wcpp[Warn when a #warning directive is encountered]' - '-Wctor-dtor-privacy[Warn when all constructors and destructors are private]' - '-Wdangling-else[Warn about dangling else]' - '-Wdate-time[Warn about __TIME__, __DATE__ and __TIMESTAMP__ usage]' - '-Wdeclaration-after-statement[Warn when a declaration is found after a statement]' - '-Wdelete-incomplete[Warn when deleting a pointer to incomplete type]' - '-Wdelete-non-virtual-dtor[Warn about deleting polymorphic objects with non- virtual destructors]' - '-Wdeprecated-declarations[Warn about uses of __attribute__((deprecated)) declarations]' - '-Wdeprecated[Warn if a deprecated compiler feature, class, method, or field is used]' - '-Wdesignated-init[Warn about positional initialization of structs requiring designated initializers]' - '-Wdisabled-optimization[Warn when an optimization pass is disabled]' - '-Wdiscarded-array-qualifiers[Warn if qualifiers on arrays which are pointer targets are discarded]' - '-Wdiscarded-qualifiers[Warn if type qualifiers on pointers are discarded]' - '-Wdiv-by-zero[Warn about compile-time integer division by zero]' - '-Wdouble-promotion[Warn about implicit conversions from "float" to "double"]' - '-Weffc\+\+[Warn about violations of Effective C++ style rules]' - '-Wduplicate-decl-specifier[Warn when a declaration has duplicate const, volatile, restrict or _Atomic specifier]' - '-Wduplicated-branches[Warn about duplicated branches in if-else statements]' - '-Wduplicated-cond[Warn about duplicated conditions in an if-else-if chain]' - '-Weffc++[Warn about violations of Effective C++ style rules]' - '-Wempty-body[Warn about an empty body in an if or else statement]' - '-Wendif-labels[Warn about stray tokens after #else and #endif]' - '-Wenum-compare[Warn about comparison of different enum types]' -#this still exists but makes completing -Werror= less convenient - #'-Werror-implicit-function-declaration[This switch is deprecated; use -Werror=implicit-fun - '-Wexpansion-to-defined[Warn if "defined" is used outside #if]' - '-Wextra[Print extra (possibly unwanted) warnings]' - '-Wfloat-conversion[Warn for implicit type conversions that cause loss of floating point precision]' - '-Wfloat-equal[Warn if testing floating point numbers for equality]' - '-Wformat-contains-nul[Warn about format strings that contain NUL bytes]' - '-Wformat-extra-args[Warn if passing too many arguments to a function for its format string]' - '-Wformat-nonliteral[Warn about format strings that are not literals]' - '-Wformat-overflow[Warn about function calls with format strings that write past the end of the destination region]' - '-Wformat-security[Warn about possible security problems with format functions]' - '-Wformat-signedness[Warn about sign differences with format functions]' - '-Wformat-truncation[Warn about calls to snprintf and similar functions that truncate output. Same as -Wformat- truncation=1. Same as -Wformat-truncation=]' - '-Wformat-y2k[Warn about strftime formats yielding 2-digit years]' - '-Wformat-zero-length[Warn about zero-length formats]' - '-Wformat[Warn about printf/scanf/strftime/strfmon format string anomalies]' - '-Wframe-address[Warn when __builtin_frame_address or __builtin_return_address is used unsafely]' - '-Wfree-nonheap-object[Warn when attempting to free a non-heap object]' - '-Wfunction-elimination[Warn about function call elimination]' - '-Whsa[Warn when a function cannot be expanded to HSAIL]' - '-Wignored-attributes[Warn whenever attributes are ignored]' - '-Wignored-qualifiers[Warn whenever type qualifiers are ignored]' - '-Wimplicit-function-declaration[Warn about implicit function declarations]' - '-Wimplicit-int[Warn when a declaration does not specify a type]' - '-Wimplicit-interface[Warn about calls with implicit interface]' - '-Wimplicit-procedure[Warn about called procedures not explicitly declared]' - '-Wimplicit[Warn about implicit declarations]' - '-Wincompatible-pointer-types[Warn when there is a conversion between pointers that have incompatible types]' - '-Winherited-variadic-ctor[Warn about C++11 inheriting constructors when the base has a variadic constructor]' - '-Winit-self[Warn about variables which are initialized to themselves]' - '-Winline[Warn when an inlined function cannot be inlined]' - '-Wint-conversion[Warn about incompatible integer to pointer and pointer to integer conversions]' - '-Wint-in-bool-context[Warn for suspicious integer expressions in boolean context]' - '-Wint-to-pointer-cast[Warn when there is a cast to a pointer from an integer of a different size]' - '-Winteger-division[Warn about constant integer divisions with truncated results]' - '-Wintrinsic-shadow[Warn if a user-procedure has the same name as an intrinsic]' - '-Wintrinsics-std[Warn on intrinsics not part of the selected standard]' - '-Winvalid-memory-model[Warn when an atomic memory model parameter is known to be outside the valid range]' - '-Winvalid-offsetof[Warn about invalid uses of the "offsetof" macro]' - '-Winvalid-pch[Warn about PCH files that are found but not used]' - '-Wjump-misses-init[Warn when a jump misses a variable initialization]' - '-Wline-truncation[Warn about truncated source lines]' - '-Wliteral-suffix[Warn when a string or character literal is followed by a ud-suffix which does not begin with an underscore]' - '-Wlogical-not-parentheses[Warn when logical not is used on the left hand side operand of a comparison]' - '-Wlogical-op[Warn when a logical operator is suspiciously always evaluating to true or false]' - '-Wlong-long[Do not warn about using "long long" when -pedantic]' - '-Wlto-type-mismatch[During link time optimization warn about mismatched types of global declarations]' - '-Wmain[Warn about suspicious declarations of "main"]' - '-Wmaybe-uninitialized[Warn about maybe uninitialized automatic variables]' - '-Wmemset-elt-size[Warn about suspicious calls to memset where the third argument contains the number of elements not multiplied by the element size]' - '-Wmemset-transposed-args[Warn about suspicious calls to memset where the third argument is constant literal zero and the second is not]' - '-Wmisleading-indentation[Warn when the indentation of the code does not reflect the block structure]' - '-Wmissing-braces[Warn about possibly missing braces around initializers]' - '-Wmissing-declarations[Warn about global functions without previous declarations]' - '-Wmissing-field-initializers[Warn about missing fields in struct initializers]' - '-Wmissing-include-dirs[Warn about user-specified include directories that do not exist]' - '-Wmissing-parameter-type[Warn about function parameters declared without a type specifier in K&R-style functions]' - '-Wmissing-prototypes[Warn about global functions without prototypes]' - '-Wmudflap[Warn about constructs not instrumented by -fmudflap]' - '-Wmultichar[Warn about use of multi-character character constants]' - '-Wmultiple-inheritance[Warn on direct multiple inheritance]' - '-Wnamespaces[Warn on namespace definition]' - '-Wnarrowing[Warn about narrowing conversions within { } that are ill-formed in C++11]' - '-Wnested-externs[Warn about "extern" declarations not at file scope]' - '-Wnoexcept-type[Warn if C++1z noexcept function type will change the mangled name of a symbol]' - '-Wnoexcept[Warn when a noexcept expression evaluates to false even though the expression can''t actually throw]' - '-Wnon-template-friend[Warn when non-templatized friend functions are declared within a template]' - '-Wnon-virtual-dtor[Warn about non-virtual destructors]' - '-Wnonnull-compare[Warn if comparing pointer parameter with nonnull attribute with NULL]' - '-Wnonnull[Warn about NULL being passed to argument slots marked as requiring non-NULL]' - '-Wnull-dereference[Warn if dereferencing a NULL pointer may lead to erroneous or undefined behavior]' - '-Wodr[Warn about some C++ One Definition Rule violations during link time optimization]' - '-Wold-style-cast[Warn if a C-style cast is used in a program]' - '-Wold-style-declaration[Warn for obsolescent usage in a declaration]' - '-Wold-style-definition[Warn if an old-style parameter definition is used]' - '-Wopenmp-simd[Warn if a simd directive is overridden by the vectorizer cost model]' - '-Woverflow[Warn about overflow in arithmetic expressions]' - '-Woverlength-strings[Warn if a string is longer than the maximum portable length specified by the standard]' - '-Woverloaded-virtual[Warn about overloaded virtual function names]' - '-Woverride-init-side-effects[Warn about overriding initializers with side effects]' - '-Woverride-init[Warn about overriding initializers without side effects]' - '-Wpacked-bitfield-compat[Warn about packed bit-fields whose offset changed in GCC 4.4]' - '-Wpacked[Warn when the packed attribute has no effect on struct layout]' - '-Wpadded[Warn when padding is required to align structure members]' - '-Wparentheses[Warn about possibly missing parentheses]' - '-Wpedantic[Issue warnings needed for strict compliance to the standard]' - '-Wplacement-new[Warn for placement new expressions with undefined behavior. Same as -Wplacement-new=]' - '-Wpmf-conversions[Warn when converting the type of pointers to member functions]' - '-Wpointer-arith[Warn about function pointer arithmetic]' - '-Wpointer-compare[Warn when a pointer is compared with a zero character constant]' - '-Wpointer-sign[Warn when a pointer differs in signedness in an assignment]' - '-Wpointer-to-int-cast[Warn when a pointer is cast to an integer of a different size]' - '-Wpoison-system-directories[Warn for -I and -L options using system directories if cross compiling]' - '-Wpragmas[Warn about misuses of pragmas]' - '-Wproperty-assign-default[Warn if a property for an Objective-C object has no assign semantics specified]' - '-Wprotocol[Warn if inherited methods are unimplemented]' - '-Wreal-q-constant[Warn about real-literal-constants with '\'q\'' exponent-letter]' - '-Wrealloc-lhs-all[Warn when a left-hand-side variable is reallocated]' - '-Wrealloc-lhs[Warn when a left-hand-side array variable is reallocated]' - '-Wredundant-decls[Warn about multiple declarations of the same object]' - '-Wregister[Warn about uses of register storage specifier]' - '-Wreorder[Warn when the compiler reorders code]' - '-Wrestrict[Warn when an argument passed to a restrict- qualified parameter aliases with another argument]' - '-Wreturn-local-addr[Warn about returning a pointer/reference to a local or temporary variable]' - '-Wreturn-type[Warn whenever a function'\''s return type defaults to "int" (C), or about inconsistent return types (C++)]' - '-Wscalar-storage-order[Warn on suspicious constructs involving reverse scalar storage order]' - '-Wselector[Warn if a selector has multiple methods]' - '-Wsequence-point[Warn about possible violations of sequence point rules]' - '-Wshadow-ivar[Warn if a local declaration hides an instance variable]' - '-Wshadow[Warn when one variable shadows another. Same as -Wshadow=global]' - '-Wshift-count-negative[Warn if shift count is negative]' - '-Wshift-count-overflow[Warn if shift count >= width of type]' - '-Wshift-negative-value[Warn if left shifting a negative value]' - '-Wshift-overflow[Warn if left shift of a signed value overflows. Same as -Wshift-overflow=]' - '-Wsign-compare[Warn about signed-unsigned comparisons]' - '-Wsign-conversion[Warn for implicit type conversions between signed and unsigned integers]' - '-Wsign-promo[Warn when overload promotes from unsigned to signed]' - '-Wsized-deallocation[Warn about missing sized deallocation functions]' - '-Wsizeof-array-argument[Warn when sizeof is applied on a parameter declared as an array]' - '-Wsizeof-pointer-memaccess[Warn about suspicious length parameters to certain string functions if the argument uses sizeof]' - '-Wstack-protector[Warn when not issuing stack smashing protection for some reason]' - '-Wstrict-aliasing[Warn about code which might break strict aliasing rules]' - '-Wstrict-null-sentinel[Warn about uncasted NULL used as sentinel]' - '-Wstrict-overflow[Warn about optimizations that assume that signed overflow is undefined]' - '-Wstrict-prototypes[Warn about unprototyped function declarations]' - '-Wstrict-selector-match[Warn if type signatures of candidate methods do not match exactly]' - '-Wstringop-overflow[Warn about buffer overflow in string manipulation functions like memcpy and strcpy. Same as -Wstringop-overflow=]' - '-Wsubobject-linkage[Warn if a class type has a base or a field whose type uses the anonymous namespace or depends on a type with no linkage]' +warnings+=( + '-Wabi-tag[warn if a subobject has an abi_tag attribute that the complete object type does not have]' + '-Wabi[warn about things that will change when compiling with an ABI-compliant compiler]::' + '-Waddress[warn about suspicious uses of memory addresses]' + '-Waggregate-return[warn about returning structures, unions or arrays]' + '-Waggressive-loop-optimizations[warn if a loop with constant number of iterations triggers undefined behavior]' + '-Waliasing[warn about possible aliasing of dummy arguments]' + '-Walign-commons[warn about alignment of COMMON blocks]' + '-Waligned-new=[warn even if '\'new\'' uses a class member allocation function]:none|global|all: ' + '-Wall[enable most warning messages]' + '-Walloca-larger-than=[warn on unbounded uses of alloca, and on bounded uses of alloca whose bound can be larger than <number> bytes]:bytes: ' + '-Walloca[warn on any use of alloca]' + '-Walloc-size-larger-than=[warn for calls to allocation functions that attempt to allocate objects larger than the specified number of bytes]:bytes: ' + '-Walloc-zero[warn for calls to allocation functions that specify zero bytes]' + '-Wampersand[warn about missing ampersand in continued character constants]' + '-Wargument-mismatch[warn about type and rank mismatches between arguments and parameters]' + '-Warray-bounds[warn if an array is accessed out of bounds]' + '-Warray-bounds=[warn if an array is accessed out of bounds]:level:(1 2)' + '-Warray-temporaries[warn about creation of array temporaries]' + '-Wassign-intercept[warn whenever an Objective-C assignment is being intercepted by the garbage collector]' + '-Wattributes[warn about inappropriate attribute usage]' + '-Wbad-function-cast[warn about casting functions to incompatible types]' + '-Wbool-compare[warn about boolean expression compared with an integer value different from true/false]' + '-Wbool-operation[warn about certain operations on boolean expressions]' + '-Wbuiltin-declaration-mismatch[warn when a built-in function is declared with the wrong signature]' + '-Wbuiltin-macro-redefined[warn when a built-in preprocessor macro is undefined or redefined]' + '-Wc++0x-compat[deprecated in favor of -Wc++11-compat]' + '-Wc++11-compat[warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++ 2011]' + '-Wc++14-compat[warn about C++ constructs whose meaning differs between ISO C++ 2011 and ISO C++ 2014]' + '-Wc++1z-compat[warn about C++ constructs whose meaning differs between ISO C++ 2014 and (forthcoming) ISO C++ 201z(7?)]' + '-Wc90-c99-compat[warn about features not present in ISO C90, but present in ISO C99]' + '-Wc99-c11-compat[warn about features not present in ISO C99, but present in ISO C11]' + '-Wcast-align[warn about pointer casts which increase alignment]' + '-Wcast-qual[warn about casts which discard qualifiers]' + '-Wc-binding-type[warn if the type of a variable might be not interoperable with C]' + '-Wc++-compat[warn about C constructs that are not in the common subset of C and C++]' + '-Wcharacter-truncation[warn about truncated character expressions]' + '-Wchar-subscripts[warn about subscripts whose type is "char"]' + '-Wchkp[warn about memory access errors found by Pointer Bounds Checker]' + '-Wclobbered[warn about variables that might be changed by "longjmp" or "vfork"]' + '-Wcomments[synonym for -Wcomment]' + '-Wcomment[warn about possibly nested block comments, and C++ comments spanning more than one physical line]' + '-Wcompare-reals[warn about equality comparisons involving REAL or COMPLEX expressions]' + '-Wconditionally-supported[warn for conditionally-supported constructs]' + '-Wconversion-extra[warn about most implicit conversions]' + '-Wconversion-null[warn for converting NULL from/to a non-pointer type]' + '-Wconversion[warn for implicit type conversions that may change a value]' + '-Wcoverage-mismatch[warn in case profiles in -fprofile-use do not match]' + '-Wcpp[warn when a #warning directive is encountered]' + '-Wctor-dtor-privacy[warn when all constructors and destructors are private]' + '-Wdangling-else[warn about dangling else]' + '-Wdate-time[warn about __TIME__, __DATE__ and __TIMESTAMP__ usage]' + '-Wdeclaration-after-statement[warn when a declaration is found after a statement]' + '-Wdelete-incomplete[warn when deleting a pointer to incomplete type]' + '-Wdelete-non-virtual-dtor[warn about deleting polymorphic objects with non- virtual destructors]' + '-Wdeprecated-declarations[warn about uses of __attribute__((deprecated)) declarations]' + '-Wdeprecated[warn if a deprecated compiler feature, class, method, or field is used]' + '-Wdesignated-init[warn about positional initialization of structs requiring designated initializers]' + '-Wdisabled-optimization[warn when an optimization pass is disabled]' + '-Wdiscarded-array-qualifiers[warn if qualifiers on arrays which are pointer targets are discarded]' + '-Wdiscarded-qualifiers[warn if type qualifiers on pointers are discarded]' + '-Wdiv-by-zero[warn about compile-time integer division by zero]' + '-Wdouble-promotion[warn about implicit conversions from "float" to "double"]' + '-Wduplicated-branches[warn about duplicated branches in if-else statements]' + '-Wduplicated-cond[warn about duplicated conditions in an if-else-if chain]' + '-Wduplicate-decl-specifier[warn when a declaration has duplicate const, volatile, restrict or _Atomic specifier]' + '-Weffc\+\+[warn about violations of Effective C++ style rules]' + '-Wempty-body[warn about an empty body in an if or else statement]' + '-Wendif-labels[warn about stray tokens after #else and #endif]' + '-Wenum-compare[warn about comparison of different enum types]' + # '-Werror-implicit-function-declaration[this switch is deprecated; use -Werror=implicit-fun]' # this still exists but makes completing -Werror= less convenient + '-Wexpansion-to-defined[warn if "defined" is used outside #if]' + '-Wextra[print extra (possibly unwanted) warnings]' + '-Wfloat-conversion[warn for implicit type conversions that cause loss of floating point precision]' + '-Wfloat-equal[warn if testing floating point numbers for equality]' + '-Wformat-contains-nul[warn about format strings that contain NUL bytes]' + '-Wformat-extra-args[warn if passing too many arguments to a function for its format string]' + '-Wformat-nonliteral[warn about format strings that are not literals]' + '-Wformat-overflow[warn about function calls with format strings that write past the end of the destination region]' + '-Wformat-overflow=[warn about function calls with format strings that write past the end of the destination region]:level:(1 2)' + '-Wformat-security[warn about possible security problems with format functions]' + '-Wformat-signedness[warn about sign differences with format functions]' + '-Wformat-truncation[warn about calls to snprintf and similar functions that truncate output. Same as -Wformat- truncation=1. Same as -Wformat-truncation=]' + '-Wformat-truncation=[warn about calls to snprintf and similar functions that truncate output]:level:(1 2)' + '-Wformat=[warn about printf/scanf/strftime/strfmon format string anomalies]::level:(1 2)' + '-Wformat-y2k[warn about strftime formats yielding 2-digit years]' + '-Wformat-zero-length[warn about zero-length formats]' + '-Wframe-address[warn when __builtin_frame_address or __builtin_return_address is used unsafely]' + '-Wframe-larger-than=[warn if a function'\''s stack frame requires more than <number> bytes]:bytes: ' + '-Wfree-nonheap-object[warn when attempting to free a non-heap object]' + '-Wfunction-elimination[warn about function call elimination]' + '-Whsa[warn when a function cannot be expanded to HSAIL]' + '-Wignored-attributes[warn whenever attributes are ignored]' + '-Wignored-qualifiers[warn whenever type qualifiers are ignored]' + '-Wimplicit-fallthrough=[warn when a switch case falls through]:level:(1 2 3 4 5)' + '-Wimplicit-function-declaration[warn about implicit function declarations]' + '-Wimplicit-interface[warn about calls with implicit interface]' + '-Wimplicit-int[warn when a declaration does not specify a type]' + '-Wimplicit-procedure[warn about called procedures not explicitly declared]' + '-Wimplicit[warn about implicit declarations]' + '-Wimport[warn about imports]' + '-Wincompatible-pointer-types[warn when there is a conversion between pointers that have incompatible types]' + '-Winherited-variadic-ctor[warn about C++11 inheriting constructors when the base has a variadic constructor]' + '-Winit-self[warn about variables which are initialized to themselves]' + '-Winline[warn when an inlined function cannot be inlined]' + '-Wint-conversion[warn about incompatible integer to pointer and pointer to integer conversions]' + '-Winteger-division[warn about constant integer divisions with truncated results]' + '-Wint-in-bool-context[warn for suspicious integer expressions in boolean context]' + '-Wintrinsic-shadow[warn if a user-procedure has the same name as an intrinsic]' + '-Wintrinsics-std[warn on intrinsics not part of the selected standard]' + '-Wint-to-pointer-cast[warn when there is a cast to a pointer from an integer of a different size]' + '-Winvalid-memory-model[warn when an atomic memory model parameter is known to be outside the valid range]' + '-Winvalid-offsetof[warn about invalid uses of the "offsetof" macro]' + '-Winvalid-pch[warn about PCH files that are found but not used]' + '-Wjump-misses-init[warn when a jump misses a variable initialization]' + '-Wlarger-than=[warn if an object is larger than <number> bytes]:bytes: ' + '-Wline-truncation[warn about truncated source lines]' + '-Wliteral-suffix[warn when a string or character literal is followed by a ud-suffix which does not begin with an underscore]' + '-Wlogical-not-parentheses[warn when logical not is used on the left hand side operand of a comparison]' + '-Wlogical-op[warn when a logical operator is suspiciously always evaluating to true or false]' + '-Wlong-long[do not warn about using "long long" when -pedantic]' + '-Wlto-type-mismatch[during link time optimization warn about mismatched types of global declarations]' + '-Wmain[warn about suspicious declarations of "main"]' + '-Wmaybe-uninitialized[warn about maybe uninitialized automatic variables]' + '-Wmemset-elt-size[warn about suspicious calls to memset where the third argument contains the number of elements not multiplied by the element size]' + '-Wmemset-transposed-args[warn about suspicious calls to memset where the third argument is constant literal zero and the second is not]' + '-Wmisleading-indentation[warn when the indentation of the code does not reflect the block structure]' + '-Wmissing-braces[warn about possibly missing braces around initializers]' + '-Wmissing-declarations[warn about global functions without previous declarations]' + '-Wmissing-field-initializers[warn about missing fields in struct initializers]' + '-Wmissing-include-dirs[warn about user-specified include directories that do not exist]' + '-Wmissing-parameter-type[warn about function parameters declared without a type specifier in K&R-style functions]' + '-Wmissing-prototypes[warn about global functions without prototypes]' + '-Wmudflap[warn about constructs not instrumented by -fmudflap]' + '-Wmultichar[warn about use of multi-character character constants]' + '-Wmultiple-inheritance[warn on direct multiple inheritance]' + '-Wnamespaces[warn on namespace definition]' + '-Wnarrowing[warn about narrowing conversions within { } that are ill-formed in C++11]' + '-Wnested-externs[warn about "extern" declarations not at file scope]' + '-Wnoexcept-type[warn if C++1z noexcept function type will change the mangled name of a symbol]' + '-Wnoexcept[warn when a noexcept expression evaluates to false even though the expression can''t actually throw]' + '-Wnonnull-compare[warn if comparing pointer parameter with nonnull attribute with NULL]' + '-Wnonnull[warn about NULL being passed to argument slots marked as requiring non-NULL]' + '-Wnonportable-cfstrings[warn on CFStrings containing nonportable characters]' + '-Wnon-template-friend[warn when non-templatized friend functions are declared within a template]' + '-Wnon-virtual-dtor[warn about non-virtual destructors]' + '-Wnormalized=-[warn about non-normalised Unicode strings]:normalization:((id\:allow\ some\ non-nfc\ characters\ that\ are\ valid\ identifiers nfc\:only\ allow\ NFC nfkc\:only\ allow\ NFKC none\:allow\ any\ normalization)): ' + '-Wnull-dereference[warn if dereferencing a NULL pointer may lead to erroneous or undefined behavior]' + '-Wodr[warn about some C++ One Definition Rule violations during link time optimization]' + '-Wold-style-cast[warn if a C-style cast is used in a program]' + '-Wold-style-declaration[warn for obsolescent usage in a declaration]' + '-Wold-style-definition[warn if an old-style parameter definition is used]' + '-Wopenmp-simd[warn if a simd directive is overridden by the vectorizer cost model]' + '-Woverflow[warn about overflow in arithmetic expressions]' + '-Woverlength-strings[warn if a string is longer than the maximum portable length specified by the standard]' + '-Woverloaded-virtual[warn about overloaded virtual function names]' + '-Woverride-init-side-effects[warn about overriding initializers with side effects]' + '-Woverride-init[warn about overriding initializers without side effects]' + '-Wpacked-bitfield-compat[warn about packed bit-fields whose offset changed in GCC 4.4]' + '-Wpacked[warn when the packed attribute has no effect on struct layout]' + '-Wpadded[warn when padding is required to align structure members]' + '-Wparentheses[warn about possibly missing parentheses]' + '-Wpedantic[issue warnings needed for strict compliance to the standard]' + '-Wplacement-new=[warn for placement new expressions with undefined behavior]::level:(1 2)' + '-Wpmf-conversions[warn when converting the type of pointers to member functions]' + '-Wpointer-arith[warn about function pointer arithmetic]' + '-Wpointer-compare[warn when a pointer is compared with a zero character constant]' + '-Wpointer-sign[warn when a pointer differs in signedness in an assignment]' + '-Wpointer-to-int-cast[warn when a pointer is cast to an integer of a different size]' + '-Wpoison-system-directories[warn for -I and -L options using system directories if cross compiling]' + '-Wpragmas[warn about misuses of pragmas]' + '-Wproperty-assign-default[warn if a property for an Objective-C object has no assign semantics specified]' + '-Wprotocol[warn if inherited methods are unimplemented]' + '-Wpsabi[warn about psabi]' + '-Wrealloc-lhs-all[warn when a left-hand-side variable is reallocated]' + '-Wrealloc-lhs[warn when a left-hand-side array variable is reallocated]' + '-Wreal-q-constant[warn about real-literal-constants with '\'q\'' exponent-letter]' + '-Wredundant-decls[warn about multiple declarations of the same object]' + '-Wregister[warn about uses of register storage specifier]' + '-Wreorder[warn when the compiler reorders code]' + '-Wrestrict[warn when an argument passed to a restrict- qualified parameter aliases with another argument]' + '-Wreturn-local-addr[warn about returning a pointer/reference to a local or temporary variable]' + '-Wreturn-type[warn whenever a function'\''s return type defaults to "int" (C), or about inconsistent return types (C++)]' + '-Wscalar-storage-order[warn on suspicious constructs involving reverse scalar storage order]' + '-Wselector[warn if a selector has multiple methods]' + '-Wsequence-point[warn about possible violations of sequence point rules]' + '-Wshadow-ivar[warn if a local declaration hides an instance variable]' + '-Wshadow[warn when one variable shadows another. Same as -Wshadow=global]' + '-Wshift-count-negative[warn if shift count is negative]' + '-Wshift-count-overflow[warn if shift count >= width of type]' + '-Wshift-negative-value[warn if left shifting a negative value]' + '-Wshift-overflow[warn if left shift of a signed value overflows. Same as -Wshift-overflow=]' + '-Wshift-overflow=[warn if left shift of a signed value overflows]:level:(1 2)' + '-Wsign-compare[warn about signed-unsigned comparisons]' + '-Wsign-conversion[warn for implicit type conversions between signed and unsigned integers]' + '-Wsign-promo[warn when overload promotes from unsigned to signed]' + '-Wsized-deallocation[warn about missing sized deallocation functions]' + '-Wsizeof-array-argument[warn when sizeof is applied on a parameter declared as an array]' + '-Wsizeof-pointer-memaccess[warn about suspicious length parameters to certain string functions if the argument uses sizeof]' + '-Wstack-protector[warn when not issuing stack smashing protection for some reason]' + '-Wstack-usage=[warn if stack usage might be larger than specified amount]:bytes: ' + '-Wstrict-aliasing[warn about code which might break strict aliasing rules]' + '-Wstrict-aliasing=-[warn about code which might break strict aliasing rules]:level of checking (higher is more accurate):(1 2 3)' + '-Wstrict-null-sentinel[warn about uncasted NULL used as sentinel]' + '-Wstrict-overflow[warn about optimizations that assume that signed overflow is undefined]' + '-Wstrict-overflow=-[warn about optimizations that assume that signed overflow is undefined]:level of checking (higher finds more cases):(1 2 3 4 5)' + '-Wstrict-prototypes[warn about unprototyped function declarations]' + '-Wstrict-selector-match[warn if type signatures of candidate methods do not match exactly]' + '-Wstringop-overflow=[under the control of Object Size type, warn about buffer overflow in string manipulation functions like memcpy and strcpy]:level:(1 2 3 4)' + '-Wstringop-overflow[warn about buffer overflow in string manipulation functions like memcpy and strcpy. Same as -Wstringop-overflow=]' + '-Wsubobject-linkage[warn if a class type has a base or a field whose type uses the anonymous namespace or depends on a type with no linkage]' '*-Wsuggest-attribute=-[warn about functions that might be candidates for attributes]:attribute:(pure const noreturn format)' - '-Wsuggest-final-methods[Warn about C++ virtual methods where adding final keyword would improve code quality]' - '-Wsuggest-final-types[Warn about C++ polymorphic types where adding final keyword would improve code quality]' - '-Wsuggest-override[Suggest that the override keyword be used when the declaration of a virtual function overrides another]' - '-Wsurprising[Warn about "suspicious" constructs]' - '-Wswitch-bool[Warn about switches with boolean controlling expression]' - '-Wswitch-default[Warn about enumerated switches missing a "default-" statement]' - '-Wswitch-enum[Warn about all enumerated switches missing a specific case]' - '-Wswitch-unreachable[Warn about statements between switch'\''s controlling expression and the first case]' - '-Wswitch[Warn about enumerated switches, with no default, missing a case]' - '-Wsync-nand[Warn when __sync_fetch_and_nand and __sync_nand_and_fetch built-in functions are used]' - '-Wsynth[Deprecated. This switch has no effect]' - '-Wsystem-headers[Do not suppress warnings from system headers]' - '-Wtabs[Permit nonconforming uses of the tab character]' - '-Wtarget-lifetime[Warn if the pointer in a pointer assignment might outlive its target]' - '-Wtautological-compare[Warn if a comparison always evaluates to true or false]' - '-Wtemplates[Warn on primary template declaration]' - '-Wterminate[Warn if a throw expression will always result in a call to terminate()]' - '-Wtraditional-conversion[Warn of prototypes causing type conversions different from what would happen in the absence of prototype]' - '-Wtraditional[Warn about features not present in traditional C]' - '-Wtrampolines[Warn whenever a trampoline is generated]' - '-Wtrigraphs[Warn if trigraphs are encountered that might affect the meaning of the program]' - '-Wtype-limits[Warn if a comparison is always true or always false due to the limited range of the data type]' - '-Wundeclared-selector[Warn about @selector()s without previously declared methods]' - '-Wundef[Warn if an undefined macro is used in an #if directive]' - '-Wundefined-do-loop[Warn about an invalid DO loop]' - '-Wunderflow[Warn about underflow of numerical constant expressions]' - '-Wuninitialized[Warn about uninitialized automatic variables]' - '-Wunknown-pragmas[Warn about unrecognized pragmas]' - '-Wunsafe-loop-optimizations[Warn if the loop cannot be optimized due to nontrivial assumptions]' - '-Wunsuffixed-float-constants[Warn about unsuffixed float constants]' - '-Wunused-but-set-parameter[Warn when a function parameter is only set, otherwise unused]' - '-Wunused-but-set-variable[Warn when a variable is only set, otherwise unused]' - '-Wunused-const-variable[Warn when a const variable is unused. Same as -Wunused-const-variable=]' - '-Wunused-dummy-argument[Warn about unused dummy arguments]' - '-Wunused-function[Warn when a function is unused]' - '-Wunused-label[Warn when a label is unused]' - '-Wunused-local-typedefs[Warn when typedefs locally defined in a function are not used]' - '-Wunused-macros[Warn about macros defined in the main file that are not used]' - '-Wunused-parameter[Warn when a function parameter is unused]' - '-Wunused-result[Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value]' - '-Wunused-value[Warn when an expression value is unused]' - '-Wunused-variable[Warn when a variable is unused]' - '-Wunused[Enable all -Wunused- warnings]' - '-Wuse-without-only[Warn about USE statements that have no ONLY qualifier]' - '-Wuseless-cast[Warn about useless casts]' - '-Wvarargs[Warn about questionable usage of the macros used to retrieve variable arguments]' - '-Wvariadic-macros[Warn about using variadic macros]' - '-Wvector-operation-performance[Warn when a vector operation is compiled outside the SIMD]' - '-Wvirtual-inheritance[Warn on direct virtual inheritance]' - '-Wvirtual-move-assign[Warn if a virtual base has a non-trivial move assignment operator]' - '-Wvla[Warn if a variable length array is used]' - '-Wvolatile-register-var[Warn when a register variable is declared volatile]' - '-Wwrite-strings[In C++, nonzero means warn about deprecated conversion from string literals to '\''char *'\''. In C, similar warning, except that the conversion is]' - '-Wzero-as-null-pointer-constant[Warn when a literal '\''0'\'' is used as null pointer]' - '-Wzerotrip[Warn about zero-trip DO loops]' - '-frequire-return-statement[Functions which return values must end with return statements]' -# --help=warnings,joined - '-Wabi=[Warn about things that change between the current -fabi-version and the specified version]:: ' - '-Waligned-new=[Warn even if '\'new\'' uses a class member allocation function]:none|global|all: ' - '-Walloc-size-larger-than=[Warn for calls to allocation functions that attempt to allocate objects larger than the specified number of bytes]:bytes: ' - '-Walloca-larger-than=[Warn on unbounded uses of alloca, and on bounded uses of alloca whose bound can be larger than <number> bytes]:bytes: ' - '-Warray-bounds=[Warn if an array is accessed out of bounds]:level:(1 2)' - '-Wformat-overflow=[Warn about function calls with format strings that write past the end of the destination region]:level:(1 2)' - '-Wformat-truncation=[Warn about calls to snprintf and similar functions that truncate output]:level:(1 2)' - '-Wformat=[Warn about printf/scanf/strftime/strfmon format string anomalies]:level:(1 2)' - '-Wframe-larger-than=[Warn if a function'\''s stack frame requires more than <number> bytes]:bytes: ' - '-Wimplicit-fallthrough=[Warn when a switch case falls through]:level:(1 2 3 4 5)' - '-Wlarger-than=[Warn if an object is larger than <number> bytes]:bytes: ' - '-Wnormalized=-[Warn about non-normalised Unicode strings]:normalization:((id\:allow\ some\ non-nfc\ characters\ that\ are\ valid\ identifiers nfc\:only\ allow\ NFC nfkc\:only\ allow\ NFKC none\:allow\ any\ normalization)): ' - '-Wplacement-new=[Warn for placement new expressions with undefined behavior]:level:(1 2)' - '-Wshift-overflow=[Warn if left shift of a signed value overflows]:level:(1 2)' - '-Wstack-usage=[Warn if stack usage might be larger than specified amount]:bytes: ' - '-Wstrict-aliasing=-[Warn about code which might break strict aliasing rules]:level of checking (higher is more accurate):(1 2 3)' - '-Wstrict-overflow=-[Warn about optimizations that assume that signed overflow is undefined]:level of checking (higher finds more cases):(1 2 3 4 5)' - '-Wstringop-overflow=[Under the control of Object Size type, warn about buffer overflow in string manipulation functions like memcpy and strcpy]:level:(1 2 3 4)' - '-Wunused-const-variable=[Warn when a const variable is unused]:level:(1 2)' - '-Wvla-larger-than=[Warn on unbounded uses of variable-length arrays, and on bounded uses of variable-length arrays whose bound can be larger than <number> bytes]:bytes: ' -# -W options from --help=common,^warnings - '-Werror=-[Treat specified warning as error (or all if none specified)]::warning:->werror' - '-Wfatal-errors[Exit on the first error occurred]' + '-Wsuggest-final-methods[warn about C++ virtual methods where adding final keyword would improve code quality]' + '-Wsuggest-final-types[warn about C++ polymorphic types where adding final keyword would improve code quality]' + '-Wsuggest-override[suggest that the override keyword be used when the declaration of a virtual function overrides another]' + '-Wsurprising[warn about "suspicious" constructs]' + '-Wswitch-bool[warn about switches with boolean controlling expression]' + '-Wswitch-default[warn about enumerated switches missing a "default-" statement]' + '-Wswitch-enum[warn about all enumerated switches missing a specific case]' + '-Wswitch-unreachable[warn about statements between switch'\''s controlling expression and the first case]' + '-Wswitch[warn about enumerated switches, with no default, missing a case]' + '-Wsync-nand[warn when __sync_fetch_and_nand and __sync_nand_and_fetch built-in functions are used]' + '-Wsynth[deprecated. This switch has no effect]' + '-Wsystem-headers[do not suppress warnings from system headers]' + '-Wtabs[permit nonconforming uses of the tab character]' + '-Wtarget-lifetime[warn if the pointer in a pointer assignment might outlive its target]' + '-Wtautological-compare[warn if a comparison always evaluates to true or false]' + '-Wtemplates[warn on primary template declaration]' + '-Wterminate[warn if a throw expression will always result in a call to terminate()]' + '-W[this switch is deprecated; use -Wextra instead]' + '-Wtraditional-conversion[warn of prototypes causing type conversions different from what would happen in the absence of prototype]' + '-Wtraditional[warn about features not present in traditional C]' + '-Wtrampolines[warn whenever a trampoline is generated]' + '-Wtrigraphs[warn if trigraphs are encountered that might affect the meaning of the program]' + '-Wtype-limits[warn if a comparison is always true or always false due to the limited range of the data type]' + '-Wundeclared-selector[warn about @selector()s without previously declared methods]' + '-Wundefined-do-loop[warn about an invalid DO loop]' + '-Wundef[warn if an undefined macro is used in an #if directive]' + '-Wunderflow[warn about underflow of numerical constant expressions]' + '-Wuninitialized[warn about uninitialized automatic variables]' + '-Wunknown-pragmas[warn about unrecognized pragmas]' + '-Wunsafe-loop-optimizations[warn if the loop cannot be optimized due to nontrivial assumptions]' + '-Wunsuffixed-float-constants[warn about unsuffixed float constants]' + '-Wunused-but-set-parameter[warn when a function parameter is only set, otherwise unused]' + '-Wunused-but-set-variable[warn when a variable is only set, otherwise unused]' + '-Wunused-const-variable[warn when a const variable is unused. Same as -Wunused-const-variable=]' + '-Wunused-const-variable=[warn when a const variable is unused]:level:(1 2)' + '-Wunused-dummy-argument[warn about unused dummy arguments]' + '-Wunused[enable all -Wunused- warnings]' + '-Wunused-function[warn when a function is unused]' + '-Wunused-label[warn when a label is unused]' + '-Wunused-local-typedefs[warn when typedefs locally defined in a function are not used]' + '-Wunused-macros[warn about macros defined in the main file that are not used]' + '-Wunused-parameter[warn when a function parameter is unused]' + '-Wunused-result[warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value]' + '-Wunused-value[warn when an expression value is unused]' + '-Wunused-variable[warn when a variable is unused]' + '-Wuseless-cast[warn about useless casts]' + '-Wuse-without-only[warn about USE statements that have no ONLY qualifier]' + '-Wvarargs[warn about questionable usage of the macros used to retrieve variable arguments]' + '-Wvariadic-macros[warn about using variadic macros]' + '-Wvector-operation-performance[warn when a vector operation is compiled outside the SIMD]' + '-Wvirtual-inheritance[warn on direct virtual inheritance]' + '-Wvirtual-move-assign[warn if a virtual base has a non-trivial move assignment operator]' + '-Wvla-larger-than=[warn on unbounded uses of variable-length arrays, and on bounded uses of variable-length arrays whose bound can be larger than <number> bytes]:bytes: ' + '-Wvla[warn if a variable length array is used]' + '-Wvolatile-register-var[warn when a register variable is declared volatile]' + '-Wwrite-strings[in C++, nonzero means warn about deprecated conversion from string literals to '\''char *'\''. In C, similar warning, except that the conversion is]' + '-Wzero-as-null-pointer-constant[warn when a literal '\''0'\'' is used as null pointer]' + '-Wzerotrip[warn about zero-trip DO loops]' ) + # clang specific warnings if [[ "$service" = clang* ]]; then - args+=( - '-Wunreachable-code[Warn on code that will not be executed]' - '-Wunreachable-code-aggressive[Controls -Wunreachable-code, -Wunreachable-code-break, -Wunreachable-code-return]' - '-Wunreachable-code-break[Warn when break will never be executed]' - '-Wunreachable-code-loop-increment[Warn when loop will be executed only once]' - '-Wunreachable-code-return[Warn when return will not be executed]' + warnings+=( + '-Wlarge-by-value-copy=[warn on large by value copy]:argument' + '-Wunreachable-code-aggressive[controls -Wunreachable-code, -Wunreachable-code-break, -Wunreachable-code-return]' + '-Wunreachable-code-break[warn when break will never be executed]' + '-Wunreachable-code-loop-increment[warn when loop will be executed only once]' + '-Wunreachable-code-return[warn when return will not be executed]' + '-Wunreachable-code[warn on code that will not be executed]' ) else - args+=( - '-Wunreachable-code[Does nothing. Preserved for backward compatibility]' + warnings+=( + '-Wunreachable-code[does nothing. Preserved for backward compatibility]' ) fi -# optimizers (from --help=optimizers), except for -O -args+=( -# --help=optimizers,^joined - '-faggressive-loop-optimizations[Aggressively optimize loops using language constraints]' - '-falign-functions[Align the start of functions]' - '-falign-jumps[Align labels which are only reached by jumping]' - '-falign-labels[Align all labels]' - '-falign-loops[Align the start of loops]' - '-fassociative-math[Allow optimization for floating-point arithmetic which may change the result of the operation due to rounding]' - '-fasynchronous-unwind-tables[Generate unwind tables that are exact at each instruction boundary]' - '-fauto-inc-dec[Generate auto-inc/dec instructions]' - '-fbranch-count-reg[Replace add, compare, branch with branch on count register]' - '-fbranch-probabilities[Use profiling information for branch probabilities]' - '-fbranch-target-load-optimize2[Perform branch target load optimization after prologue / epilogue threading]' - '-fbranch-target-load-optimize[Perform branch target load optimization before prologue / epilogue threading]' - '-fbtr-bb-exclusive[Restrict target load migration not to re-use registers in any basic block]' - '-fcaller-saves[Save registers around function calls]' - '-fcode-hoisting[Enable code hoisting]' - '-fcombine-stack-adjustments[Looks for opportunities to reduce stack adjustments and stack references]' - '-fcommon[Do not put uninitialized globals in the common section]' - '-fcompare-elim[Perform comparison elimination after register allocation has finished]' - '-fconserve-stack[Do not perform optimizations increasing noticeably stack usage]' - '-fcprop-registers[Perform a register copy-propagation optimization pass]' - '-fcrossjumping[Perform cross-jumping optimization]' - '-fcse-follow-jumps[When running CSE, follow jumps to their targets]' - '-fcx-fortran-rules[Complex multiplication and division follow Fortran rules]' - '-fcx-limited-range[Omit range reduction step when performing complex division]' - '-fdata-sections[Place data items into their own section]' - '-fdce[Use the RTL dead code elimination pass]' - '-fdefer-pop[Defer popping functions args from stack until later]' - '-fdelayed-branch[Attempt to fill delay slots of branch instructions]' - '-fdelete-dead-exceptions[Delete dead instructions that may throw exceptions]' - '-fdelete-null-pointer-checks[Delete useless null pointer checks]' - '-fdevirtualize-speculatively[Perform speculative devirtualization]' - '-fdevirtualize[Try to convert virtual calls to direct ones]' - '-fdse[Use the RTL dead store elimination pass]' - '-fearly-inlining[Perform early inlining]' - '-fexceptions[Enable exception handling]' - '-fexpensive-optimizations[Perform a number of minor, expensive optimizations]' - '-ffinite-math-only[Assume no NaNs or infinities are generated]' - '-ffloat-store[Don'\''t allocate floats and doubles in extended- precision registers]' - '-fforward-propagate[Perform a forward propagation pass on RTL]' - '-ffp-int-builtin-inexact[Allow built-in functions ceil, floor, round, trunc to raise "inexact" exceptions]' - '-ffunction-cse[Allow function addresses to be held in registers]' - '-fgcse-after-reload[Perform global common subexpression elimination after register allocation has finished]' - '-fgcse-las[Perform redundant load after store elimination in global common subexpression elimination]' - '-fgcse-lm[Perform enhanced load motion during global common subexpression elimination]' - '-fgcse-sm[Perform store motion after global common subexpression elimination]' - '-fgcse[Perform global common subexpression elimination]' - '-fgraphite-identity[Enable Graphite Identity transformation]' - '-fgraphite[Enable in and out of Graphite representation]' - '-fguess-branch-probability[Enable guessing of branch probabilities]' - '-fhoist-adjacent-loads[Enable hoisting adjacent loads to encourage generating conditional move instructions]' - '-fif-conversion2[Perform conversion of conditional jumps to conditional execution]' - '-fif-conversion[Perform conversion of conditional jumps to branchless equivalents]' - '-findirect-inlining[Perform indirect inlining]' - '-finline-atomics[Inline __atomic operations when a lock free instruction sequence is available]' - '-finline-functions-called-once[Integrate functions only required by their single caller]' - '-finline-functions[Integrate functions not declared "inline" into their callers when profitable]' - '-finline-small-functions[Integrate functions into their callers when code size is known not to grow]' - '-finline[Enable inlining of function declared "inline", disabling disables all inlining]' - '-fipa-bit-cp[Perform interprocedural bitwise constant propagation]' - '-fipa-cp-clone[Perform cloning to make Interprocedural constant propagation stronger]' - '-fipa-cp[Perform interprocedural constant propagation]' - '-fipa-icf-functions[Perform Identical Code Folding for functions]' - '-fipa-icf-variables[Perform Identical Code Folding for variables]' - '-fipa-icf[Perform Identical Code Folding for functions and read-only variables]' - '-fipa-profile[Perform interprocedural profile propagation]' - '-fipa-pta[Perform interprocedural points-to analysis]' - '-fipa-pure-const[Discover pure and const functions]' - '-fipa-ra[Use caller save register across calls if possible]' - '-fipa-reference[Discover readonly and non addressable static variables]' - '-fipa-sra[Perform interprocedural reduction of aggregates]' - '-fipa-vrp[Perform IPA Value Range Propagation]' - '-fira-hoist-pressure[Use IRA based register pressure calculation in RTL hoist optimizations]' - '-fira-loop-pressure[Use IRA based register pressure calculation in RTL loop optimizations]' - '-fira-share-save-slots[Share slots for saving different hard registers]' - '-fira-share-spill-slots[Share stack slots for spilled pseudo-registers]' - '-fisolate-erroneous-paths-attribute[Detect paths that trigger erroneous or undefined behavior due to a null value being used in a way forbidden by a returns_nonnull or]' - '-fisolate-erroneous-paths-dereference[Detect paths that trigger erroneous or undefined behavior due to dereferencing a null pointer. Isolate those paths from the main]' - '-fivopts[Optimize induction variables on trees]' - '-fjump-tables[Use jump tables for sufficiently large switch statements]' - '-flifetime-dse[Tell DSE that the storage for a C++ object is dead when the constructor starts and when the destructor finishes]' - '-flive-range-shrinkage[Relief of register pressure through live range shrinkage]' - '-floop-nest-optimize[Enable the loop nest optimizer]' - '-floop-parallelize-all[Mark all loops as parallel]' - '-flra-remat[Do CFG-sensitive rematerialization in LRA]' - '-fmath-errno[Set errno after built-in math functions]' - '-fmerge-all-constants[Attempt to merge identical constants and constant variables]' - '-fmerge-constants[Attempt to merge identical constants across compilation units]' - '-fmodulo-sched-allow-regmoves[Perform SMS based modulo scheduling with register moves allowed]' - '-fmodulo-sched[Perform SMS based modulo scheduling before the first scheduling pass]' - '-fmove-loop-invariants[Move loop invariant computations out of loops]' - '-fno-threadsafe-statics[Do not generate thread-safe code for initializing local statics]' - '-fnon-call-exceptions[Support synchronous non-call exceptions]' - '-fnothrow-opt[Treat a throw() exception specification as noexcept to improve code size]' - '-fomit-frame-pointer[When possible do not generate stack frames]' - '-fopt-info[Enable all optimization info dumps on stderr]' - '-foptimize-sibling-calls[Optimize sibling and tail recursive calls]' - '-foptimize-strlen[Enable string length optimizations on trees]' - '-fpack-struct[Pack structure members together without holes]' - '-fpartial-inlining[Perform partial inlining]' - '-fpeel-loops[Perform loop peeling]' - '-fpeephole2[Enable an RTL peephole pass before sched2]' - '-fpeephole[Enable machine specific peephole optimizations]' - '-fplt[Use PLT for PIC calls (-fno-plt- load the address from GOT at call site)]' - '-fpredictive-commoning[Run predictive commoning optimization]' - '-fprefetch-loop-arrays[Generate prefetch instructions, if available, for arrays in loops]' - '-fprintf-return-value[Treat known sprintf return values as constants]' - '-freciprocal-math[Same as -fassociative-math for expressions which include division]' - '-freg-struct-return[Return small aggregates in registers]' - '-frename-registers[Perform a register renaming optimization pass]' - '-freorder-blocks-and-partition[Reorder basic blocks and partition into hot and cold sections]' - '-freorder-blocks[Reorder basic blocks to improve code placement]' - '-freorder-functions[Reorder functions to improve code placement]' - '-frerun-cse-after-loop[Add a common subexpression elimination pass after loop optimizations]' - '-freschedule-modulo-scheduled-loops[Enable/Disable the traditional scheduling in loops that already passed modulo scheduling]' - '-frounding-math[Disable optimizations that assume default FP rounding behavior]' - '-frtti[Generate run time type descriptor information]' - '-fsched-critical-path-heuristic[Enable the critical path heuristic in the scheduler]' - '-fsched-dep-count-heuristic[Enable the dependent count heuristic in the scheduler]' - '-fsched-group-heuristic[Enable the group heuristic in the scheduler]' - '-fsched-interblock[Enable scheduling across basic blocks]' - '-fsched-last-insn-heuristic[Enable the last instruction heuristic in the scheduler]' - '-fsched-pressure[Enable register pressure sensitive insn scheduling]' - '-fsched-rank-heuristic[Enable the rank heuristic in the scheduler]' - '-fsched-spec-insn-heuristic[Enable the speculative instruction heuristic in the scheduler]' - '-fsched-spec-load-dangerous[Allow speculative motion of more loads]' - '-fsched-spec-load[Allow speculative motion of some loads]' - '-fsched-spec[Allow speculative motion of non-loads]' - '-fsched-stalled-insns-dep[Set dependence distance checking in premature scheduling of queued insns]' - '-fsched-stalled-insns[Allow premature scheduling of queued insns]' - '-fsched2-use-superblocks[If scheduling post reload, do superblock scheduling]' - '-fschedule-fusion[Perform a target dependent instruction fusion optimization pass]' - '-fschedule-insns2[Reschedule instructions after register allocation]' - '-fschedule-insns[Reschedule instructions before register allocation]' - '-fsection-anchors[Access data in the same section from shared anchor points]' - '-fsel-sched-pipelining-outer-loops[Perform software pipelining of outer loops during selective scheduling]' - '-fsel-sched-pipelining[Perform software pipelining of inner loops during selective scheduling]' - '-fsel-sched-reschedule-pipelined[Reschedule pipelined regions without pipelining]' - '-fselective-scheduling2[Run selective scheduling after reload]' - '-fselective-scheduling[Schedule instructions using selective scheduling algorithm]' - '-fshort-enums[Use the narrowest integer type possible for enumeration types]' - '-fshort-wchar[Force the underlying type for "wchar_t" to be "unsigned short"]' - '-fshrink-wrap-separate[Shrink-wrap parts of the prologue and epilogue separately]' - '-fshrink-wrap[Emit function prologues only before parts of the function that need it, rather than at the top of the function]' - '-fsignaling-nans[Disable optimizations observable by IEEE signaling NaNs]' - '-fsigned-zeros[Disable floating point optimizations that ignore the IEEE signedness of zero]' - '-fsingle-precision-constant[Convert floating point constants to single precision constants]' - '-fsplit-ivs-in-unroller[Split lifetimes of induction variables when loops are unrolled]' - '-fsplit-loops[Perform loop splitting]' - '-fsplit-paths[Split paths leading to loop backedges]' - '-fsplit-wide-types[Split wide types into independent registers]' - '-fssa-backprop[Enable backward propagation of use properties at the SSA level]' - '-fssa-phiopt[Optimize conditional patterns using SSA PHI nodes]' - '-fstack-protector-all[Use a stack protection method for every function]' - '-fstack-protector-explicit[Use stack protection method only for functions with the stack_protect attribute]' - '-fstack-protector-strong[Use a smart stack protection method for certain functions]' - '-fstack-protector[Use propolice as a stack protection method]' - '-fstdarg-opt[Optimize amount of stdarg registers saved to stack at start of function]' - '-fstore-merging[Merge adjacent stores]' - '-fstrict-aliasing[Assume strict aliasing rules apply]' - '-fstrict-enums[Assume that values of enumeration type are always within the minimum range of that type]' - '-fstrict-overflow[Treat signed overflow as undefined]' - '-fstrict-volatile-bitfields[Force bitfield accesses to match their type width]' - '-fthread-jumps[Perform jump threading optimizations]' - '-ftracer[Perform superblock formation via tail duplication]' - '-ftrapping-math[Assume floating-point operations can trap]' - '-ftrapv[Trap for signed overflow in addition, subtraction and multiplication]' - '-ftree-bit-ccp[Enable SSA-BIT-CCP optimization on trees]' - '-ftree-builtin-call-dce[Enable conditional dead code elimination for builtin calls]' - '-ftree-ccp[Enable SSA-CCP optimization on trees]' - '-ftree-ch[Enable loop header copying on trees]' - '-ftree-coalesce-vars[Enable SSA coalescing of user variables]' - '-ftree-copy-prop[Enable copy propagation on trees]' - '-ftree-cselim[Transform condition stores into unconditional ones]' - '-ftree-dce[Enable SSA dead code elimination optimization on trees]' - '-ftree-dominator-opts[Enable dominator optimizations]' - '-ftree-dse[Enable dead store elimination]' - '-ftree-forwprop[Enable forward propagation on trees]' - '-ftree-fre[Enable Full Redundancy Elimination (FRE) on trees]' - '-ftree-loop-distribute-patterns[Enable loop distribution for patterns transformed into a library call]' - '-ftree-loop-distribution[Enable loop distribution on trees]' - '-ftree-loop-if-convert[Convert conditional jumps in innermost loops to branchless equivalents]' - '-ftree-loop-im[Enable loop invariant motion on trees]' - '-ftree-loop-ivcanon[Create canonical induction variables in loops]' - '-ftree-loop-optimize[Enable loop optimizations on tree level]' - '-ftree-loop-vectorize[Enable loop vectorization on trees]' - '-ftree-lrs[Perform live range splitting during the SSA- >normal pass]' - '-ftree-partial-pre[In SSA-PRE optimization on trees, enable partial- partial redundancy elimination]' - '-ftree-phiprop[Enable hoisting loads from conditional pointers]' - '-ftree-pre[Enable SSA-PRE optimization on trees]' - '-ftree-pta[Perform function-local points-to analysis on trees]' - '-ftree-reassoc[Enable reassociation on tree level]' - '-ftree-scev-cprop[Enable copy propagation of scalar-evolution information]' - '-ftree-sink[Enable SSA code sinking on trees]' - '-ftree-slp-vectorize[Enable basic block vectorization (SLP) on trees]' - '-ftree-slsr[Perform straight-line strength reduction]' - '-ftree-sra[Perform scalar replacement of aggregates]' - '-ftree-switch-conversion[Perform conversions of switch initializations]' - '-ftree-tail-merge[Enable tail merging on trees]' - '-ftree-ter[Replace temporary expressions in the SSA->normal pass]' - '-ftree-vectorize[Enable vectorization on trees]' - '-ftree-vrp[Perform Value Range Propagation on trees]' - '-funconstrained-commons[Assume common declarations may be overridden with ones with a larger trailing array]' - '-funroll-all-loops[Perform loop unrolling for all loops]' - '-funroll-loops[Perform loop unrolling when iteration count is known]' - '-funsafe-loop-optimizations[Allow loop optimizations to assume that the loops behave in normal way]' - '-funsafe-math-optimizations[Allow math optimizations that may violate IEEE or ISO standards]' - '-funswitch-loops[Perform loop unswitching]' - '-funwind-tables[Just generate unwind tables for exception handling]' - '-fvar-tracking-assignments-toggle[Toggle -fvar-tracking-assignments]' - '-fvar-tracking-assignments[Perform variable tracking by annotating assignments]' - '-fvar-tracking-uninit[Perform variable tracking and also tag variables that are uninitialized]' - '-fvar-tracking[Perform variable tracking]' - '-fvariable-expansion-in-unroller[Apply variable expansion when loops are unrolled]' - '-fvpt[Use expression value profiles in optimizations]' - '-fweb[Construct webs and split unrelated uses of single variable]' - '-fwhole-program[Perform whole program optimizations]' - '-fwrapv[Assume signed arithmetic overflow wraps around]' -# --help=optimizers,joined - '-ffp-contract=[Perform floating-point expression contraction]:style:(off on fast)' - '-fira-algorithm=[Set the used IRA algorithm]:algorithm:(cb priority)' - '-fira-region=[Set regions for IRA]:region:(one all mixed)' - '-fpack-struct=[Set initial maximum structure member alignment]:alignment (power of 2): ' - '-freorder-blocks-algorithm=[Set the used basic block reordering algorithm]:algorithm:(simple stc)' - '-fsched-stalled-insns-dep=[Set dependence distance checking in premature scheduling of queued insns]:insns:' - '-fsched-stalled-insns=[Set number of queued insns that can be prematurely scheduled]:insns:' - '-fsimd-cost-model=[Specifies the vectorization cost model for code marked with a simd directive]:model:(unlimited dynamic cheap)' - '-fstack-reuse=[Set stack reuse level for local variables]:level:(all named_vars none)' - '-ftree-parallelize-loops=[Enable automatic parallelization of loops]' - '-fvect-cost-model=[Specifies the cost model for vectorization]:model:(unlimited dynamic cheap)' - -) -# More linker options, from gcc man pages args+=( - '-nostartfiles[Do not use the standard system startup files when linking]' - '-nodefaultlibs[Do not use the standard system libraries when linking]' - '-nostdlib[Do not use standard system startup files or libraries when linking]' - '-rdynamic[Pass the flag -export-dynamic to the ELF linker, on targets that support it]' - '-s[Remove all symbol table and relocation information from the executable]' - '-static[On systems that support dynamic linking, this prevents linking with the shared libraries]' - '-shared-libgcc[Force shared libgcc]' - '-static-libgcc[Force static libgcc]' - '-symbolic[Bind references to global symbols when building a shared object]' - '-T:linker script:_files' + {'*-A-','*--assert='}'[make an assertion]:define assertion:' + '--all-warnings[display all warnings]' + {-ansi,--ansi}'[same as -std=c89 or -std=c++98]' + '-aux-info[emit declaration information into <file>]:file:_files' + {'-B-','--prefix='}'[add <prefix> to the compiler'\''s search paths]:executable prefix:_files -/' + '-b[specify target machine to compile to]:target machine:' + {-CC,--comments-in-macros}'[do not discard comments, including macro expansion]' + {-C,--comments}'[do not discard comments during preprocess]' + {-c,--compile}'[compile and assemble, but do not link]' + {'*-D-','*--define-macro='}'[define a macro]:define macro:' + '-d-[dump the state of the preprocessor]:dump:->dump' + '--dependencies[generate Makefile dependencies]' + '-dumpbase[set the file basename to be used for dumps]:file:_files' + '-dumpdir[set the directory name to be used for dumps]:file:_files -/' + '-dumpmachine[display the compiler'\''s target processor]' + '-dumpspecs[display all of the built in spec strings]' + '-dumpversion[display the version of the compiler]' + '+e-[control how virtual function definitions are used]:virtual function definitions in classes:((0\:only\ interface 1\:generate\ code))' + {-e,--entry}'[specify program entry point is entry]:entry' + {-E,--preprocess}'[preprocess only; do not compile, assemble or link]' + '-fabi-version=-[use version <n> of the C++ ABI (default: 2)]:ABI version:(1 2 3 4 5 6)' + '-fada-spec-parent=[dump Ada specs as child units of given parent]' + '-faggressive-loop-optimizations[aggressively optimize loops using language constraints]' + '-falign-functions[align the start of functions]' + '-falign-jumps[align labels which are only reached by jumping]' + '-falign-labels[align all labels]' + '-falign-loops[align the start of loops]' + '-fallow-parameterless-variadic-functions[allow variadic functions without named parameter]' + '-fasm[recognize the asm keyword]' + '-fassociative-math[allow optimization for floating-point arithmetic which may change the result of the operation due to rounding]' + '-fasynchronous-unwind-tables[generate unwind tables that are exact at each instruction boundary]' + '-fauto-inc-dec[generate auto-inc/dec instructions]' + '-fbounds-check[generate code to check bounds before indexing arrays]' + '-fbranch-count-reg[replace add, compare, branch with branch on count register]' + '-fbranch-probabilities[use profiling information for branch probabilities]' + '-fbranch-target-load-optimize2[perform branch target load optimization after prologue / epilogue threading]' + '-fbranch-target-load-optimize[perform branch target load optimization before prologue / epilogue threading]' + '-fbtr-bb-exclusive[restrict target load migration not to re-use registers in any basic block]' + '-fbuilding-libgcc[specify building libgcc]' + '-fbuiltin[recognize builtin functions]' + '-fcaller-saves[save registers around function calls]' + '-fcall-saved--[mark <register> as being preserved across functions]:register' + '-fcall-used--[mark <register> as being corrupted by function calls]:register' + '-fcanonical-system-headers[where shorter use canonicalized paths to system headers]' + '-fcheck-data-deps[compare the results of several data dependence analyzers]' + '-fcheck-pointer-bounds[add pointer bounds checker instrumentation]' + '-fchkp-check-incomplete-type[generate pointer bounds check for variables with incomplete type]' + '-fchkp-check-read[generate checks for all read accesses to memory]' + '-fchkp-check-write[generate checks for all write accesses to memory]' + '-fchkp-first-field-has-own-bounds[forces checker to use narrowed bounds for address of the first field]' + '-fchkp-instrument-calls[generate bounds passing for calls]' + '-fchkp-instrument-marked-only[instrument only functions marked with bnd_instrument attribute]' + '-fchkp-narrow-bounds[control how checker handle pointers to object fields]' + '-fchkp-narrow-to-innermost-array[forces checker to use bounds of the innermost arrays in case of nested static array access]' + '-fchkp-optimize[allow checker optimizations]' + '-fchkp-store-bounds[generate bounds stores for pointer writes]' + '-fchkp-treat-zero-dynamic-size-as-infinite[with this option zero size obtained dynamically for objects with incomplete type will be treated as infinite]' + '-fchkp-use-fast-string-functions[allow to use *_nobnd versions of string functions]' + '-fchkp-use-nochk-string-functions[allow to use *_nochk versions of string functions]' + '-fchkp-use-static-bounds[use statically initialized variable for vars bounds instead of generating them each time it is required]' + '-fchkp-use-static-const-bounds[use statically initialized variable for constant bounds]' + '-fchkp-use-wrappers[transform instrumented builtin calls into calls to wrappers]' + '-fchkp-zero-input-bounds-for-main[use zero bounds for all incoming arguments in main function]' + '-fcilkplus[enable Cilk Plus]' + '-fcode-hoisting[enable code hoisting]' + '-fcombine-stack-adjustments[looks for opportunities to reduce stack adjustments and stack references]' + '-fcommon[do not put uninitialized globals in the common section]' + '-fcompare-debug=-[compile with and without e.g. -gtoggle, and compare the final-insns dump]:opts:' # TODO: complete gcc options here + '-fcompare-debug-second[run only the second compilation of -fcompare-debug]' + '-fcompare-elim[perform comparison elimination after register allocation has finished]' + '-fcond-mismatch[allow the arguments of the ? operator to have different types]' + '-fconserve-stack[do not perform optimizations increasing noticeably stack usage]' + '-fcprop-registers[perform a register copy-propagation optimization pass]' + '-fcrossjumping[perform cross-jumping optimization]' + '-fcse-follow-jumps[when running CSE, follow jumps to their targets]' + '-fcx-fortran-rules[complex multiplication and division follow Fortran rules]' + '-fcx-limited-range[omit range reduction step when performing complex division]' + '-fdata-sections[place data items into their own section]' + '-fdbg-cnt=-[,<counter>-<limit>,...) Set the debug counter limit]:counter\:limit,...: ' # TODO: gcc -fdbg-cnt-list -x c /dev/null -o /dev/null -c + '-fdbg-cnt-list[list all available debugging counters with their limits and counts]' + '-fdce[use the RTL dead code elimination pass]' + '-fdebug-cpp[emit debug annotations during preprocessing]' + '-fdebug-prefix-map=-[map one directory name to another in debug information]:/old/dir=/new/dir:->dirtodir' + '-fdebug-types-section[output .debug_types section when using DWARF v4 debuginfo]' + '-fdefer-pop[defer popping functions args from stack until later]' + '-fdelayed-branch[attempt to fill delay slots of branch instructions]' + '-fdelete-dead-exceptions[delete dead instructions that may throw exceptions]' + '-fdelete-null-pointer-checks[delete useless null pointer checks]' + '-fdevirtualize-speculatively[perform speculative devirtualization]' + '-fdevirtualize[try to convert virtual calls to direct ones]' + '-fdiagnostics-color=-[colorize diagnostics]::color:(never always auto)' + '-fdiagnostics-generate-patch[print fix-it hints to stderr in unified diff format]' + '-fdiagnostics-parseable-fixits[print fixit hints in machine-readable form]' + '-fdiagnostics-show-caret[show the source line with a caret indicating the column]' + '-fdiagnostics-show-location=-[how often to emit source location at the beginning of line-wrapped diagnostics]:source location:(once every-line)' + '-fdiagnostics-show-option[amend appropriate diagnostic messages with the command line option that controls them]' + '-fdirectives-only[preprocess directives only]' + '-fdollars-in-identifiers[permit $ as an identifier character]' + '-fdse[use the RTL dead store elimination pass]' + '-fdump-ada-spec-slim[write all declarations as Ada code for the given file only]' + '-fdump-ada-spec[write all declarations as Ada code transitively]' + '-fdump-final-insns=-[dump to filename the insns at the end of translation]:filename:_files' + '-fdump-go-spec=-[write all declarations to file as Go code]:filename:_files' + '-fdump-noaddr[suppress output of addresses in debugging dumps]' + '-fdump-passes[dump optimization passes]' + '-fdump-unnumbered-links[suppress output of previous and next insn numbers in debugging dumps]' + '-fdump-unnumbered[suppress output of instruction numbers, line number notes and addresses in debugging dumps]' + '-fdwarf2-cfi-asm[enable CFI tables via GAS assembler directives]' + '-fearly-inlining[perform early inlining]' + '-feliminate-dwarf2-dups[perform DWARF2 duplicate elimination]' + '-feliminate-unused-debug-symbols[perform unused type elimination in debug info]' + '-feliminate-unused-debug-types[perform unused type elimination in debug info]' + '-femit-class-debug-always[do not suppress C++ class debug information]' + '-femit-struct-debug-baseonly[aggressive reduced debug info for structs]' + '-femit-struct-debug-detailed=[detailed reduced debug info for structs]:spec list' + '-femit-struct-debug-reduced[conservative reduced debug info for structs]' + '-fexceptions[enable exception handling]' + '-fexcess-precision=-[specify handling of excess floating-point precision]:precision handling:(fast standard)' + '-fexec-charset=[convert all strings and character constants to character set]:character set' + '-fexpensive-optimizations[perform a number of minor, expensive optimizations]' + '-fextended-identifiers[permit universal character names in identifiers]' + '-ffast-math[sets -fno-math-errno, -funsafe-math-optimizations, -ffinite-math-only, -fno-rounding-math, -fno-signaling-nans and -fcx-limited-range]' + '-ffat-lto-objects[output lto objects containing both the intermediate language and binary output]' + '-ffinite-math-only[assume no NaNs or infinities are generated]' + '-ffixed--[mark <register> as being unavailable to the compiler]:register' + '-ffloat-store[don'\''t allocate floats and doubles in extended- precision registers]' + '-fforward-propagate[perform a forward propagation pass on RTL]' + '-ffp-contract=-[perform floating- point expression contraction (default: fast)]:style:(on off fast)' + '-ffp-contract=[perform floating-point expression contraction]:style:(off on fast)' + '-ffp-int-builtin-inexact[allow built-in functions ceil, floor, round, trunc to raise "inexact" exceptions]' + '-ffreestanding[do not assume that standard C libraries and main exist]' + '-ffunction-cse[allow function addresses to be held in registers]' + '-ffunction-sections[place each function into its own section]' + '-fgcse-after-reload[perform global common subexpression elimination after register allocation has finished]' + '-fgcse-las[perform redundant load after store elimination in global common subexpression elimination]' + '-fgcse-lm[perform enhanced load motion during global common subexpression elimination]' + '-fgcse[perform global common subexpression elimination]' + '-fgcse-sm[perform store motion after global common subexpression elimination]' + '-fgnu89-inline[use traditional GNU semantics for inline functions]' + '-fgnu-tm[enable support for GNU transactional memory]' + '-fgraphite[enable in and out of Graphite representation]' + '-fgraphite-identity[enable Graphite Identity transformation]' + '-fguess-branch-probability[enable guessing of branch probabilities]' + '-fhoist-adjacent-loads[enable hoisting adjacent loads to encourage generating conditional move instructions]' + '-fhosted[assume normal C execution environment]' + '-fif-conversion2[perform conversion of conditional jumps to conditional execution]' + '-fif-conversion[perform conversion of conditional jumps to branchless equivalents]' + '-findirect-inlining[perform indirect inlining]' + '-finhibit-size-directive[do not generate .size directives]' + '-finline-atomics[inline __atomic operations when a lock free instruction sequence is available]' + '-finline[enable inlining of function declared "inline", disabling disables all inlining]' + '-finline-functions-called-once[integrate functions only required by their single caller]' + '-finline-functions[integrate functions not declared "inline" into their callers when profitable]' + '-finline-limit=-[limit the size of inlined functions to <number>]:number: ' + '-finline-small-functions[integrate functions into their callers when code size is known not to grow]' + '-finput-charset=[specify the default character set for source files]:character set' + '-finstrument-functions-exclude-file-list=-[do not instrument functions listed in files]:comma-separated file list:->commafiles' + '-finstrument-functions-exclude-function-list=-[do not instrument listed functions]:comma-separated list of syms: ' + '-finstrument-functions[instrument function entry and exit with profiling calls]' + '-fipa-bit-cp[perform interprocedural bitwise constant propagation]' + '-fipa-cp-clone[perform cloning to make Interprocedural constant propagation stronger]' + '-fipa-cp[perform interprocedural constant propagation]' + '-fipa-icf-functions[perform Identical Code Folding for functions]' + '-fipa-icf[perform Identical Code Folding for functions and read-only variables]' + '-fipa-icf-variables[perform Identical Code Folding for variables]' + '-fipa-profile[perform interprocedural profile propagation]' + '-fipa-pta[perform interprocedural points-to analysis]' + '-fipa-pure-const[discover pure and const functions]' + '-fipa-ra[use caller save register across calls if possible]' + '-fipa-reference[discover readonly and non addressable static variables]' + '-fipa-sra[perform interprocedural reduction of aggregates]' + '-fipa-vrp[perform IPA Value Range Propagation]' + '-fira-algorithm=[set the used IRA algorithm]:algorithm:(cb priority)' + '-fira-hoist-pressure[use IRA based register pressure calculation in RTL hoist optimizations]' + '-fira-loop-pressure[use IRA based register pressure calculation in RTL loop optimizations]' + '-fira-region=-[set regions for IRA]:region:(all mixed one)' + '-fira-region=[set regions for IRA]:region:(one all mixed)' + '-fira-share-save-slots[share slots for saving different hard registers]' + '-fira-share-spill-slots[share stack slots for spilled pseudo-registers]' + '-fira-verbose=-[control IRA'\''s level of diagnostic messages]:verbosity: ' + '-fisolate-erroneous-paths-attribute[detect paths that trigger erroneous or undefined behavior due to a null value being used in a way forbidden by a returns_nonnull or]' + '-fisolate-erroneous-paths-dereference[detect paths that trigger erroneous or undefined behavior due to dereferencing a null pointer. Isolate those paths from the main]' + '-fivopts[optimize induction variables on trees]' + '-fjump-tables[use jump tables for sufficiently large switch statements]' + '-fkeep-inline-functions[generate code for functions even if they are fully inlined]' + '-fkeep-static-consts[emit static const variables even if they are not used]' + '-flax-vector-conversions[allow implicit conversions between vectors with differing numbers of subparts and/or differing element types]' + '-fleading-underscore[give external symbols a leading underscore]' + '-flifetime-dse[tell DSE that the storage for a C++ object is dead when the constructor starts and when the destructor finishes]' + '-flive-range-shrinkage[relief of register pressure through live range shrinkage]' + '-floop-nest-optimize[enable the loop nest optimizer]' + '-floop-parallelize-all[mark all loops as parallel]' + '-flra-remat[do CFG-sensitive rematerialization in LRA]' + '-flto-compression-level=-[use specified zlib compression level for IL]:compression level: ' + '-flto-odr-type-merging[merge C++ types using One Definition Rule]' + '-flto-partition=-[partition symbols and vars at linktime based on object files they originate from]:partitioning algorithm:(1to1 balanced max one none)' + '-flto-report[report various link-time optimization statistics]' + '-fmath-errno[set errno after built-in math functions]' + '-fmax-errors=-[maximum number of errors to report]:errors: ' + '-fmem-report[report on permanent memory allocation]' + '-fmem-report-wpa[report on permanent memory allocation in WPA only]' + '-fmerge-all-constants[attempt to merge identical constants and constant variables]' + '-fmerge-constants[attempt to merge identical constants across compilation units]' + '-fmerge-debug-strings[attempt to merge identical debug strings across compilation units]' + '-fmessage-length=-[limit diagnostics to <number> characters per line. 0 suppresses line-wrapping]:length: ' + '-fmodulo-sched-allow-regmoves[perform SMS based modulo scheduling with register moves allowed]' + '-fmodulo-sched[perform SMS based modulo scheduling before the first scheduling pass]' + '-fmove-loop-invariants[move loop invariant computations out of loops]' + "-fms-extensions[don't warn about uses of Microsoft extensions]" + '-fmudflapir[this switch lacks documentation]' + '-fmudflap[this switch lacks documentation]' + '-fmudflapth[this switch lacks documentation]' + '-fnon-call-exceptions[support synchronous non-call exceptions]' + '-fno-stack-limit[do not limit the size of the stack]' + '-fno-threadsafe-statics[do not generate thread-safe code for initializing local statics]' + '-fnothrow-opt[treat a throw() exception specification as noexcept to improve code size]' + '-fomit-frame-pointer[when possible do not generate stack frames]' + '-fopenacc[enable OpenACC]' + '-fopenmp[enable OpenMP (implies -frecursive in Fortran)]' + "-fopenmp-simd[enable OpenMP's SIMD directives]" + '-foptimize-sibling-calls[optimize sibling and tail recursive calls]' + '-foptimize-strlen[enable string length optimizations on trees]' + '-fopt-info[enable all optimization info dumps on stderr]' + '-fopt-info-type=-[dump compiler optimization details]:filename:_files' + '-fpack-struct[pack structure members together without holes]' + '-fpack-struct=[set initial maximum structure member alignment]:alignment (power of 2): ' + '-fpartial-inlining[perform partial inlining]' + '-fpcc-struct-return[return small aggregates in memory, not registers]' + '-fpch-deps[this switch lacks documentation]' + '-fpch-preprocess[look for and use PCH files even when preprocessing]' + '-fpeel-loops[perform loop peeling]' + '-fpeephole2[enable an RTL peephole pass before sched2]' + '-fpeephole[enable machine specific peephole optimizations]' + '-fPIC[generate position-independent code if possible (large mode)]' + '-fpic[generate position-independent code if possible (small mode)]' + '-fPIE[generate position-independent code for executables if possible (large mode)]' + '-fpie[generate position-independent code for executables if possible (small mode)]' + '-fplan9-extensions[enable Plan 9 language extensions]' + '-fplt[use PLT for PIC calls (-fno-plt- load the address from GOT at call site)]' + '-fplugin-arg--[specify argument <key>=<value> for plugin <name>]:-fplugin-arg-name-key=value: ' #TODO + '-fplugin=-[specify a plugin to load]:plugin: ' # TODO: complete plugins? + '-fpost-ipa-mem-report[report on memory allocation before interprocedural optimization]' + '-fpredictive-commoning[run predictive commoning optimization]' + '-fprefetch-loop-arrays[generate prefetch instructions, if available, for arrays in loops]' + '-fpre-ipa-mem-report[report on memory allocation before interprocedural optimization]' + '-fpreprocessed[treat the input file as already preprocessed]' + '-fprintf-return-value[treat known sprintf return values as constants]' + '-fprofile-arcs[insert arc-based program profiling code]' + '-fprofile-correction[enable correction of flow inconsistent profile data input]' + '-fprofile-dir=-[set the top-level directory for storing the profile data]:profile directory:_files -/' + '-fprofile[enable basic program profiling code]' + '-fprofile-generate[enable common options for generating profile info for profile feedback directed optimizations]' + '-fprofile-report[report on consistency of profile]' + '-fprofile-use[enable common options for performing profile feedback directed optimizations]' + '-fprofile-values[insert code to profile values of expressions]' + '-frandom-seed=-[use <string> as random seed]:seed: ' + '-freciprocal-math[same as -fassociative-math for expressions which include division]' + '-frecord-gcc-switches[record gcc command line switches in the object file]' + '-free[turn on Redundant Extensions Elimination pass]' + '-freg-struct-return[return small aggregates in registers]' + '-frename-registers[perform a register renaming optimization pass]' + '-freorder-blocks-algorithm=[set the used basic block reordering algorithm]:algorithm:(simple stc)' + '-freorder-blocks-and-partition[reorder basic blocks and partition into hot and cold sections]' + '-freorder-blocks[reorder basic blocks to improve code placement]' + '-freorder-functions[reorder functions to improve code placement]' + '-frequire-return-statement[functions which return values must end with return statements]' + '-frerun-cse-after-loop[add a common subexpression elimination pass after loop optimizations]' + '-freschedule-modulo-scheduled-loops[enable/disable the traditional scheduling in loops that already passed modulo scheduling]' + '-frounding-math[disable optimizations that assume default FP rounding behavior]' + '-frtti[generate run time type descriptor information]' + "-fsanitize=-[enable AddressSanitizer, a memory error detector]:style:($sanitizers)" + '-fsched2-use-superblocks[if scheduling post reload, do superblock scheduling]' + '-fsched-critical-path-heuristic[enable the critical path heuristic in the scheduler]' + '-fsched-dep-count-heuristic[enable the dependent count heuristic in the scheduler]' + '-fsched-group-heuristic[enable the group heuristic in the scheduler]' + '-fsched-interblock[enable scheduling across basic blocks]' + '-fsched-last-insn-heuristic[enable the last instruction heuristic in the scheduler]' + '-fsched-pressure[enable register pressure sensitive insn scheduling]' + '-fsched-rank-heuristic[enable the rank heuristic in the scheduler]' + '-fsched-spec[allow speculative motion of non-loads]' + '-fsched-spec-insn-heuristic[enable the speculative instruction heuristic in the scheduler]' + '-fsched-spec-load[allow speculative motion of some loads]' + '-fsched-spec-load-dangerous[allow speculative motion of more loads]' + '-fsched-stalled-insns[allow premature scheduling of queued insns]' + '-fsched-stalled-insns-dep[set dependence distance checking in premature scheduling of queued insns]' + '-fsched-stalled-insns-dep=[set dependence distance checking in premature scheduling of queued insns]:insns:' + '-fsched-stalled-insns-dep=-[set dependence distance checking in premature scheduling of queued insns]:instructions: ' + '-fsched-stalled-insns=[set number of queued insns that can be prematurely scheduled]:insns:' + '-fsched-stalled-insns=-[set number of queued insns that can be prematurely scheduled]:instructions: ' + '-fschedule-fusion[perform a target dependent instruction fusion optimization pass]' + '-fschedule-insns2[reschedule instructions after register allocation]' + '-fschedule-insns[reschedule instructions before register allocation]' + '-fsched-verbose=-[set the verbosity level of the scheduler]:verbosity: ' + '-fsection-anchors[access data in the same section from shared anchor points]' + '-fselective-scheduling2[run selective scheduling after reload]' + '-fselective-scheduling[schedule instructions using selective scheduling algorithm]' + '-fsel-sched-pipelining-outer-loops[perform software pipelining of outer loops during selective scheduling]' + '-fsel-sched-pipelining[perform software pipelining of inner loops during selective scheduling]' + '-fsel-sched-reschedule-pipelined[reschedule pipelined regions without pipelining]' + '-fshort-double[use the same size for double as for float]' + '-fshort-enums[use the narrowest integer type possible for enumeration types]' + '-fshort-wchar[force the underlying type for "wchar_t" to be "unsigned short"]' + '-fshow-column[show column numbers in diagnostics, when available]' + '-fshrink-wrap[emit function prologues only before parts of the function that need it, rather than at the top of the function]' + '-fshrink-wrap-separate[shrink-wrap parts of the prologue and epilogue separately]' + '-fsignaling-nans[disable optimizations observable by IEEE signaling NaNs]' + '-fsigned-bitfields[when signed or unsigned is not given make the bitfield signed]' + '-fsigned-char[make char signed by default]' + '-fsigned-zeros[disable floating point optimizations that ignore the IEEE signedness of zero]' + '-fsimd-cost-model=[specifies the vectorization cost model for code marked with a simd directive]:model:(unlimited dynamic cheap)' + '-fsingle-precision-constant[convert floating point constants to single precision constants]' + '-fsplit-ivs-in-unroller[split lifetimes of induction variables when loops are unrolled]' + '-fsplit-loops[perform loop splitting]' + '-fsplit-paths[split paths leading to loop backedges]' + '-fsplit-stack[generate discontiguous stack frames]' + '-fsplit-wide-types[split wide types into independent registers]' + '-fssa-backprop[enable backward propagation of use properties at the SSA level]' + '-fssa-phiopt[optimize conditional patterns using SSA PHI nodes]' + '-fstack-check=-[insert stack checking code into the program. -fstack-check=specific if to argument given]:type:(none generic specific)' + '-fstack-limit-register=-[trap if the stack goes past <register>]:register: ' + '-fstack-limit-symbol=-[trap if the stack goes past symbol <name>]:name: ' + '-fstack-protector-all[use a stack protection method for every function]' + '-fstack-protector-explicit[use stack protection method only for functions with the stack_protect attribute]' + '-fstack-protector-strong[use a smart stack protection method for certain functions]' + '-fstack-protector[use propolice as a stack protection method]' + '-fstack-reuse=[set stack reuse level for local variables]:level:(all named_vars none)' + '-fstack-reuse=-[set stack reuse level for local variables]:reuse-level:(all named_vars none)' + '-fstack-usage[output stack usage information on a per-function basis]' + '-fstdarg-opt[optimize amount of stdarg registers saved to stack at start of function]' + '-fstore-merging[merge adjacent stores]' + '-fstrict-aliasing[assume strict aliasing rules apply]' + '-fstrict-enums[assume that values of enumeration type are always within the minimum range of that type]' + '-fstrict-overflow[treat signed overflow as undefined]' + '-fstrict-volatile-bitfields[force bitfield accesses to match their type width]' + '-fsync-libcalls[implement __atomic operations via libcalls to legacy __sync functions]' + '-fsyntax-only[check for syntax errors, then stop]' + '-ftabstop=[distance between tab stops for column reporting]:number' + '-ftest-coverage[create data files needed by "gcov"]' + '-fthread-jumps[perform jump threading optimizations]' + '-ftime-report[report the time taken by each compiler pass]' + '-ftls-model=-[set the default thread-local storage code generation model]:TLS model:(global-dynamic local-dynamic initial-exec local-exec)' + '-ftracer[perform superblock formation via tail duplication]' + '-ftrack-macro-expansion=[track locations of tokens coming from macro expansion and display them in error messages]::argument' + '-ftrapping-math[assume floating-point operations can trap]' + '-ftrapv[trap for signed overflow in addition, subtraction and multiplication]' + '-ftree-bit-ccp[enable SSA-BIT-CCP optimization on trees]' + '-ftree-builtin-call-dce[enable conditional dead code elimination for builtin calls]' + '-ftree-ccp[enable SSA-CCP optimization on trees]' + '-ftree-ch[enable loop header copying on trees]' + '-ftree-coalesce-vars[enable SSA coalescing of user variables]' + '-ftree-copy-prop[enable copy propagation on trees]' + '-ftree-cselim[transform condition stores into unconditional ones]' + '-ftree-dce[enable SSA dead code elimination optimization on trees]' + '-ftree-dominator-opts[enable dominator optimizations]' + '-ftree-dse[enable dead store elimination]' + '-ftree-forwprop[enable forward propagation on trees]' + '-ftree-fre[enable Full Redundancy Elimination (FRE) on trees]' + '-ftree-loop-distribute-patterns[enable loop distribution for patterns transformed into a library call]' + '-ftree-loop-distribution[enable loop distribution on trees]' + '-ftree-loop-if-convert[convert conditional jumps in innermost loops to branchless equivalents]' + '-ftree-loop-im[enable loop invariant motion on trees]' + '-ftree-loop-ivcanon[create canonical induction variables in loops]' + '-ftree-loop-linear[enable loop interchange transforms. Same as -floop-interchange]' + '-ftree-loop-optimize[enable loop optimizations on tree level]' + '-ftree-loop-vectorize[enable loop vectorization on trees]' + '-ftree-lrs[perform live range splitting during the SSA- >normal pass]' + '-ftree-parallelize-loops=[enable automatic parallelization of loops]' + '-ftree-parallelize-loops=-[enable automatic parallelization of loops]:threads: ' + '-ftree-partial-pre[in SSA-PRE optimization on trees, enable partial- partial redundancy elimination]' + '-ftree-phiprop[enable hoisting loads from conditional pointers]' + '-ftree-pre[enable SSA-PRE optimization on trees]' + '-ftree-pta[perform function-local points-to analysis on trees]' + '-ftree-reassoc[enable reassociation on tree level]' + '-ftree-scev-cprop[enable copy propagation of scalar-evolution information]' + '-ftree-sink[enable SSA code sinking on trees]' + '-ftree-slp-vectorize[enable basic block vectorization (SLP) on trees]' + '-ftree-slsr[perform straight-line strength reduction]' + '-ftree-sra[perform scalar replacement of aggregates]' + '-ftree-switch-conversion[perform conversions of switch initializations]' + '-ftree-tail-merge[enable tail merging on trees]' + '-ftree-ter[replace temporary expressions in the SSA->normal pass]' + '-ftree-vectorize[enable vectorization on trees]' + '-ftree-vrp[perform Value Range Propagation on trees]' + '-funconstrained-commons[assume common declarations may be overridden with ones with a larger trailing array]' + '-funroll-all-loops[perform loop unrolling for all loops]' + '-funroll-loops[perform loop unrolling when iteration count is known]' + '-funsafe-loop-optimizations[allow loop optimizations to assume that the loops behave in normal way]' + '-funsafe-math-optimizations[allow math optimizations that may violate IEEE or ISO standards]' + '-funsigned-bitfields[when signed or unsigned is not given make the bitfield unsigned]' + '-funsigned-char[make char unsigned by default]' + '-funswitch-loops[perform loop unswitching]' + '-funwind-tables[just generate unwind tables for exception handling]' + '-fuse-ld=-[use the specified linker instead of the default linker]:linker:(bfd gold)' + '-fuse-linker-plugin[use linker plugin during link-time optimization]' + '-fvariable-expansion-in-unroller[apply variable expansion when loops are unrolled]' + '-fvar-tracking-assignments[perform variable tracking by annotating assignments]' + '-fvar-tracking-assignments-toggle[toggle -fvar-tracking-assignments]' + '-fvar-tracking[perform variable tracking]' + '-fvar-tracking-uninit[perform variable tracking and also tag variables that are uninitialized]' + '-fvect-cost-model=[specifies the cost model for vectorization]:model:(unlimited dynamic cheap)' + '-fverbose-asm[add extra commentary to assembler output]' + '-fvisibility=-[set the default symbol visibility]:visibility:(default internal hidden protected)' + '-fvpt[use expression value profiles in optimizations]' + '-fweb[construct webs and split unrelated uses of single variable]' + '-fwhole-program[perform whole program optimizations]' + '-fwide-exec-charset=[convert all wide strings and character constants to character set]:character set' + '-fworking-directory[generate a #line directive pointing at the current working directory]' + '-fwrapv[assume signed arithmetic overflow wraps around]' + '-fzero-initialized-in-bss[put zero initialized data in the bss section]' + {-g-,--debug=}'[generate debug information]::debugging information type or level:(0 1 2 3 gdb gdb0 gdb1 gdb2 gdb3 coff stabs stabs+ dwarf dwarf+ dwarf-2 dwarf-3 dwarf-4 dwarf-5 dwarf32 dwarf64 xcoff xcoff+)' + '-gno-pubnames[don'\''t generate DWARF pubnames and pubtypes sections]' + '-gno-record-gcc-switches[don'\''t record gcc command line switches in DWARF DW_AT_producer]' + '-gno-split-dwarf[don'\''t generate debug information in separate .dwo files]' + '-gno-strict-dwarf[emit DWARF additions beyond selected version]' + '-gpubnames[generate DWARF pubnames and pubtypes sections]' + '-grecord-gcc-switches[record gcc command line switches in DWARF DW_AT_producer]' + '-gsplit-dwarf[generate debug information in separate .dwo files]' + '-gstrict-dwarf[don'\''t emit DWARF additions beyond selected version]' + '-gtoggle[toggle debug information generation]' + '-gvms[generate debug information in VMS format]' + '--help[display this information]' + {-H,--trace-includes}'[print name of each header file used]' + {'*-idirafter','*--include-directory-after='}'[add directory after include search path]:second include path directory:_files -/' + {'*-I-','*--include-directory='}'[add directory to include search path]:header file search path:_files -/' + {'*-imacros','*--imacros='}'[include macros from file before parsing]:macro input file:_files -g \*.h\(-.\)' + '-imultiarch[set <dir> to be the multiarch include subdirectory]:directory:_files -/' #XXX not in manpage + '-imultilib=[set dir to be the multilib include subdirectory]:dir:_files -/' + '--include-barrier[restrict all prior -I flags to double-quoted inclusion and remove current directory from include path]' + {'*-include=','*--include='}'[include file before parsing]:include file:_files -g \*.h\(-.\)' + '-iplugindir=-[set <dir> to be the default plugin directory]:directory:_files -/' + {'*-iprefix','*--include-prefix='}'[set the -iwithprefix prefix]:prefix:_files' + '-iquote=[add dir to the end of the quote include path]:dir:_files -/' + '-isysroot=[set dir to be the system root directory]:dir:_files -/' + '*-isystem[add directory to system include search path]:second include path directory (system):_files -/' + {'*-iwithprefixbefore','*--include-with-prefix-before='}'[set directory to include search path with prefix]:main include path directory:_files -/' + {'*-iwithprefix','*--include-with-prefix=','*--include-with-prefix-after='}'[set directory to system include search path with prefix]:second include path directory:_files -/' + '*-L-[add directory to library search path]:library search path:_files -/' + '-lang-asm[set lang asm]' + '*-l+[include library found in search path]:library:->library' + '-MF[write dependency output to the given file]:file:_files' + '-MJ[write a compilation database entry per input]' + '-MQ[add a make-quoted target]:target' + '*-M-[set flags for generating Makefile dependencies]::output dependencies:->dependencies' + '-MT[add an unquoted target]:target' + '-no-canonical-prefixes[do not canonicalize paths when building relative prefixes to other gcc components]' + '-nodefaultlibs[do not use the standard system libraries when linking]' + '-nostartfiles[do not use the standard system startup files when linking]' + {-nostdinc,--no-standard-includes}'[do not search standard system directories or compiler builtin directories for include files]' + '-nostdlib[do not use standard system startup files or libraries when linking]' + {-O-,--optimize=-}'[control the optimization]::optimization level:((0 1 2 3 g\:optimize\ for\ debugging\ experience s\:optimize\ for\ space fast\:optimize\ for\ speed\ disregarding\ exact\ standards\ compliance))' + {-o,--output=}'[write output to file]:output file:_files -g "^*.(c|h|cc|C|cxx|cpp|hpp)(-.)"' + '--output-pch=[output pch]' + '--param[set parameter <param> to value. See manpage for a complete list of parameters]:name=value' + '-pass-exit-codes[exit with highest error code from a phase]' + {-pedantic-errors,--pedantic-errors}'[like -pedantic but issue them as errors]' + {-pedantic,--pedantic}'[issue all mandatory diagnostics in the C standard]' + '(-pg)-p[enable function profiling for prof]' + '-pie[create a position independent executable]' + {-pipe,--pipe}'[use pipes rather than intermediate files]' + {-P,--no-line-commands}'[inhibit generation of linkemakers during preprocess]' + '(-p)-pg[enable function profiling for gprof]' + '-###[print commands to run this compilation]' + '-print-file-name=-[display the full path to library <library>]:library:->library' + '-print-libgcc-file-name[display the name of the compiler'\''s companion library]' + '--print-missing-file-dependencies[print missing file dependencies]' + '-print-multiarch[display the target'\''s normalized GNU triplet, used as a component in the library path]' + '-print-multi-directory[display the root directory for versions of libgcc]' + '-print-multi-lib[display the mapping between command line options and multiple library search directories]' + '-print-multi-os-directory[display the relative path to OS libraries]' + '-print-prog-name=-[display the full path to compiler component <program>]:program:' + '-print-search-dirs[display the directories in the compiler'\''s search path]' + '-print-sysroot[display the target libraries directory]' + '-print-sysroot-headers-suffix[display the sysroot suffix used to find headers]' + {-Qn,-fno-ident}'[do not emit metadata containing compiler name and version]' + '-quiet[do not display functions compiled or elapsed time]' + {-Qy,-fident}'[emit metadata containing compiler name and version]' + '-rdynamic[pass the flag -export-dynamic to the ELF linker, on targets that support it]' + '-remap[remap file names when including files]' + {-S,--assemble}'[compile only; do not assemble or link]' + '-save-stats=-[save code generation statistics]:location:(cwd obj)' + '-save-temps[do not delete intermediate files]' + '-shared[create a shared library]' + '-shared-libgcc[force shared libgcc]' + '*-specs=-[override built-in specs with the contents of <file>]:file:_files' + '-s[remove all symbol table and relocation information from the executable]' + '-static-libgcc[force static libgcc]' + '-static[on systems that support dynamic linking, this prevents linking with the shared libraries]' + {'-std=-','--std='}'[assume that the input sources are for specified standard]:standard:(c90 c89 iso9899\:1990 iso9899\:199409 c99 iso9899\:1999 c11 iso9899\:2011 gnu90 gnu89 gnu99 gnu11 c++98 c++03 gnu++98 gnu++03 c++11 gnu++11 c++1y gnu++1y c++14 gnu++14 c++1z gnu++1z c++17 iso9899\:2017 gnu++17 c++2a gnu++2a)' + '-symbolic[bind references to global symbols when building a shared object]' + '--sysroot=-[use <directory> as the root directory for headers and libraries]:directory:_files -/' + '--target-help[display target specific command line options]' + '-time[time the execution of each subprocess]' + {-traditional-cpp,--traditional-cpp}'[use traditional preprocessor]' + {-trigraphs,--trigraphs}'[process trigraph sequences]' + '-T[specify linker script]:linker script:_files' + '-undef[do not predefine system specific and gcc specific macros]' + '*-u[pretend symbol to be undefined]:symbol:' + '--user-dependencies[print user dependencies]' + {'*-U-','*--undefine-macro='}'[undefine a macro]:undefine macro:' + '-version[display the compiler'\''s version]' + '--version[display version information]' + '-V[specify compiler version]:compiler version:' + {-v,--verbose}'[enable verbose output]' + '*-Wa,-[pass arguments to the assembler]:assembler option:' + '--warn--[enable the specified warning]:warning:->warning' + '*-Werror=-[treat specified warning as error (or all if none specified)]::warning:->warning' + '-Wfatal-errors[exit on the first error occurred]' + '*-Wl,-[pass arguments to the linker]:linker option:' + {-w,--no-warnings}'[suppress warnings]' + '*-Wp,-[pass arguments to the preprocessor]:preprocessor option:' + '--write-dependencies[write a depfile containing user and system dependencies]' + '--write-user-dependencies[write a depfile containing user dependencies]' + '*-Xassembler[pass argument to the assembler]:assembler option:' + '*-Xlinker[pass argument to the linker]:linker option:' + '*-Xpreprocessor[pass argument to the preprocessor]:preprocessor option:' + '-x[specify the language of the following input files]:input file language:('"$languages"')' ) -# other common options, gcc --help=warnings --help=optimizers --help=common|sed 1,/language-independent/d -args+=( -# | grep -v :: - '--help[Display this information]' - '--no-warnings[Same as -w]' - '--optimize[Same as -O]' - '--output:output file:_files -g "^*.(c|h|cc|C|cxx|cpp|hpp)(-.)"' - '--param[Set parameter <param> to value. See manpage for a complete list of parameters]:name=value' - '--verbose[Same as -v]' - '--version[Display version information]' - '-aux-info[Emit declaration information into <file>]:file:_files' - '-dumpbase[Set the file basename to be used for dumps]:file:_files' - '-dumpdir[Set the directory name to be used for dumps]:file:_files -/' - '-fPIC[Generate position-independent code if possible (large mode)]' - '-fPIE[Generate position-independent code for executables if possible (large mode)]' - '-fassociative-math[Allow optimization for floating-point arithmetic which may change the result of the operation due to rounding]' - '-fauto-inc-dec[Generate auto-inc/dec instructions]' - '-fbounds-check[Generate code to check bounds before indexing arrays]' - '-fcall-saved--[Mark <register> as being preserved across functions]:register' - '-fcall-used--[Mark <register> as being corrupted by function calls]:register' - '-fcheck-data-deps[Compare the results of several data dependence analyzers]' - '-fcompare-debug-second[Run only the second compilation of -fcompare-debug]' - '-fcompare-debug=-[Compile with and without e.g. -gtoggle, and compare the final-insns dump]:opts:' #TODO: complete gcc options here - '-fdbg-cnt-list[List all available debugging counters with their limits and counts]' - '-fdbg-cnt=-[,<counter>-<limit>,...) Set the debug counter limit]:counter\:limit,...: ' #TODO: gcc -fdbg-cnt-list -x c /dev/null -o /dev/null -c - '-fdebug-types-section[Output .debug_types section when using DWARF v4 debuginfo]' - '-fdelete-dead-exceptions[Delete dead instructions that may throw exceptions]' - '-fdiagnostics-color=-[Colorize diagnostics]::color:(never always auto)' - '-fdiagnostics-generate-patch[Print fix-it hints to stderr in unified diff format]' - '-fdiagnostics-parseable-fixits[Print fixit hints in machine-readable form]' - '-fdiagnostics-show-caret[Show the source line with a caret indicating the column]' - '-fdiagnostics-show-location=-[How often to emit source location at the beginning of line-wrapped diagnostics]:source location:(once every-line)' - '-fdiagnostics-show-option[Amend appropriate diagnostic messages with the command line option that controls them]' - #not meant for end users - #'-fdisable--pass=-[disables an optimization pass]:range1+range2: ' - #'-fdisable-[disables an optimization pass]' - #'-fenable--pass=-[enables an optimization pass]:range1+range2: ' - #'-fenable-[enables an optimization pass]' - #'-fdump-<type>[Dump various compiler internals to a file]' - '-fdump-final-insns=-[Dump to filename the insns at the end of translation]:filename:_files' - '-fdump-go-spec=-[Write all declarations to file as Go code]:filename:_files' - '-fdump-noaddr[Suppress output of addresses in debugging dumps]' - '-fdump-passes[Dump optimization passes]' - '-fdump-unnumbered-links[Suppress output of previous and next insn numbers in debugging dumps]' - '-fdump-unnumbered[Suppress output of instruction numbers, line number notes and addresses in debugging dumps]' - '-fdwarf2-cfi-asm[Enable CFI tables via GAS assembler directives]' - '-feliminate-dwarf2-dups[Perform DWARF2 duplicate elimination]' - '-feliminate-unused-debug-symbols[Perform unused type elimination in debug info]' - '-feliminate-unused-debug-types[Perform unused type elimination in debug info]' - '-femit-class-debug-always[Do not suppress C++ class debug information]' - '-fexcess-precision=-[Specify handling of excess floating-point precision]:precision handling:(fast standard)' - '-ffast-math[Sets -fno-math-errno, -funsafe-math-optimizations, -ffinite-math-only, -fno-rounding-math, -fno-signaling-nans and -fcx-limited-range]' - '-ffat-lto-objects[Output lto objects containing both the intermediate language and binary output]' - '-ffixed--[Mark <register> as being unavailable to the compiler]:register' - '-ffunction-cse[Allow function addresses to be held in registers]' - '-ffunction-sections[Place each function into its own section]' - '-fgnu-tm[Enable support for GNU transactional memory]' - '-fgraphite[Enable in and out of Graphite representation]' - '-fident[Process #ident directives]' - '-findirect-inlining[Perform indirect inlining]' - '-finhibit-size-directive[Do not generate .size directives]' - '-finline-limit=-[Limit the size of inlined functions to <number>]:number: ' - '-finstrument-functions[Instrument function entry and exit with profiling calls]' - '-fira-loop-pressure[Use IRA based register pressure calculation in RTL loop optimizations]' - '-fira-share-save-slots[Share slots for saving different hard registers]' - '-fira-share-spill-slots[Share stack slots for spilled pseudo-registers]' - '-fira-verbose=-[Control IRA'\''s level of diagnostic messages]:verbosity: ' - '-fkeep-inline-functions[Generate code for functions even if they are fully inlined]' - '-fkeep-static-consts[Emit static const variables even if they are not used]' - '-fleading-underscore[Give external symbols a leading underscore]' - '-flto-compression-level=-[Use specified zlib compression level for IL]:compression level: ' - '-flto-odr-type-merging[Merge C++ types using One Definition Rule]' - '-flto-partition=-[Partition symbols and vars at linktime based on object files they originate from]:partitioning algorithm:(1to1 balanced max one none)' - '-flto-report[Report various link-time optimization statistics]' - '-fmax-errors=-[Maximum number of errors to report]:errors: ' - '-fmem-report-wpa[Report on permanent memory allocation in WPA only]' - '-fmem-report[Report on permanent memory allocation]' - '-fmerge-debug-strings[Attempt to merge identical debug strings across compilation units]' - '-fmessage-length=-[Limit diagnostics to <number> characters per line. 0 suppresses line-wrapping]:length: ' - '-fmodulo-sched-allow-regmoves[Perform SMS based modulo scheduling with register moves allowed]' - '-fopt-info-type=-[Dump compiler optimization details]:filename:_files' - '-fopt-info[Dump compiler optimization details]' - '-fpartial-inlining[Perform partial inlining]' - '-fpcc-struct-return[Return small aggregates in memory, not registers]' - '-fpic[Generate position-independent code if possible (small mode)]' - '-fpie[Generate position-independent code for executables if possible (small mode)]' - '-fplugin-arg--[Specify argument <key>=<value> for plugin <name>]:-fplugin-arg-name-key=value: ' #TODO - '-fpost-ipa-mem-report[Report on memory allocation before interprocedural optimization]' - '-fpre-ipa-mem-report[Report on memory allocation before interprocedural optimization]' - '-fprofile-arcs[Insert arc-based program profiling code]' - '-fprofile-correction[Enable correction of flow inconsistent profile data input]' - '-fprofile-generate[Enable common options for generating profile info for profile feedback directed optimizations]' - '-fprofile-report[Report on consistency of profile]' - '-fprofile-use[Enable common options for performing profile feedback directed optimizations]' - '-fprofile-values[Insert code to profile values of expressions]' - '-fprofile[Enable basic program profiling code]' - '-frandom-seed=-[Use <string> as random seed]:seed: ' - '-freciprocal-math[Same as -fassociative-math for expressions which include division]' - '-frecord-gcc-switches[Record gcc command line switches in the object file]' - '-free[Turn on Redundant Extensions Elimination pass]' - "-fsanitize=-[Enable AddressSanitizer, a memory error detector]:style:($sanitizers)" - '-fsched-stalled-insns-dep=-[Set dependence distance checking in premature scheduling of queued insns]:instructions: ' - '-fsched-stalled-insns=-[Set number of queued insns that can be prematurely scheduled]:instructions: ' - '-fsched-verbose=-[Set the verbosity level of the scheduler]:verbosity: ' - '-fshow-column[Show column numbers in diagnostics, when available]' - '-fsplit-stack[Generate discontiguous stack frames]' - '-fstack-check=-[Insert stack checking code into the program. -fstack-check=specific if to argument given]:type:(none generic specific)' - '-fstack-limit-register=-[Trap if the stack goes past <register>]:register: ' - '-fstack-limit-symbol=-[Trap if the stack goes past symbol <name>]:name: ' - '-fno-stack-limit' - '-fstack-protector-all[Use a stack protection method for every function]' - '-fstack-protector[Use propolice as a stack protection method]' - '-fstack-usage[Output stack usage information on a per-function basis]' - '-fstrict-overflow[Treat signed overflow as undefined]' - '-fstrict-volatile-bitfields[Force bitfield accesses to match their type width]' - '-fsync-libcalls[Implement __atomic operations via libcalls to legacy __sync functions]' - '-fsyntax-only[Check for syntax errors, then stop]' - '-ftest-coverage[Create data files needed by "gcov"]' - '-ftime-report[Report the time taken by each compiler pass]' - '-ftls-model=-[Set the default thread-local storage code generation model]:TLS model:(global-dynamic local-dynamic initial-exec local-exec)' - '-ftracer[Perform superblock formation via tail duplication]' - '-ftree-loop-linear[Enable loop interchange transforms. Same as -floop-interchange]' - '-fuse-ld=-[Use the specified linker instead of the default linker]:linker:(bfd gold)' - '-fuse-linker-plugin[Use linker plugin during link-time optimization]' - '-fverbose-asm[Add extra commentary to assembler output]' - '-fvisibility=-[Set the default symbol visibility]:visibility:(default internal hidden protected)' - '-fzero-initialized-in-bss[Put zero initialized data in the bss section]' - '-gno-pubnames[Don'\''t generate DWARF pubnames and pubtypes sections]' - '-gno-record-gcc-switches[Don'\''t record gcc command line switches in DWARF DW_AT_producer]' - '-gno-split-dwarf[Don'\''t generate debug information in separate .dwo files]' - '-gno-strict-dwarf[Emit DWARF additions beyond selected version]' - '-gpubnames[Generate DWARF pubnames and pubtypes sections]' - '-grecord-gcc-switches[Record gcc command line switches in DWARF DW_AT_producer]' - '-gsplit-dwarf[Generate debug information in separate .dwo files]' - '-gstrict-dwarf[Don'\''t emit DWARF additions beyond selected version]' - '-gtoggle[Toggle debug information generation]' - '-gvms[Generate debug information in VMS format]' - '-imultiarch[Set <dir> to be the multiarch include subdirectory]:directory:_files -/' #XXX not in manpage - '-iplugindir=-[Set <dir> to be the default plugin directory]:directory:_files -/' - '(-pg)-p[Enable function profiling for prof]' - '(-p)-pg[Enable function profiling for gprof]' - '-pedantic-errors[Like -pedantic but issue them as errors]' - '-pedantic[Issue all mandatory diagnostics in the C standard]' - '-quiet[Do not display functions compiled or elapsed time]' - '-v[Enable verbose output]' - '-version[Display the compiler'\''s version]' - '-w[Suppress warnings]' -# | grep :: - '-fabi-version=-[Use version <n> of the C++ ABI (default: 2)]:ABI version:(1 2 3 4 5 6)' - '-fdebug-prefix-map=-[Map one directory name to another in debug information]:/old/dir=/new/dir:->dirtodir' - '-ffp-contract=-[Perform floating- point expression contraction (default: fast)]:style:(on off fast)' - '-finstrument-functions-exclude-file-list=-[Do not instrument functions listed in files]:comma-separated file list:->commafiles' - '-finstrument-functions-exclude-function-list=-[Do not instrument listed functions]:comma-separated list of syms: ' - '-fira-algorithm=-[Set the used IRA algorithm]:algorithm:(priority CB)' - '-fira-region=-[Set regions for IRA]:region:(all mixed one)' - '-fplugin=-[Specify a plugin to load]:plugin: ' # TODO: complete plugins? - '-fprofile-dir=-[Set the top-level directory for storing the profile data]:profile directory:_files -/' - '-fstack-reuse=-[Set stack reuse level for local variables]:reuse-level:(all named_vars none)' - '-ftree-parallelize-loops=-[Enable automatic parallelization of loops]:threads: ' -) +# not meant for end users +#'-fdisable--pass=-[disables an optimization pass]:range1+range2: ' +#'-fdisable-[disables an optimization pass]' +#'-fenable--pass=-[enables an optimization pass]:range1+range2: ' +#'-fenable-[enables an optimization pass]' +#'-fdump-<type>[dump various compiler internals to a file]' + +args+=($warnings) # How to mostly autogenerate the above stuff: # joinhelplines() { sed '$!N;s/^\( -.*\)\n \s*\([^-]\)/\1 \2/;P;D' } # gcc-x86() { gcc --help=target,\^undocumented | joinhelplines | joinhelplines } # compdef _gnu_generic gcc-x86 # printf '%s\n' ${(onq-)_args_cache_gcc_x86} + +# TODO: -fno-<TAB> and -mno-<TAB> match lots of non-existent options. _arguments -C -M 'L:|-{fWm}no-=-{fWm} r:|[_-]=* r:|=*' \ "$args[@]" \ "$args2[@]" && ret=0 - case "$state" in dump) - _values -s '' 'dump information' \ - 'M[only macro definitions]' \ - 'N[macro names]' \ - 'D[macro definitions and normal output]' \ - 'y[debugging information during parsing]' \ - 'r[after RTL generation]' \ - 'x[only generate RTL]' \ - 'j[after jump optimization]' \ - 's[after CSE]' \ - 'L[after loop optimization]' \ - 't[after second CSE pass]' \ - 'f[after flow analysis]' \ - 'c[after instruction combination]' \ - 'S[after first instruction scheduling pass]' \ - 'l[after local register allocation]' \ - 'g[after global register allocation]' \ - 'R[after second instruction scheduling pass]' \ - 'J[after last jump optimization]' \ - 'd[after delayed branch scheduling]' \ - 'k[after conversion from registers to stack]' \ - 'a[all dumps]' \ - 'm[print memory usage statistics]' \ - 'p[annotate assembler output]' && ret=0 + local -a dump_values=( + 'A[verbose assembly output]' + 'D[macro definitions and normal output]' + 'I[include directives and normal output]' + 'J[after last jump optimization]' + 'L[after loop optimization]' + 'M[only macro definitions]' + 'N[macro names]' + 'R[after second instruction scheduling pass]' + 'S[after first instruction scheduling pass]' + 'a[all dumps]' + 'c[after instruction combination]' + 'd[after delayed branch scheduling]' + 'f[after flow analysis]' + 'g[after global register allocation]' + 'j[after jump optimization]' + 'k[after conversion from registers to stack]' + 'l[after local register allocation]' + 'm[print memory usage statistics]' + 'p[annotate assembler output]' + 'r[after RTL generation]' + 's[after CSE]' + 't[after second CSE pass]' + 'x[only generate RTL]' + 'y[debugging information during parsing]' + ) + _values -s '' 'dump information' $dump_values && ret=0 + ;; +dependencies) + local -a dependencies=( + 'D:generate make dependencies and compile' + 'G:treat missing header files as generated' + 'M:only user header files' + 'MD:output to file' + 'P:generate phony targets for all headers' + 'V:use NMake/Jom format for the depfile' + ) + _describe dependencies dependencies && ret=0 ;; library) + # TODO: improve defaults for library_path (e.g., use output of clang -Wl,-v) + local -a library_path=( /usr/lib /usr/local/lib ) + case $OSTYPE in + (darwin*) + library_path+=( $(xcrun --show-sdk-path)/usr/lib ) + ;; + (linux-gnu) + local tmp + tmp=$(_call_program library-paths $words[1] -print-multiarch) + if [[ $tmp != '' && -d /usr/lib/$tmp ]]; then + library_path+=( /usr/lib/$tmp ) + elif [[ -d /usr/lib64 ]]; then + library_path+=( /usr/lib64 ) + fi + ;; + esac + # Add directories from -L options + for ((i = 2; i < $#words; i++)); do + if [[ "$words[i]" = -L ]]; then + library_path+=("$words[++i]") + elif [[ "$words[i]" = -L* ]]; then + library_path+=("${words[i]##-L}") + fi + done _wanted libraries expl library \ - compadd - ${^=LD_LIBRARY_PATH:-/usr/lib /usr/local/lib}/lib*.(a|so*)(:t:fr:s/lib//) && ret=0 + compadd - $library_path/lib*.(a|so*|dylib)(:t:fr:s/lib//) && ret=0 ;; rundir) compset -P '*:' @@ -1219,7 +2250,39 @@ commafiles) compset -P '*,' _files && ret=0 ;; +framework) + local -a framework_path=() + case $OSTYPE in + darwin*) + framework_path=( $(xcrun --show-sdk-path)/System/Library/Frameworks ) ;; + esac + # Add directories from -F options + for ((i = 2; i < $#words; i++)); do + if [[ "$words[i]" = -F ]]; then + framework_path+=("$words[++i]") + elif [[ "$words[i]" = -F* ]]; then + framework_path+=("${words[i]##-F}") + fi + done + _wanted frameworks expl framework \ + compadd -- $framework_path/*.framework(:t:r) && ret=0 + ;; +warning) + local -a warning_names + for warning in $warnings; do + if [[ "$warning" = (#b)-W([^=\[]##)[^\[]#\[(*)\]* ]]; then + warning_names+=("$match[1]:$match[2]") + fi + done + _describe warning warning_names && ret=0 + ;; +arch) + _wanted cputypes expl "CPU type" compadd -a arch && ret=0 + ;; +archgeneric) + arch+=(generic) + _wanted cputypes expl "CPU type" compadd -a arch && ret=0 + ;; esac return ret - -- cgit v1.2.3 From ccc7ff90a46d7b1bdcf61bae2dba20d68dca7654 Mon Sep 17 00:00:00 2001 From: Marc Chantreux <eiro@phear.org> Date: Thu, 11 Mar 2021 19:08:57 +0100 Subject: users/26579: changes from review including parameter expansion to replace awk --- ChangeLog | 3 +++ Completion/Unix/Command/_surfraw | 30 +++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 51a54d5e1..d2b58a0f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-04-06 Oliver Kiddle <opk@zsh.org> + * Marc Chantreux: users/26579: Completion/Unix/Command/_surfraw: + changes from review including parameter expansion to replace awk + * 48414: Completion/Unix/Type/_bpf_filters: quote closing bracket to adapt for change in 43928 diff --git a/Completion/Unix/Command/_surfraw b/Completion/Unix/Command/_surfraw index 343d275cc..4838f1e58 100644 --- a/Completion/Unix/Command/_surfraw +++ b/Completion/Unix/Command/_surfraw @@ -430,19 +430,23 @@ case $state in esac ;; elvi) - local -UT XDG_CONFIG_DIRS xcd - # as it starts with a space, the header becomes an empty - # string removed by the list expansion - _wanted elvi expl elvi compadd \ - ${${(f)"$(surfraw -elvi)"}%%[[:space:]]*} $( - # extract the keys of all bookmarks (should be in surfraw itself) - awk '{keys[$1]=1} END {for (k in keys) print k}' \ - $^xcd/surfraw/bookmarks(Nr) \ - /etc/xdg/surfraw/bookmarks(Nr) \ - /etc/surfraw.bookmarks(Nr) \ - ${XDG_CONFIG_HOME-${HOME?homeless}/.config}/surfraw/bookmarks(Nr) \ - ${HOME?homeless}/.surfraw.bookmarks(Nr) - ) && ret=0 + local -UT XDG_CONFIG_DIRS xdg_config_dirs + local it + # list the applets + set -- ${${(f)"$(_call_program elvi surfraw -elvi)"}%%[[:space:]]##-- *} + shift # the first line is an header: remove it + # then list the bookmarks + for it in \ + $^xdg_config_dirs/surfraw/bookmarks(Nr) \ + /etc/xdg/surfraw/bookmarks(Nr) \ + /etc/surfraw.bookmarks(Nr) \ + ${XDG_CONFIG_HOME-$HOME/.config}/surfraw/bookmarks(Nr) \ + $HOME/.surfraw.bookmarks(Nr) + do + read -d'\0' it < $it + set -- "$@" ${${(f)it}%%[[:space:]]*} + done + _wanted elvi expl elvi compadd "$@" && ret=0 ;; esac -- cgit v1.2.3 From 62e86515e79e57e791bc9f5ed815e8020d1dcf6b Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> Date: Thu, 8 Apr 2021 22:24:52 +0900 Subject: 48416: update _gcore for macOS and GNU --- ChangeLog | 5 +++++ Completion/Unix/Command/_gcore | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 1c7a88bff..18c576b5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-04-08 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + + * 48416: Completion/Unix/Command/_gcore: support macOS, with + update for GNU gcore + 2021-04-08 Daniel Shahaf <d.s@daniel.shahaf.name> * 48410: Doc/Zsh/metafaq.yo, Etc/FAQ.yo: FAQ, METAFAQ: Mention diff --git a/Completion/Unix/Command/_gcore b/Completion/Unix/Command/_gcore index 07a65cd9a..913ef25ca 100644 --- a/Completion/Unix/Command/_gcore +++ b/Completion/Unix/Command/_gcore @@ -49,10 +49,20 @@ case $OSTYPE in '::executable:' \ ':pid:_pids' ;; + darwin*) + _arguments -s -A '-*' \ + '-s[suspend the process while the core file is captured]' \ + '-v[report progress on the dump as it proceeds]' \ + '-b+[specify maximum size of core file]:size (MiB): ' \ + '(-c)-o+[write core file to specified file]:file:_files' \ + '(-o)-c+[specify format of core file name]:format:{_message "%%N\:program name, %%U\:uid, %%P\:pid, %%T\:time stamp"}' \ + '1:pid:_pids' + ;; *) # GNU GDB gcore - _arguments \ - '-o[set core file base name]:file base name:_files' \ - ':pid:_pids' + _arguments -s -A '-*' \ + '-a[dump all memory mappings]' \ + '-o+[set core file base name]:file base name:_files' \ + '*:pid:_pids' ;; esac -- cgit v1.2.3 From f3caff1536c4a4061d353314eef2628bcd1c8403 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Fri, 9 Apr 2021 21:51:31 +0200 Subject: 48437: fix pid completion when cursor is in the middle of the line --- ChangeLog | 3 +++ Completion/Unix/Command/_gdb | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 058834e39..416745cd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-04-09 Oliver Kiddle <opk@zsh.org> + * 48437: Completion/Unix/Command/_gdb: fix pid completion when + cursor is in the middle of the line + * Felipe Contreras: 47786: aclocal.m4, aczsh.m4: prepare for autoconf 2.70 diff --git a/Completion/Unix/Command/_gdb b/Completion/Unix/Command/_gdb index 18f797633..6bdd55946 100644 --- a/Completion/Unix/Command/_gdb +++ b/Completion/Unix/Command/_gdb @@ -40,9 +40,9 @@ else (-b) _baudrates && return 0 ;; esac - w=( "${(@)words[2,-1]}" ) + w=( "${(@)words[2,CURRENT-1]}" ) while [[ "$w[1]" = -* ]]; do - [[ "$w[1]" = -[decsxb] ]] && shift 1 w + [[ "$w[1]" = -(cd|se|tty|[decsxb]) ]] && shift 1 w shift 1 w done -- cgit v1.2.3 From 7269bc1ac46852f8624b99211500276c758eb46e Mon Sep 17 00:00:00 2001 From: dana <dana@dana.is> Date: Sat, 10 Apr 2021 15:54:26 -0500 Subject: 48338: _git: Support case-insensitive path matching --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index f894cc2fe..a21b405c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-04-10 dana <dana@dana.is> + + * 48338: Completion/Unix/Command/_git: Support case-insensitive + path matching + 2021-04-09 Peter Stephenson <p.w.stephenson@ntlworld.com> * 48432 (plus test change): Src/Modules/zutil.c, diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index ced89b501..0267acfa8 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -7155,11 +7155,16 @@ __git_files () { local pref=${(Q)${~PREFIX}} [[ $pref[1] == '/' ]] || pref=$gittoplevel$gitprefix$pref - # First allow ls-files to pattern-match in case of remote repository - files=(${(0)"$(_call_program files git ls-files -z --exclude-standard ${(q)opts} -- ${(q)${pref:+$pref\*}:-.} 2>/dev/null)"}) + # First allow ls-files to pattern-match in case of remote repository. Use the + # icase pathspec magic word to ensure that we support case-insensitive path + # completion for users with the appropriate matcher configuration + files=(${(0)"$(_call_program files git ls-files -z --exclude-standard ${(q)opts} -- ${(q)${pref:+:\(icase\)$pref\*}:-.} 2>/dev/null)"}) __git_command_successful $pipestatus || return - # If ls-files succeeded but returned nothing, try again with no pattern + # If ls-files succeeded but returned nothing, try again with no pattern. Note + # that ls-files defaults to the CWD if not given a path, so if the file we + # were trying to add is in an *adjacent* directory, this won't return anything + # helpful either if [[ -z "$files" && -n "$pref" ]]; then files=(${(0)"$(_call_program files git ls-files -z --exclude-standard ${(q)opts} -- 2>/dev/null)"}) __git_command_successful $pipestatus || return -- cgit v1.2.3 From 80d5210195593576dbffe10867cab358bbb58148 Mon Sep 17 00:00:00 2001 From: Marc Chantreux <eiro@phear.org> Date: Fri, 9 Apr 2021 21:44:54 +0200 Subject: 48445: pluralize tags in _surfraw --- ChangeLog | 3 +++ Completion/Unix/Command/_surfraw | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 4e0ebcf9a..d48e6a329 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-04-11 Oliver Kiddle <opk@zsh.org> + * Marc Chantreux: 48445: Completion/Unix/Command/_surfraw: + pluralize tags in _surfraw + * Marc Chantreux: users/26645: Completion/X/Command/_gv: update options in gv completion diff --git a/Completion/Unix/Command/_surfraw b/Completion/Unix/Command/_surfraw index 4838f1e58..035066662 100644 --- a/Completion/Unix/Command/_surfraw +++ b/Completion/Unix/Command/_surfraw @@ -20,11 +20,11 @@ case $state in subcmd) args=( '-help[display help information]' - '*:string:_guard "^-*" "search string"' + '*: :_guard "^-*" "search string"' ) case "$words[1]" in ask|cia|cnn|deblogs|excite|filesearching|foldoc|happypenguin|slashdot|slinuxdoc|sundocs|sunsolve|xxx) - _message -e string 'search string' + _message -e strings 'search string' ;; alioth) _arguments $args \ @@ -164,7 +164,7 @@ case $state in '-doc[view PTS documentation]' && ret=0 ;; debsec) - _message -e string 'package name, bug number or CVE ID' + _message -e strings 'package name, bug number or CVE ID' ;; deja) _arguments $args \ @@ -261,9 +261,9 @@ case $state in '-head=:display headlines:(on off)' \ '-grid=:show results in grid:(on off)' \ '-spell=:spelling tolerance:(off standard force)' \ - '*:dictionary word:->dictword' && ret=0 + '*:dictionary word:->words' && ret=0 - [[ "$state" = dictword ]] && _wanted words expl 'dictionary word' \ + [[ "$state" = words ]] && _wanted words expl 'dictionary word' \ compadd $(look "${PREFIX}") && ret=0 ;; netbsd|openbsd) @@ -422,10 +422,10 @@ case $state in '-results=-[specify number of results to return]:number' && ret=0 ;; yubnub) - _message -e command 'Yubnub Command' + _message -e commands 'Yubnub Command' ;; *) - _message -e string 'search string' + _message -e strings 'search string' ;; esac ;; @@ -434,7 +434,7 @@ case $state in local it # list the applets set -- ${${(f)"$(_call_program elvi surfraw -elvi)"}%%[[:space:]]##-- *} - shift # the first line is an header: remove it + shift # the first line is a header: remove it # then list the bookmarks for it in \ $^xdg_config_dirs/surfraw/bookmarks(Nr) \ -- cgit v1.2.3 From 82ba2261abbfa5673fbd5df980c8cbbeb7946653 Mon Sep 17 00:00:00 2001 From: Marc Chantreux <eiro@phear.org> Date: Sat, 10 Apr 2021 10:25:02 +0200 Subject: 48466: correct indentation and remove tabs and trailing spaces --- ChangeLog | 3 +++ Completion/Unix/Command/_surfraw | 58 ++++++++++++++++++++-------------------- 2 files changed, 32 insertions(+), 29 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index d48e6a329..8007f51a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-04-11 Oliver Kiddle <opk@zsh.org> + * Marc Chantreux: 48466: Completion/Unix/Command/_surfraw: + correct indentation and remove tabs and trailing spaces + * Marc Chantreux: 48445: Completion/Unix/Command/_surfraw: pluralize tags in _surfraw diff --git a/Completion/Unix/Command/_surfraw b/Completion/Unix/Command/_surfraw index 035066662..d153cd493 100644 --- a/Completion/Unix/Command/_surfraw +++ b/Completion/Unix/Command/_surfraw @@ -64,10 +64,10 @@ case $state in '*:search string' && ret=0 ;; ctan) - _arguments $args \ - '-name[search by filename]' \ - '-desc[search descriptions (default)]'\ - '-doc[search documentation]' + _arguments $args \ + '-name[search by filename]' \ + '-desc[search descriptions (default)]'\ + '-doc[search documentation]' ;; currency) _arguments \ @@ -165,7 +165,7 @@ case $state in ;; debsec) _message -e strings 'package name, bug number or CVE ID' - ;; + ;; deja) _arguments $args \ '-results=-:[number of results to return]' \ @@ -183,7 +183,7 @@ case $state in ;; ebay) _arguments $args \ - '-country=-:country:(com de uk fr)' \ + '-country=-:country:(com de uk fr)' \ '-results=-:[number of results to return]:number' && ret=0 ;; etym) @@ -220,7 +220,7 @@ case $state in _deb_packages avail && ret=0 ;; fsfdir) - _arguments $args + _arguments $args ;; google) _arguments $args \ @@ -229,19 +229,19 @@ case $state in '-search=-:topic:(bsd linux mac unclesam)' && ret=0 ;; gutenberg) - _arguments $args \ - '-title[search titles (default)]' - '-author[search authors]' - '-num[search etext numbers]' - ;; + _arguments $args \ + '-title[search titles (default)]' + '-author[search authors]' + '-num[search etext numbers]' + ;; imdb) _arguments $args \ '-category=-:category:(All Titles MyMovies People Characters Quotes Bios Plots)' && ret=0 ;; ixquick) - _arguments $args \ - '-search=-:search type:(web pics)' \ - '-lang=-:language:(english dansk deutsch espanol francais italiano nederlands norsk polski portugues suomi svenska turkce jiantizhongwen nihongo fantizhengwen hangul)' + _arguments $args \ + '-search=-:search type:(web pics)' \ + '-lang=-:language:(english dansk deutsch espanol francais italiano nederlands norsk polski portugues suomi svenska turkce jiantizhongwen nihongo fantizhengwen hangul)' ;; jake) _arguments $args \ @@ -386,20 +386,20 @@ case $state in :URL:_urls && ret=0 ;; wayback) - _arguments $args \ - '-syear=-[start search from this year]:year' \ - '-smonth=-:[start search from this month]:month:(jan feb mar apr may jun jul aug sep oct nov dec)' \ - '-sday=-[start search from this day]:number' \ - '-eyear=-[end search in this year]:year' \ - '-emonth=-[end search in this month]:month:(jan feb mar apr may jun jul aug sep oct nov dec)' \ - '-eday=-[end search in this day]:number' \ - '-list[list all pages that match search criteria]' \ - '-dups[show dups]' \ - '-compare[compare pages]' \ - '-pdf[show as PDF]' \ - '-alias=-[how to handle site aliases]:alias:(merge show hide)' \ - '-redir=-[how to handle redirections]:redir:(hide flag show)' \ - '-type=-[file type to search for]:type:(image audio video binary text pdf)' + _arguments $args \ + '-syear=-[start search from this year]:year' \ + '-smonth=-:[start search from this month]:month:(jan feb mar apr may jun jul aug sep oct nov dec)' \ + '-sday=-[start search from this day]:number' \ + '-eyear=-[end search in this year]:year' \ + '-emonth=-[end search in this month]:month:(jan feb mar apr may jun jul aug sep oct nov dec)' \ + '-eday=-[end search in this day]:number' \ + '-list[list all pages that match search criteria]' \ + '-dups[show dups]' \ + '-compare[compare pages]' \ + '-pdf[show as PDF]' \ + '-alias=-[how to handle site aliases]:alias:(merge show hide)' \ + '-redir=-[how to handle redirections]:redir:(hide flag show)' \ + '-type=-[file type to search for]:type:(image audio video binary text pdf)' ;; wetandwild) _arguments \ -- cgit v1.2.3 From d01d0a12899ad73b1072e05e7abcce44ea4273bd Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Mon, 19 Apr 2021 23:05:49 +0200 Subject: 48618: update completions for FreeBSD 13 --- ChangeLog | 7 +++++ Completion/Unix/Command/_date | 2 +- Completion/Unix/Command/_grep | 39 +++++++++++++++++------- Completion/Unix/Command/_netstat | 6 ++++ Completion/Unix/Command/_ping | 66 ++++++++++++++++++++++++++++------------ Completion/Unix/Command/_readelf | 6 +++- Completion/Unix/Command/_uname | 3 ++ 7 files changed, 96 insertions(+), 33 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index c450afd05..7f29a8379 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-04-19 Oliver Kiddle <opk@zsh.org> + + * 48618: Completion/Unix/Command/_date, + Completion/Unix/Command/_grep, Completion/Unix/Command/_netstat, + Completion/Unix/Command/_ping, Completion/Unix/Command/_readelf, + Completion/Unix/Command/_uname: update completions for FreeBSD 13 + 2021-04-18 Bart Schaefer <schaefer@zsh.org> * 47704: Src/builtin.c, Src/params.c, Test/B02typeset.ztst: diff --git a/Completion/Unix/Command/_date b/Completion/Unix/Command/_date index dc447e06d..97c272830 100644 --- a/Completion/Unix/Command/_date +++ b/Completion/Unix/Command/_date @@ -64,7 +64,7 @@ else "*-v+[adjust and print (but don't set) date]:[+-]value[ymwdHMS]" ) ;| - freebsd*|darwin*) + freebsd<-12>.*|darwin*) args+=( '-d+:daylight saving time value' '-t+:minutes west of GMT' diff --git a/Completion/Unix/Command/_grep b/Completion/Unix/Command/_grep index 81516b08a..2dcbff4a3 100644 --- a/Completion/Unix/Command/_grep +++ b/Completion/Unix/Command/_grep @@ -1,6 +1,7 @@ -#compdef grep egrep fgrep bsdgrep zgrep zegrep zfgrep ggrep gegrep gfgrep gzgrep gzegrep gzfgrep bzgrep bzegrep bzfgrep -value-,GREP_OPTIONS,-default- +#compdef grep egrep fgrep bsdgrep rgrep zgrep zegrep zfgrep ggrep gegrep gfgrep gzgrep gzegrep gzfgrep bzgrep bzegrep bzfgrep -value-,GREP_OPTIONS,-default- -local arguments matchers command variant +local command variant +local -a arguments matchers if [[ $service = *GREP_OPT* ]]; then compset -q @@ -27,6 +28,10 @@ if [[ $service != (|g|z|gz|bz)[ef]grep ]]; then $matchers{--basic-regexp,-G}'[use basic regular expression]' ) fi +[[ $service = rgrep ]] || arguments+=( + '(--directories -d -r --recursive)'{--directories=,-d+}'[specify handling of directories]:action on directory:(read skip recurse)' + '(--recursive -r --dereference-recursive -R -d --directories)'{--recursive,-r}'[recurse subdirectories]' +) arguments+=( '(--after-context -A)'{--after-context=,-A+}'[specify lines of trailing context]:lines' @@ -37,7 +42,6 @@ arguments+=( '(--byte-offset -b -c)'{--byte-offset,-b}'[print the byte offset with output lines]' '(--text -a -I)--binary-files=[specify type to assume for binary files]:file type:(binary without-match text)' '(--count -c --byte-offset -b --line-number -n)'{--count,-c}'[only print a count of matching lines]' - '(--directories -d -r --recursive)'{--directories=,-d+}'[specify handling of directories]:action on directory:(read skip recurse)' '(--devices -D)'{--devices=,-D+}'[specify handling of devices, FIFOs and sockets]:action on device:(read skip)' '(1)*'{--regexp=,-e+}'[specify pattern]:pattern' '(1)*'{--file=,-f+}'[specify pattern file]:file:_files' @@ -53,11 +57,10 @@ arguments+=( '(--line-number -n -c)'{--line-number,-n}'[prefix output with line numbers]' '(--only-matching -o --files-with-matches -l --files-without-match -L)'{--only-matching,-o}'[show only matching part of line]' '(--quiet --silent -q)'{--quiet,--silent,-q}'[suppress normal output]' - '(--recursive -r --dereference-recursive -R -d --directories)'{--recursive,-r}'[recurse subdirectories]' '*--include=[examine files matching specified pattern]:file pattern' '*--exclude=[skip files matching specified pattern]:file pattern' '*--exclude-dir=[skip directories matching specified pattern]:directory pattern' - '(--no-messages -s)'{--no-messages,-s}'[suppress messages about unreadable]' + '(--no-messages -s)'{--no-messages,-s}'[suppress messages about unreadable or non-existent files]' '(--version -V)'{--version,-V}'[display version info]' '(--invert-match -v)'{--invert-match,-v}'[select non-matching lines]' '(--word-regexp -w --line-regexp -x)'{--word-regexp,-w}'[force pattern to match only whole words]' @@ -72,6 +75,12 @@ case $variant:$OSTYPE in $matchers{--perl-regexp,-P}'[use perl regular expression]' ) ;| + *:openbsd*|unix:freebsd*) + arguments=( # argument to context is optional and after = only + ${arguments:#((#s)|*\))-(C|-context)*} + '(--context -C)'{--context=-,-C-}'[specify lines of context]::lines' + ) + ;| (gnu:*|gpl2:(free|net)bsd*)) arguments+=( '*--exclude-from=[skip files matching pattern in specified file]:file:_files' @@ -85,15 +94,15 @@ case $variant:$OSTYPE in '(-Z --decompress -J --bz2decompress)'{-Z,--decompress}"[decompress gzip'ed input before searching]" ) ;| - gpl2:darwin*) + (gpl2:darwin*|unix:freebsd*)) arguments+=( - '(-p -S)-O[follow symlinks on the command line]' - '(-O -S)-p[do not follow symlinks]' - '(-O -p)-S[follow all symlinks]' + '(-p -S)-O[recurse symlinks on the command line]' + "!(-O -S)-p[don't recurse symlinks]" + '(-O -p)-S[recurse all symlinks]' '*--include-dir=[only search directories matching specified pattern]:directory pattern' ) ;| - (gnu:*|gpl2:netbsd*)) + (gnu:*|gpl2:netbsd*|unix:freebsd*)) arguments+=( '(--null -Z --no-filename -h)'{--null,-Z}'[print 0 byte after each filename]' ) @@ -106,6 +115,15 @@ case $variant:$OSTYPE in '(--recursive -r --dereference-recursive -R -d --directories)'{--dereference-recursive,-R}'[recurse subdirectories, following symlinks]' ) ;; + unix:freebsd*) + arguments+=( + '!(-U --binary --binary-files)'{-U,--binary} + '--mmap[use mmap(2) instead of read(2) to read input]' + ) + [[ $service = rgrep ]] || arguments+=( + '(--recursive -r -d --directories)-R[recurse subdirectories]' + ) + ;; gpl2:*) arguments=( ${${arguments:#*\)-r}/\)-r/\)-R} ) ;; *:openbsd*) arguments=( @@ -122,4 +140,3 @@ case $variant:$OSTYPE in esac _arguments -S -s $arguments[@] - diff --git a/Completion/Unix/Command/_netstat b/Completion/Unix/Command/_netstat index 84d5dc2f2..aa6c92fde 100644 --- a/Completion/Unix/Command/_netstat +++ b/Completion/Unix/Command/_netstat @@ -303,6 +303,12 @@ case $OSTYPE in memory+=( $Xopt) statistics+=( $Xopt ) pcb+=( $Mopts $popt ) ;; + freebsd<13->.*) + sockets+=( + '-c[show TCP stack used for each session]' + '-C[show TCP congestion control algorithm and diagnostic]' + ) + ;& freebsd<11->.*) routing+=( '-F+[show specified routing table]:routing table' ) bpf=( '-z[reset statistic counters after displaying them]' ) diff --git a/Completion/Unix/Command/_ping b/Completion/Unix/Command/_ping index 274204264..e69173430 100644 --- a/Completion/Unix/Command/_ping +++ b/Completion/Unix/Command/_ping @@ -11,7 +11,6 @@ case ${variant}:${${service#ping}:-4} in args+=( '-d[set SO_DEBUG on the socket]' '-n[show network addresses as numbers]' - '-M+[define mtu discovery]:mtu discovery:(do dont want)' '-v[verbose output]' ) ;| @@ -35,7 +34,7 @@ case ${variant}:${${service#ping}:-4} in iputils:*|solaris:*|((free|net)bsd|darwin|dragonfly)*:4) args+=( '-r[bypass normal routing tables]' ) ;| - iputils:*|((free|net)bsd|darwin|dragonfly)*:4) + (iputils|freebsd<13->.*):*|(freebsd<-12>.|netbsd|darwin|dragonfly)*:4) args+=( '-a[audible bell for each packet]' ) ;| iputils:*|netbsd*:4|openbsd*) @@ -49,6 +48,9 @@ case ${variant}:${${service#ping}:-4} in (*bsd|darwin|dragonfly)*) args+=( '-I+[specify source interface for multicast packets]:interface:_net_interfaces' ) ;| + freebsd<13->.*|openbsd*) + args+=( '-H[try reverse-lookups of addresses]' ) + ;| freebsd*|darwin*|dragonfly*|netbsd*:6) args+=( '-S+[specify source address]:source address' ) ;| @@ -58,10 +60,13 @@ case ${variant}:${${service#ping}:-4} in (*bsd|darwin|dragonfly)*:4) args+=( "-D[set the don't fragment bit]" ) ;| + (freebsd|openbsd|darwin)*:6) + args+=( '-D[disable IPv6 fragmentation]' ) + ;| ((free|net)bsd|darwin|dragonfly)*:4) args+=( '-Q[somewhat quiet]') ;| - freebsd*:6|darwin*:6|solaris*|netbsd*) + freebsd<-12>.*:6|darwin*:6|solaris*|netbsd*) args+=( '*-g+[specify gateway to use as the next hop to the destination]:gateway:_hosts' ) @@ -71,10 +76,14 @@ case ${variant}:${${service#ping}:-4} in ;| ((free|net)bsd|darwin|dragonfly)*:6) args+=( - '-a+[generate ICMPv6 Node Information Node Addresses query]:address type:(a c g s l A)' '-b+[set socket buffer size]:buffer size' - '-H[try reverse-lookups of IPv6 addresses]' '-N[probe node information multicast group address]' + ) + ;| + (freebsd<-12>.|netbsd|darwin|dragonfly)*:6) + args+=( + '-a+[generate ICMPv6 Node Information Node Addresses query]:address type:(a c g s l A)' + '-H[try reverse-lookups of IPv6 addresses]' '(-s)-t[generate ICMPv6 Node Information supported query types query]' '(-s)-w[generate ICMPv6 Node Information DNS Name query]' '!(-s)-W' ) @@ -91,30 +100,54 @@ case ${variant}:${${service#ping}:-4} in '-N+[specify a next-hop router that the probe packet should go through]:router:_hosts' ) ;| - (freebsd|darwin|dragonfly)*:4) + freebsd<13->.*:6|(freebsd|darwin|dragonfly)*:4) args+=( '-A[audible bell for no packet]' + '-t+[specify timeout after which ping exits]:deadline (seconds)' + '-W+[specify time to wait for a response]:wait time (ms)' + ) + ;| + (freebsd|darwin|dragonfly)*:4) + args+=( '-G+[specify maximum size for ICMP payload for sweeping pings]:size' '-g+[specify minimum size for ICMP payload for sweeping pings]:size [0]' '-h+[specify size increment for ICMP payload for sweeping pings]:size [1]' '-M+[use ICMP_MASKREQ or ICMP_TSTAMP instead of ICMP_ECHO]:ICMP:(mask time)' '-m+[set IP Time to Live for outgoing packets]:ttl' '-T+[set IP Time to Live for multicasted packets]:ttl' - '-t+[specify timeout after which ping exits]:deadline (seconds)' - '-W+[specify time to wait for a response]:wait time (ms)' '-z+[specify type of service]:type of service' ) ;| - (freebsd|openbsd|darwin)*:6) - args+=( '-D[disable IPv6 fragmentation]' ) - ;| - (freebsd|darwin)*:6) + (freebsd<-12>.*|darwin*):6) args+=( '-R[audible bell for no packet]' '-r[audible bell for each packet]' ) ;| - freebsd*:6) + (iputils|freebsd<13->.*):4) + args+=( + '(-F -N)-4[use IPv4 only]' + '-6[use IPv6 only]' + ) + ;| + freebsd<13->.*:4) + args+=( + '-C+[add an 802.1p Ethernet Priority Code Point when sending a packet]:pcp:(-1 0 1 2 3 4 5 6 7)' + ) + ;| + freebsd<13->.*:6) + args+=( + '*-e+[specify gateway to use as the next hop to the destination]:gateway:_hosts' + '-k+[generate ICMPv6 Node Information Node Addresses query]:address type:(a c g s l A)' + '(-s)-O[generate ICMPv6 Node Information supported query types query]' + '*-u[suppress fragmentation to minimum MTU]' + '(-s)-Y[generate ICMPv6 Node Information DNS Name query with old packet format]' + '(-s)-y[generate ICMPv6 Node Information DNS Name query]' + '-E[enable transport-mode IPsec encapsulated security payload]' + '-Z[enables transport-mode IPsec authentication header]' + ) + ;| + freebsd<-12>.*:6) args+=( '-x+[specify time to wait for a response]:wait time (ms)' '-X+[specify timeout after which ping exits]:deadline (seconds)' @@ -154,19 +187,12 @@ case ${variant}:${${service#ping}:-4} in ;; openbsd*) args+=( - '-H[try reverse-lookups of addresses]' '-E[audible bell for no packet]' '-e[audible bell for each packet]' '-T+[change TOS value]:TOS value:(critical inetcontrol lowdelay netcontrol throughput reliability ef af cs)' '-V+[specify routing table to be used]:routing table' ) ;; - iputils:4) - args+=( - '(-F -N)-4[use IPv4 only]' - '-6[use IPv6 only]' - ) - ;| iputils:*) args+=( '-A[adaptive]' diff --git a/Completion/Unix/Command/_readelf b/Completion/Unix/Command/_readelf index 42094742e..edabc3da1 100644 --- a/Completion/Unix/Command/_readelf +++ b/Completion/Unix/Command/_readelf @@ -43,6 +43,11 @@ case $variant in '--dyn-syms[show dynamic symbol table]' ) ;| + elfutils|elftoolchain) + args+=( + '(-z --decompress)'{-z,--decompress}'[show compression information; decompress before dumping data]' + ) + ;| binutils) args+=( \*{-R,--relocated-dump=}"[dump contents of specified section as relocated bytes]:section:($sections)" @@ -60,7 +65,6 @@ case $variant in '--elf-section[used specified section as ELF input data]::section' '(-e --exception)'{-e,--exception}'[show sections for exception handling]' '(-N --numeric-addresses)'{-N,--numeric-addresses}"[don't find symbol names for addresses in DWARF data]" - '(-z --decompress)'{-z,--decompress}'[show compression information; decompress before dumping data]' '(--symbols)-s[show symbol table]' '(-s)--symbols=-[show symbol table]::section:(.dynsym .symtab)' '(--notes)-n[show core notes (if present)]' diff --git a/Completion/Unix/Command/_uname b/Completion/Unix/Command/_uname index 31af91eb7..0e55ba1c3 100644 --- a/Completion/Unix/Command/_uname +++ b/Completion/Unix/Command/_uname @@ -68,6 +68,9 @@ else '-K[print FreeBSD kernel version]' '-U[print FreeBSD user environment version]' ) + ;| + freebsd<13->.*) + args+=( "-b[print kernel's linker-generated build-id]" ) ;; solaris*) args+=( -- cgit v1.2.3 From 79258d090c1e270e348e9b3bdb1ace7e4622d709 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Mon, 19 Apr 2021 23:07:51 +0200 Subject: 48619: complete inventory plugins in assignments to ANSIBLE_INVENTORY_ENABLED --- ChangeLog | 3 +++ Completion/Unix/Command/_ansible | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 7f29a8379..8afdef958 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-04-19 Oliver Kiddle <opk@zsh.org> + * 48619: Completion/Unix/Command/_ansible: complete inventory + plugins in assignments to ANSIBLE_INVENTORY_ENABLED + * 48618: Completion/Unix/Command/_date, Completion/Unix/Command/_grep, Completion/Unix/Command/_netstat, Completion/Unix/Command/_ping, Completion/Unix/Command/_readelf, diff --git a/Completion/Unix/Command/_ansible b/Completion/Unix/Command/_ansible index 9de9b6675..c81308586 100644 --- a/Completion/Unix/Command/_ansible +++ b/Completion/Unix/Command/_ansible @@ -1,4 +1,4 @@ -#compdef ansible ansible-config ansible-console ansible-doc ansible-galaxy ansible-inventory ansible-playbook ansible-pull ansible-vault -value-,ANSIBLE_STDOUT_CALLBACK,-default- +#compdef ansible ansible-config ansible-console ansible-doc ansible-galaxy ansible-inventory ansible-playbook ansible-pull ansible-vault -value-,ANSIBLE_STDOUT_CALLBACK,-default- -value-,ANSIBLE_INVENTORY_ENABLED,-default- local curcontext="$curcontext" plug plugvar subcmd ign ret=1 local -a args state line expl gactions @@ -9,6 +9,10 @@ case $service in plug=callback state=plugins ;; + *,ANSIBLE_INVENTORY_ENABLED,*) + plug=inventory + state=plugins + ;; ansible|ansible-console|ansible-doc|ansible-playbook) args=( \*{-M+,--module-path=}'[specify path to modules]:module path:_dir_list' @@ -125,6 +129,7 @@ case $service in '(-y --yaml --vars --graph)--toml[use TOML format instead of JSON]' '(-y --yaml)--vars[add variables to the graph display]' '(-y --yaml --toml --vars --graph)'{-y,--yaml}'[use YAML format instead of JSON]' + ':host or group:->hosts' ) ;; ansible-galaxy) @@ -238,7 +243,7 @@ case $state in ;; galaxy) ign='' - gactions=( delete import info init install list login remove search setup ) + gactions=( delete import info init install list remove search setup ) case ${(j.:.)line[1,3]} in (role|collection):*:*) subcmd="${line[1]}-${line[2]}" @@ -326,11 +331,6 @@ case $state in '--role-name=[specify name the role should have]:role' ) ;; - role-login) - args+=( - '--github-token=[identify with github token rather than username and password]' - ) - ;; collection-build) args+=( '--output-path=[specify path in which the collection is built to]:path [.]:_directories' -- cgit v1.2.3 From 92a7b7f41716bec0565582b39b0493de6b8b0a08 Mon Sep 17 00:00:00 2001 From: André Kugland <kugland@gmail.com> Date: Sun, 18 Apr 2021 23:00:47 -0300 Subject: github/zsh-completions #792: added completions for opus-tools (opusenc, opusdec & opusinfo) --- ChangeLog | 3 ++ Completion/Unix/Command/_opustools | 71 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 Completion/Unix/Command/_opustools (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 8afdef958..7cf9ec4e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-04-19 Oliver Kiddle <opk@zsh.org> + * André Kugland: github/zsh-completions #792: + Completion/Unix/Command/_opustools: new opus-tools completion + * 48619: Completion/Unix/Command/_ansible: complete inventory plugins in assignments to ANSIBLE_INVENTORY_ENABLED diff --git a/Completion/Unix/Command/_opustools b/Completion/Unix/Command/_opustools new file mode 100644 index 000000000..c860a170f --- /dev/null +++ b/Completion/Unix/Command/_opustools @@ -0,0 +1,71 @@ +#compdef opusenc opusdec opusinfo + +case $service in + opusenc) + _arguments -S \ + '1:input file:_files -g "*.(#i)(wav|flac|ogg|aif(|f))(-.)"' \ + '2:output file:_files -g "*.(#i)opus(-.)"' \ + '(- 1 *)'{-h,--help}'[show usage information]' \ + '(- 1 *)'{-V,--version}'[show version information]' \ + '(- 1 *)--help-picture[show help on attaching album art]' \ + '--quiet[enable quiet mode]' \ + '--bitrate[set target bitrate per channel]:target bitrate per channel (kbps) (6-256)' \ + '--comp[set encoding complexity]:encoding complexity (1-10) [10]:(1 2 3 4 5 6 7 8 9 10)' \ + '--cvbr[use constrained variable bitrate encoding]' \ + '--downmix-mono[downmix to mono]' \ + '--downmix-stereo[downmix to stereo (if >2 channels)]' \ + '--expect-loss[set expected packet loss]:expected packet loss (%) (0-100) [0]' \ + '--framesize[set maximum frame size]:maximum frame size (milliseconds) [20]:(2.5 5 10 20 40 60)' \ + '--hard-cbr[use hard constant bitrate encoding]' \ + '--max-delay[set maximum container delay]:maximum container delay (milliseconds) (0-1000) [1000]' \ + '--music[tune low bitrates for music (override automatic detection)]' \ + '--no-phase-inv[disable use of phase inversion for intensity stereo]' \ + '--speech[tune low bitrates for speech (override automatic detection)]' \ + '--vbr[use variable bitrate encoding (default)]' \ + '--album[set album or collection]:album or collection' \ + '--date[set date of track]:date of track (YYYY, YYYY-MM, or YYYY-MM-DD):_dates -f "%F"' \ + '--discard-comments[discard metadata when transcoding]' \ + '--discard-pictures[discard pictures when transcoding]' \ + '--padding[reserve extra bytes for metadata]:padding size (bytes) [512]' \ + '--title[set track title]:track title' \ + '--tracknumber[set track number]:track number' \ + '*--artist[add artist or author]:artist or author' \ + '*--comment[add an extra comment]:comment (tag=val)' \ + '*--genre[add genre]:genre' \ + '*--picture[attach album art]:album art:_files -g "*.(#i)(jp(|e)g|png|gif)(-.)"' \ + '--ignorelength[ignore the data length in RIFF wav headers]' \ + '--raw-bits[set bits per sample for raw input]:bits per sample [16]:(8 16 24)' \ + '--raw-chan[set number of channels for raw input]:number of channels (1-255) [2]' \ + '--raw-endianness[set endianness for raw input]:endianness:(("0"\:"big endian" "1"\:"little endian"))' \ + '--raw-rate[set sampling rate for raw input]:sample rate (Hz) (100-768000) [48000]' \ + '--raw[interpret input as raw PCM data without headers]' \ + '--serial[force use of a specific stream serial number]:stream serial number' \ + '--save-range[save check values for every frame to a file]:output for check values:_files' \ + '--set-ctl-int[pass encoder control]:encoder control' + ;; + opusdec) + _arguments -S \ + '1:input file:_files -g "*.(#i)opus(-.)"' \ + '2::output file:_files -g "*.(#i)wav(-.)"' \ + '(- 1 *)'{-h,--help}'[show usage information]' \ + '(- 1 *)'{-V,--version}'[show version information]' \ + '(- 1 *)--help-picture[show help on attaching album art]' \ + '--quiet[enable quiet mode]' \ + '--rate[force decoding at given sample rate]:sample rate (Hz) (8000-192000)' \ + '--force-stereo[force decoding to stereo]' \ + '--gain[adjust output volume]:gain (dB) (negative is quieter)' \ + '--no-dither[do not dither 16-bit output]' \ + '--float[output 32-bit floating-point samples]' \ + '--force-wav[force RIFF wav header on output]' \ + '--packet-loss[simulate random packet loss]:packet loss probability (%) (0-100)' \ + '--save-range[save check values for every frame to a file]:output for check values:_files' + ;; + opusinfo) + _arguments -s -S \ + '(- 1 *)-h[show usage information]' \ + '(- 1 *)-V[show version information]' \ + '*-q[make the output quieter]' \ + '*-v[make the output more verbose]' \ + '*:opus file:_files -g "*.(#i)opus(-.)"' + ;; +esac -- cgit v1.2.3 From ccc9cff9e244725ed604fd1ac20e4958339e3885 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> Date: Wed, 28 Apr 2021 22:35:51 +0900 Subject: 48702: _pandoc: don't use cache, multiple extensions of format, etc. --- ChangeLog | 5 + Completion/Unix/Command/_pandoc | 375 ++++++++++++---------------------------- 2 files changed, 119 insertions(+), 261 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 72c48a18b..17a385fcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-04-28 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + + * 48702: Completion/Unix/Command/_pandoc: do not use cache, + support two or more extensions of format, and other fixes + 2021-04-21 Daniel Shahaf <d.s@daniel.shahaf.name> * 48606 + 48607 + unposted test: Functions/Math/zmathfunc, diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index 0c0672aaa..2ff481e32 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -1,127 +1,37 @@ #compdef pandoc -# {{{ helper: cache policy for available formats and other variables -(( $+functions[__pandoc_cache_policy] )) || -__pandoc_cache_policy(){ - local cache_file="$1" - if [[ -f "${commands[pandoc]}" && -f "${cache_file}" ]]; then - # if the manifest file is newer then the cache: - if [[ "${commands[pandoc]}" -nt "${cache_file}" ]]; then - return 0 - else - return 1 - fi +# {{{ input or output formats with optional extensions +# required option: -T (input|output) +(( $+functions[_pandoc_format] )) || +_pandoc_format() { + local -a inout expl + zparseopts -D -E - T:=inout + local format=${PREFIX%%(+|-)*} + if compset -P '*(+|-)'; then + local pm=${IPREFIX[-1]} # '+' or '-' + local -a extensions=(${${$(pandoc --list-extensions=$format):#$pm*}#(+|-)}) + _wanted extensions expl 'extension' compadd -S '+' -r '-+ ' -a extensions else - return 0 + local -a formats=( $(pandoc --list-$inout[2]-formats) ) + _wanted formats expl 'format' compadd -S '+' -r '-+ ' -a formats fi } # }}} -# {{{ choose a format among supported output format -(( $+functions[_pandoc_output_format] )) || -_pandoc_output_format(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - if _cache_invalid pandoc_output_formats_simple; then - output_formats_simple=($(pandoc --list-output-formats)) - _store_cache pandoc_output_formats_simple output_formats_simple - else - _retrieve_cache pandoc_output_formats_simple - fi - if _cache_invalid pandoc_output_formats_plus_extensible || _cache_invalid pandoc_output_formats_minus_extensible; then - for f in ${output_formats_simple[*]}; do - for e in $(pandoc --list-extensions=${f}); do - if [[ "${e}" =~ '^\+' ]]; then - output_formats_plus_extensible+=("${f}${e}") - elif [[ "${e}" =~ '^\-' ]]; then - output_formats_minus_extensible+=("${f}${e}") - fi - done - done - _store_cache pandoc_output_formats_minus_extensible output_formats_minus_extensible - _store_cache pandoc_output_formats_plus_extensible output_formats_plus_extensible - else - _retrieve_cache pandoc_output_formats_minus_extensible - _retrieve_cache pandoc_output_formats_plus_extensible - fi - _alternative \ - 'formats_plus:format:{_multi_parts "+" output_formats_plus_extensible}' \ - 'formats_minus:format:{_multi_parts -- "-" output_formats_minus_extensible}' -} -# }}} -# {{{ choose a format among supported input format -(( $+functions[_pandoc_input_format] )) || -_pandoc_input_format(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - if _cache_invalid pandoc_input_formats_simple; then - input_formats_simple=($(pandoc --list-input-formats)) - _store_cache pandoc_input_formats_simple input_formats_simple - else - _retrieve_cache pandoc_input_formats_simple - fi - if _cache_invalid pandoc_input_formats_plus_extensible || _cache_invalid pandoc_input_formats_minus_extensible; then - for f in ${input_formats_simple[*]}; do - for e in $(pandoc --list-extensions=${f}); do - if [[ "${e}" =~ '^\+' ]]; then - input_formats_plus_extensible+=("${f}${e}") - elif [[ "${e}" =~ '^\-' ]]; then - input_formats_minus_extensible+=("${f}${e}") - fi - done - done - _store_cache pandoc_input_formats_minus_extensible input_formats_minus_extensible - _store_cache pandoc_input_formats_plus_extensible input_formats_plus_extensible - else - _retrieve_cache pandoc_input_formats_minus_extensible - _retrieve_cache pandoc_input_formats_plus_extensible - fi - _alternative \ - 'formats_plus:format:{_multi_parts "+" input_formats_plus_extensible}' \ - 'formats_minus:format:{_multi_parts -- "-" input_formats_minus_extensible}' -} -# }}} -# {{{ choose a format among all supported formats +# {{{ all supported formats (( $+functions[_pandoc_all_formats] )) || _pandoc_all_formats(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - if _cache_invalid pandoc_input_formats_simple; then - input_formats_simple=($(pandoc --list-input-formats)) - _store_cache pandoc_input_formats_simple input_formats_simple - else - _retrieve_cache pandoc_input_formats_simple - fi - if _cache_invalid pandoc_output_formats_simple; then - output_formats_simple=($(pandoc --list-output-formats)) - _store_cache pandoc_output_formats_simple output_formats_simple - else - _retrieve_cache pandoc_output_formats_simple - fi - if _cache_invalid pandoc_all_formats; then - all_formats=(${output_formats_simple} ${input_formats_simple}) - all_formats=($(sort -u <<<"${all_formats[*]}")) - _store_cache pandoc_all_formats all_formats - else - _retrieve_cache pandoc_all_formats - fi - _describe "format" all_formats + local -a expl + local -aU formats + formats=( $(pandoc --list-input-formats) $(pandoc --list-output-formats) ) + _wanted formats expl 'format' compadd -a formats } # }}} # {{{ pdf engine choice (( $+functions[_pandoc_pdf_engine] )) || _pandoc_pdf_engine(){ _alternative \ - 'engines:engine:{_values "engine" pdflatex lualatex xelatex wkhtmltopdf weasyprint prince context pdfroff}' \ - 'engine_files:engine:_files' + 'engines:engine:(pdflatex lualatex xelatex latexmk tectonic wkhtmltopdf weasyprint prince context pdfroff)' \ + 'engine-executables:engine executable:_files -g "*(#q*)"' } # }}} # {{{ options to pass to --pdf-engine command @@ -133,121 +43,72 @@ _pandoc_pdf_engine_opts(){ _tex ;; *) - type _${pdf_engine} > /dev/null - if [[ $? == 1 ]]; then - _message "Options for ${pdf_engine}" - fi + _message "Options for ${pdf_engine}" ;; esac } # }}} -# {{{ choose data-dir -(( $+functions[_pandoc_data_dir] )) || -_pandoc_data_dir(){ - _files -/ +# {{{ data-dir specified by --data-dir option, or the default dir +_pandoc_default_dir() { + if (( $+opt_args[--data-dir] )); then + echo ${opt_args[--data-dir]:a} + else + # XXX Some versions of pandoc may output two user data directories: + # ~/.local/share/pandoc or ~/.pandoc + # Here we use only the first one. + pandoc --version | sed -ne 's/.*[Uu]ser data directory: \([^ ]*\).*/\1/p' + fi } -# }}} -# {{{ choose template from data-dir +# {{{ template file in $PWD or data-dir/templates/, or URL (( $+functions[_pandoc_template] )) || _pandoc_template(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - if _cache_invalid pandoc_output_formats_simple; then - output_formats_simple=($(pandoc --list-output-formats)) - _store_cache pandoc_output_formats_simple output_formats_simple - else - _retrieve_cache pandoc_output_formats_simple - fi - local data_dir=${opt_args[--data-dir]} - if [[ -z $data_dir ]]; then - if _cache_invalid pandoc_default_data_dir; then - default_data_dir=$(pandoc --version | sed -ne 's/Default user data directory: \(.*\)/\1/p') - _store_cache pandoc_default_data_dir default_data_dir - else - _retrieve_cache pandoc_default_data_dir - fi - data_dir=${default_data_dir} - fi - _pandoc_template_find_args="-name '*.'${output_formats_simple[1]}" - for ((i = 2; i < ${#output_formats_simple[@]}; i++ )); do - _pandoc_template_find_args=$_pandoc_template_find_args" -or -name '*.'${output_formats_simple[$i]}" - done - templates=($(eval find -L ${data_dir}/templates ${_pandoc_template_find_args} 2>/dev/null | sed -e 's/.*\///' -e 's/\.[^.]*$//')) - if [[ -z "${templates}" ]]; then - templates=default - fi - _describe 'templates from default data-dir' templates + # find output format from '-t format' or '-o xxx.format' + local format=${${(v)opt_args[(i)(-t|--to|-w|--write)]}%%(+|-)*} + [[ -z $format ]] && format=${(v)opt_args[(i)(-o|--output)]:e} + local pat="'*'" # or '*.*' ? + [[ -n $format ]] && pat="'*.$format'" + local template_dir=$(_pandoc_default_dir)/templates + _alternative \ + "local-templates:local template:_files -g $pat" \ + "data-dir-templates:template in data-dir:_files -W $template_dir -g $pat" \ + 'urls: :_urls' } # }}} # {{{ choose highlight-style (( $+functions[_pandoc_highlight_style] )) || _pandoc_highlight_style(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - if _cache_invalid pandoc_highlighting_styles; then - highlighting_styles=($(pandoc --list-highlight-styles)) - _store_cache pandoc_highlighting_styles highlighting_styles - else - _retrieve_cache pandoc_highlighting_styles - fi _alternative \ - 'styles:style:{_values "syntax builting style" ${highlighting_styles[*]}}' \ - 'style_files_here:style:{_files -g "*.theme"}' + 'styles:style:( $(pandoc --list-highlight-styles) )' \ + 'style-files:style file:_files -g "*.theme"' } # }}} -# {{{ choose filter from specified or default data-dir +# {{{ filter file in $PWD, data-dir/filters/ or $PATH (( $+functions[_pandoc_filter] )) || _pandoc_filter(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - local data_dir=${opt_args[--data-dir]} - if [[ -z $data_dir ]]; then - if _cache_invalid pandoc_default_data_dir; then - default_data_dir=$(pandoc --version | sed -ne 's/Default user data directory: \(.*\)/\1/p') - _store_cache pandoc_default_data_dir default_data_dir - else - _retrieve_cache pandoc_default_data_dir - fi - data_dir=${default_data_dir} - fi - local filters_dir=$data_dir"/filters" + local filters_dir=$(_pandoc_default_dir)/filters _alternative \ - 'local_filter:filter:{_files -g "*.lua"}' \ - 'data_dir_filter:filter:{_files -W filters_dir -g "*.lua"}' + 'local-filters:local filter:_files' \ + 'data-dir-filters:filter in data-dir:_files -W filters_dir' \ + 'commands: : _command_names -e' } # }}} -# {{{ choose lua filter from specified or default data-dir +# {{{ lua filter in $PWD or data-dir/filters/ (( $+functions[_pandoc_lua_filter] )) || _pandoc_lua_filter(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - local data_dir=${opt_args[--data-dir]} - if [[ -z $data_dir ]]; then - if _cache_invalid pandoc_default_data_dir; then - default_data_dir=$(pandoc --version | sed -ne 's/Default user data directory: \(.*\)/\1/p') - _store_cache pandoc_default_data_dir default_data_dir - else - _retrieve_cache pandoc_default_data_dir - fi - data_dir=${default_data_dir} - fi - local filters_dir=$data_dir"/filters" + local filters_dir=$(_pandoc_default_dir)/filters _alternative \ - 'local_filter:filter:{_files -g "(#q*)(.)"}' \ - 'data_dir_filter:filter:{_files -W filters_dir -g "(#q*)(.)"}' - } + 'local-filters:local filter:_files -g "*.lua"' \ + 'data-dir-filters:filter in data-dir:_files -W filters_dir -g "*.lua"' +} +# }}} +# {{{ default file in $PWD or data-dir/defaults/ +(( $+functions[_pandoc_defaults_file] )) || +_pandoc_defaults_file() { + local defaults_dir=$(_pandoc_default_dir)/defaults + _alternative \ + 'local-defaults:default file:_files -g "*.yaml"' \ + 'data-dir-defaults:default in data-dir:_files -W defaults_dir -g "*.yaml"' +} # }}} # {{{ choose reference location (( $+functions[_pandoc_reference_location] )) || @@ -261,23 +122,12 @@ _pandoc_reference_location(){ _describe 'location' policies } # }}} -# --base-header-level must be 1-5: https://github.com/jgm/pandoc/blob/34d8ffbcfc33b86766ff7229be4d8a0d1fbffb50/src/Text/Pandoc/App.hs#L867 # {{{ choose top level division (( $+functions[_pandoc_top_level_division] )) || _pandoc_top_level_division(){ _values 'top level division' default section chapter part } # }}} -# {{{ choose header levels -(( $+functions[_pandoc_header_levels] )) || -_pandoc_header_levels(){ - _values -s , "number" 1 2 3 4 5 6 -} -(( $+functions[_pandoc_header_level] )) || -_pandoc_header_level(){ - _values "number" 1 2 3 4 5 6 -} -# }}} # {{{ choose email obfusication (( $+functions[_pandoc_email_obfusication] )) || _pandoc_email_obfusication(){ @@ -328,67 +178,74 @@ _pandoc_track_changes() { # }}} # The real thing -_arguments -C \ - {-f,-r,--from=,--read=}'[specify input format]:format:_pandoc_input_format' \ - {-t,-w,--to=,--write=}'[specify output format]:format:_pandoc_output_format' \ - {-o,--output=}'[write output to FILE instead of stdout]:file:_files' \ - '--data-dir=[specify the user data directory to search for pandoc data files]:dir:_pandoc_data_dir' \ - '--base-header-level=[specify the base level for headers (defaults to 1)]:number:_pandoc_header_level' \ - '--strip-empty-paragraphs[deprecated. Use the +empty_paragraphs extension instead]: :' \ +_arguments -s \ + {-f+,-r+,--from=,--read=}'[specify input format]: :_pandoc_format -T input' \ + {-t+,-w+,--to=,--write=}'[specify output format]: :_pandoc_format -T output' \ + {-o+,--output=}'[write output to FILE instead of stdout]:file:_files' \ + '--data-dir=[specify the user data directory to search for pandoc data files]:data directory:_files -/' \ + {-d+,--defauls=}'[read default from YAMAL file]: :_pandoc_defaults_file' \ + '--shift-heading-level-by=[shift heading levels by specified number]:positive or negative integer: ' \ + '!--base-header-level=[(deprecated) specify the base level for headers]:number (default 1):(1 2 3 4 5)' \ + '!--strip-empty-paragraphs[deprecated. Use the +empty_paragraphs extension instead]' \ '--indented-code-classes=[classes to use for indented code blocks]:class:{_message "Classes separated with ,"}' \ - '*--filter=[specify an executable to be used as a filter transforming the pandoc AST after the input is parsed and before the output is written]:file:_pandoc_filter' \ - '*--lua-filter=[transform the document in a similar fashion as JSON filters (see --filter), but use pandoc'"'"'s built-in lua filtering system]:file:_pandoc_lua_filter' \ - {-p,--preserve-tabs}'[preserve tabs instead of converting them to spaces]: :' \ + '--default-image-extension=[specify a default extension to use when image paths/URLs have no extension]:extension: ' \ + '--file-scope[parse each file individually before combining for multifile documents]' \ + {\*-F+,\*--filter=}'[specify an executable to be used as a filter transforming the pandoc AST after the input is parsed and before the output is written]: :_pandoc_filter' \ + {\*-L+,\*--lua-filter=}"[transform the document by using pandoc's built-in lua filtering system]: :_pandoc_lua_filter" \ + {\*-M+,\*--metadata=}'[set the metadata field KEY to the value VALUE]:key\:value: ' \ + '*--metadata_file=[read metadata from file]:YAML or JSON file:_files' \ + {-p,--preserve-tabs}'[preserve tabs instead of converting them to spaces]' \ '--tab-stop=[specify the number of spaces per tab (default is 4)]:number:{_message -r "choose a number equals to or greater then 1"}' \ '--track-changes=[specifies what to do with insertions, deletions, and comments produced by the MS Word "Track Changes" feature]: :_pandoc_track_changes' \ - '--file-scope[parse each file individually before combining for multifile documents]: :' \ - '--extract-media=[extract images and other media contained in or linked from the source document to the path DIR]:dir:{_dir_list}' \ - {-s,--standalone}'[produce output with an appropriate header and footer]: :' \ + '--extract-media=[extract media in source document to specified directory]:directory:_files -/' \ + '--abbreviations=[specifies a custom abbreviations file]:file:_files ' \ + {-s,--standalone}'[produce output with an appropriate header and footer]' \ '--template=[use FILE as a custom template for the generated document. Implies --standalone]: :_pandoc_template' \ - {\*-M,\*--metadata=}'[set the metadata field KEY to the value VALUE]:key\:value: ' \ - {\*-V,\*--variable=}'[set the variable KEY to the value VALUE]:key\:value: ' \ - '(- :)'{-D,--print-default-template=}'[print the system default template for an output]:format:_pandoc_output_format' \ + {\*-V+,\*--variable=}'[set the variable KEY to the value VALUE]:key\:value: ' \ + '(- :)'{-D+,--print-default-template=}'[print the system default template for an output]:format:( $(pandoc --list-output-formats) )' \ '(- :)--print-default-data-file=[print a system default data file]:file: ' \ - '(- :)--print-highlight-style=[prints a JSON version of a highlighting style]:style|file: ' \ - '--dpi=[specify the dpi (dots per inch) value for conversion from pixels to inch/centimeters and vice versa]:number: ' \ '--eol=[manually specify line endings (crlf|lf|native)]: :_pandoc_eol' \ + '--dpi=[specify the dpi (dots per inch) value for conversion from pixels to inch/centimeters and vice versa]:number: ' \ '--wrap=[determine how text is wrapped in the output (the source code, not the rendered version)]: :_pandoc_wrap ' \ '--columns=[specify length of lines in characters (default 72)]:number: ' \ - '--strip-comments[strip out HTML comments in the Markdown or Textile source]: : ' \ - {--toc,--table-of-contents}'[include an automatically generated table of contents]: : ' \ + {--toc,--table-of-contents}'[include an automatically generated table of contents]' \ '--toc-depth=[specify the number of section levels to include in the table of contents]:number:{_message -r "choose a number equals to or greater then 1"}' \ - '--no-highlight[disables syntax highlighting for code blocks and inlines]: : ' \ + '--strip-comments[strip out HTML comments in the Markdown or Textile source]' \ + '--no-highlight[disables syntax highlighting for code blocks and inlines]' \ '--highlight-style=[specifies the coloring style to be used in highlighted source code]:style|file:_pandoc_highlight_style' \ + '(- :)--print-highlight-style=[prints a JSON version of a highlighting style]: :_pandoc_highlight_style' \ '--syntax-definition=[load a KDE XML syntax definition file]:file:{_files -g "*.xml"}' \ - {\*-H,\*--include-in-header=}'[include contents of FILE, verbatim, at the end of the header, implies --standalone]:file:_files' \ - {\*-B,\*--include-before-body=}'[include contents of FILE, verbatim, at the beginning of the document body, implies --standalone]:file:_files' \ - {\*-A,\*--include-end-body=}'[include contents of FILE, verbatim, at the end of the document body, implies --standalone]:file:_files' \ + {\*-H+,\*--include-in-header=}'[include contents of FILE, verbatim, at the end of the header, implies --standalone]:file:_files' \ + {\*-B+,\*--include-before-body=}'[include contents of FILE, verbatim, at the beginning of the document body, implies --standalone]:file:_files' \ + {\*-A+,\*--include-end-body=}'[include contents of FILE, verbatim, at the end of the document body, implies --standalone]:file:_files' \ '--resource-path=[list of paths to search for images and other resources]:searchpath:_dir_list' \ '--request-header=[set the request header NAME to the value VAL when making HTTP requests]:name\:val: ' \ - '--self-contained[produce a standalone HTML file with no external dependencies, using data: URIs to incorporate the contents of linked scripts, stylesheets, images, and videos. Implies --standalone]: : ' \ - '--html-q-tags[use <q> tags for quotes in HTML]: : ' \ - '--ascii[use only ASCII characters in output, supported only for HTML and DocBook output]: : ' \ - '--reference-links[use reference-style links, rather than inline links]: : ' \ + '--no-check-certificate[disable the certificate verification]' \ + '--self-contained[produce a standalone HTML file with no external dependencies, using data: URIs to incorporate the contents of linked scripts, stylesheets, images, and videos. Implies --standalone]' \ + '--html-q-tags[use <q> tags for quotes in HTML]' \ + '--ascii[use only ASCII characters in output, supported only for HTML and DocBook output]' \ + '--reference-links[use reference-style links, rather than inline links]' \ '--reference-location=[specify where footnotes (and references, if reference-links is set) are placed (block|section|document)]: :_pandoc_reference_location' \ - '--atx-headers[use ATX-style headers in Markdown and AsciiDoc output]: : ' \ + '--markdown-headings[specify style for level1 and 2 headings in markdown output]:style (default atx):(setext atx)' \ + '!--atx-headers[use ATX-style headers in Markdown and AsciiDoc output]' \ '--top-level-division=[treat top-level headers as the given division type in LaTeX, ConTeXt, DocBook, and TEI output]: :_pandoc_top_level_division' \ - {-N,--number-sections}'[number section headings in LaTeX, ConTeXt, HTML, or EPUB output]: : ' \ - '--number-offset=[offset for section headings in HTML output (ignored in other output formats)]: :_pandoc_header_levels' \ - '--listings[use the listings package for LaTeX code blocks]: : ' \ - {-i,--incremental}'[make list items in slide shows display incrementally (one by one)]: : ' \ - '--slide-level=[specifies that headers with the specified level create slides (for beamer, s5, slidy, slideous, dzslides)]: :_pandoc_header_levels' \ - '--section-divs[wrap sections in <section> tags (or <div> tags for html4)Use the section-divs package for LaTeX code blocks]: : ' \ + {-N,--number-sections}'[number section headings in LaTeX, ConTeXt, HTML, or EPUB output]' \ + '--number-offset=[offset for section headings in HTML output (ignored in other output formats)]:number[number,...] (default 0): ' \ + '--listings[use the listings package for LaTeX code blocks]' \ + {-i,--incremental}'[make list items in slide shows display incrementally (one by one)]' \ + '--slide-level=[specifies that headers with the specified level create slides (for beamer, s5, slidy, slideous, dzslides)]:slide level:(1 2 3 4 5 6)' \ + '--section-divs[wrap sections in <section> tags (or <div> tags for html4)Use the section-divs package for LaTeX code blocks]' \ '--email-obfusication=[treat top-level headers as the given division type in LaTeX, ConTeXt, DocBook, and TEI output (none|javascript|references)]: :_pandoc_email_obfusication' \ - '--default-image-extension=[specify a default extension to use when image paths/URLs have no extension]:extension: ' \ '--id-prefix=[specify a prefix to be added to all identifiers and internal links in HTML and DocBook output]:string: ' \ - {-T,--title-prefix=}'[specify STRING as a prefix at the beginning of the title that appears in the HTML header]:string: ' \ - {\*-c,\*--css=}'[link to a CSS style sheet]:url: ' \ + {-T+,--title-prefix=}'[specify STRING as a prefix at the beginning of the title that appears in the HTML header]:string: ' \ + {\*-c+,\*--css=}'[link to a CSS style sheet]: :_urls' \ '--reference-doc=[use the specified file as a style reference in producing a docx or ODT file]:file: ' \ - '--epub-subdirectory=[specify the subdirectory in the OCF container that is to hold the EPUB-specific contents]:dir:{_files -/}' \ + '--epub-subdirectory=[specify the subdirectory in the OCF container that is to hold the EPUB-specific contents]:directory:_files -/' \ '--epub-cover-image=[use the specified image as the EPUB cover]:file:_files' \ '--epub-metadata=[look in the specified XML file for metadata for the EPUB]:file:{_files -g "*.xml"}' \ '*--epub-embed-font=[embed the specified font in the EPUB]:file:_files ' \ - '--epub-chapter-level=[specify the header level at which to split the EPUB into separate "chapter" files]:number:_pandoc_header_level' \ + '--epub-chapter-level=[specify the header level at which to split the EPUB into separate "chapter" files]:number:(1 2 3 4 5 6)' \ + '--ipynb-output=[specify how to tread ipynb output cells]:method:(all none best)' \ '--pdf-engine=[use the specified engine when producing PDF output]:program:_pandoc_pdf_engine' \ '*--pdf-engine-opt=[use the given string as a command-line argument to the pdf-engine]:string:_pandoc_pdf_engine_opts' \ '*--bibliography=[set the bibliography field in the document'"'"'s metadata to FILE]:file:{_files -g "*.(bib|bibtex|copac|json|yaml|enl|xml|wos|medline|mods|ris)"}' \ @@ -397,14 +254,10 @@ _arguments -C \ '--natbib[use natbib for citations in LaTeX output]' \ '--biblatex[use biblatex for citations in LaTeX output]' \ '--mathml[convert TeX math to MathML (in epub3, docbook4, docbook5, jats, html4 and html5)]' \ - '--webtex=[convert TeX formulas to <img> tags that link to an external script that converts formulas to images]::url: ' \ - '--mathjax=[use MathJax to display embedded TeX math in HTML output]::url: ' \ - '--katex=[use KaTeX to display embedded TeX math in HTML output]::url: ' \ - {-m,--latexmathml=,--asciimathml=}'[deprecated. Use the LaTeXMathML script to display embedded TeX math in HTML output]::url: ' \ - '--mimetex=[deprecated. Render TeX math using the mimeTeX CGI script, which generates an image for each TeX formula]::url: ' \ - '--jsmath=[deprecated. Use jsMath (the predecessor of MathJax) to display embedded TeX math in HTML output]::url: ' \ - '--gladtex[deprecated. Enclose TeX math in <eq> tags in HTML output]: : ' \ - '--abbreviations=[specifies a custom abbreviations file]:file:_files ' \ + '--webtex=[convert TeX formulas to <img> tags that link to an external script that converts formulas to images]:: :_urls' \ + '--mathjax=[use MathJax to display embedded TeX math in HTML output]:: :_urls' \ + '--katex=[use KaTeX to display embedded TeX math in HTML output]:: :_urls' \ + '--gladtex[Enclose TeX math in <eq> tags in HTML output]' \ '--trace[enable tracing]' \ '--dump-args[print information about command-line arguments to stdout, then exit]' \ '--ignore-args[ignore command-line arguments (for use in wrapper scripts)]' \ -- cgit v1.2.3 From 0b3aa73af10b49a56be74e2c6c25a16768576a90 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson <mikachu@gmail.com> Date: Sun, 16 May 2021 17:28:37 +0200 Subject: _timeout: Fix wrong syntax --- ChangeLog | 4 ++++ Completion/Unix/Command/_timeout | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 6a2ac0c22..c64d7926a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2021-05-16 Mikael Magnusson <mikachu@gmail.com> + + * unposted: Completion/Unix/Command/_timeout: Fix wrong syntax + 2021-05-15 Bart Schaefer <schaefer@zsh.org> * Han Pingtian: 33465 (very belatedly): use prctl() for "jobs -Z" diff --git a/Completion/Unix/Command/_timeout b/Completion/Unix/Command/_timeout index 5c27bee47..d0ff085bb 100644 --- a/Completion/Unix/Command/_timeout +++ b/Completion/Unix/Command/_timeout @@ -15,6 +15,6 @@ _arguments -S -A "-" $args \ '--preserve-status[always exit with the same status as command even if it times out]' \ "--foreground[don't propagate timeout to the command children]" \ '(-s --signal)'{-s,--signal}'[specify the signal to send on timeout]:signal:_signals' \ - '(-k --kill-after)'{-k,--kill-after}'[followup first signal with SIGKILL if command persists after specified time]:time:time' \ + '(-k --kill-after)'{-k,--kill-after}'[followup first signal with SIGKILL if command persists after specified time]:time' \ '1: :_guard "[0-9.]#([smhd]|)" duration' \ '*:::command:_normal' -- cgit v1.2.3 From 41071eaed794e9f97f42718c24cd91382352b14f Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Sun, 16 May 2021 20:41:55 +0200 Subject: 48623: update options in openssh completion to version 8.6 --- ChangeLog | 5 ++ Completion/Unix/Command/_ssh | 106 +++++++++++++++++++++++++++---------------- 2 files changed, 71 insertions(+), 40 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index c64d7926a..b69e429a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-05-16 Oliver Kiddle <opk@zsh.org> + + * 48623: Completion/Unix/Command/_ssh: update options in openssh + completion to version 8.6 + 2021-05-16 Mikael Magnusson <mikachu@gmail.com> * unposted: Completion/Unix/Command/_timeout: Fix wrong syntax diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index 642f11bcb..82a2a1827 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -4,12 +4,13 @@ _ssh () { local curcontext="$curcontext" state line expl suf arg ret=1 - local args sigargs common common_transfer algopt tmp p1 file cmn cmds sdesc tdesc + local args sigargs common common_transfer options algopt tmp p1 file cmn cmds sdesc tdesc typeset -A opt_args common=( '(-6)-4[force ssh to use IPv4 addresses only]' '(-4)-6[force ssh to use IPv6 addresses only]' + '-A[enable forwarding of the authentication agent connection]' '-C[compress data]' '-c+[select encryption cipher]:encryption cipher:->ciphers' '-F+[specify alternate config file]:config file:_files' @@ -32,7 +33,6 @@ _ssh () { ssh) (( $+words[(r)-[^-]#t*] )) && tdesc=' even if there is no controlling tty' _arguments -C -s \ - '(-a)-A[enable forwarding of the authentication agent connection]' \ '(-A)-a[disable forwarding of authentication agent connection]' \ '-B+[bind to specified interface before attempting to connect]:interface:_net_interfaces' \ '(-P)-b+[specify interface to transmit on]:bind address:_bind_addresses' \ @@ -92,14 +92,16 @@ _ssh () { $algopt \ '-e+[remove keys provided by the PKCS#11 shared library]:library:_files -g "*.(so|dylib)(|.<->)(-.)"' \ '-k[load plain private keys only and skip certificates]' \ + '-K[load resident keys from a FIDO authenticator]' \ '-L[list public key parameters of all identities in the agent]'\ '-l[list all identities]' \ '-m+[specify minimum remaining signatures before maximum is changed]:number' \ '-M+[specify maximum number of signatures]:number' \ + '-S+[use specified library when adding FIDO authenticator-hosted keys]:library:_files' \ '-s+[add keys provided by the PKCS#11 shared library]:library:_files -g "*.(so|dylib)(|.<->)(-.)"' \ '-t+[set maximum lifetime for identity]:maximum lifetime (in seconds or time format):' \ "-T[test usability of identity files' private keys]:*:public key file:_files -g '*.pub(-.)'" \ - '-v[verbose mode]' \ + '*-v[verbose mode]' \ '-q[be quiet after a successful operation]' \ '-X[unlock the agent]' \ '-x[lock the agent with a password]' \ @@ -125,13 +127,42 @@ _ssh () { # options can be in any order but use ! to limit those shown for the first argument (( CURRENT == 2 )) && p1='!' args=( '!-z:number' ) + options=( + application + 'challenge\:path\:_files' + device + no-touch-required + resident + user + verify-required + 'write-attestation\:path\:_files' + ) sdesc='certify keys with CA key' - (( $+words[(r)-I] )) && args=( '-z[specify serial number]:serial number' ) + if (( $+words[(r)-[IhUDnV]*] )); then + args=( '-z[specify serial number]:serial number' ) + options=( + clear critical\:name extension\:name force-command\:command\:_cmdstring + no-agent-forwarding no-port-forwarding no-pty no-user-rc no-x11-forwarding + permit-agent-forwarding permit-port-forwarding permit-pty permit-user-rc + permit-x11-forwarding source-address\:source\ address + ) + fi (( $+words[(r)-[ku]] )) && args=( '-z[specify version number]:version number' ) && sdesc='specify CA public key file' file=key (( $+words[(r)-[FHR]] )) && file=known_hosts - (( $+words[(r)-T] )) && file=input + if (( $+words[(r)-M*] )); then + file=input + args+=( '*:output file:_files' ) + options=( + lines:number + 'start-line\:line number' + checkpoint\:file:_files + 'memory\:size (mbytes)' + 'start\:start point (hex-value)' + generator\:value + ) + fi (( $+words[(r)-A] )) && file='prefix for host key' if (( $+words[(r)-[kIQ]] )); then file=krl @@ -139,8 +170,9 @@ _ssh () { fi if (( arg = $words[(I)-Y*] )); then [[ $words[arg] = -Y?* ]] || (( arg++ )) - case $words[arg] in - check*|verify) + case ${words[arg]#-Y} in + ^find-*) sigargs+=( "$p1-n+[specify namespace]:namespace" ) ;| + check*|find*|verify) sigargs+=( "$p1-s+[specify signature file]:signature file:-files" ) ;| sign) sigargs+=( '*:file:_files' ) ;; @@ -153,51 +185,55 @@ _ssh () { ;; esac fi - cmds=( -p -i -e -y -c -l -B -D -F -H -R -r -G -T -s -L -A -k -Q -Y ) # basic commands - cmn=( -b -P -N -C -l -m -v ) # options common to many basic commands (except -f which is common to most) - cms=( -E -q -t -g -M -S -a -J -j -K -W -I -h -n -O -V -u -U ) # options specific to one basic command + cmds=( -p -i -e -y -c -l -B -D -F -H -K -R -r -M -s -L -A -k -Q -Y ) # basic commands + cmn=( -a -b -P -N -C -l -m -O -v -w -Z ) # options common to many basic commands (except -f which is common to most) + cms=( -E -q -t -g -M -I -h -n -V -u -U ) # options specific to one basic command _arguments -s $args \ - "(${${(@)cmds:#-G}} -P ${${(@)cms:#-[MS]}})-b+[specify number of bits in key]:bits in key" \ + "${p1}(${${(@)cmds:#-[pcKAO]}} ${${(@)cms:#-[t]}} -O)-a+[specify number of rounds]:rounds" \ + "(${${(@)cmds:#-M}} -P ${${(@)cms:#-[MS]}})-b+[specify number of bits in key]:bits in key" \ "$p1(${${(@)cmds:#-[pc]}} -b $cms)-P+[provide old passphrase]:old passphrase" \ "(${${(@)cmds:#-p}} -v ${${(@)cms:#-[qt]}})-N+[provide new passphrase]:new passphrase" \ "(${${(@)cmds:#-c}} -v $cms)-C+[provide new comment]:new comment" \ - "(-D -G -M -S -I -h -n -O -V -A)-f+[$file file]:$file file:_files" \ + "(-D -I -h -n -V -A)-f+[$file file]:$file file:_files" \ "$p1(${${(@)cmds:#-[FE]}} ${${(@)cmn:#-v}} ${${(@)cms:#-E}})-l[show fingerprint of key file]" \ "$p1(${${(@)cmds:#-[iep]}} $cms)-m+[specify conversion format]:format [RFC4716]:(PEM PKCS8 RFC4716)" \ + "$p1*-O+[specify a key/value option]: : _values 'option' $options" \ "(${${(@)cmds:#-[lGT]}} ${${(@)cmn:#-[bv]}} -f)*-v[verbose mode]" \ + "$p1(${${(@)cmds:#-K}} -P ${${(@)cms:#-[qt]}})-w+[specify library used when creating FISO authenticator-hosted keys]:library:_files -g '*.(so|dylib)(|.<->)(-.)'" \ + "$p1(${${(@)cmds:#-p}} -l ${${(@)cms:#-[qt]}})-Z+[specify encryption cipher to use when writing a private key file]:cipher:compadd - $(_call_program ciphers ssh -Q cipher)" \ - '(commands)' \ - "(-b -l -C -v)-p[change passphrase of private key file]" \ - '(-b -l -P -N -C -v)-i[import key to OpenSSH format]' \ - '(-b -l -P -N -C -v)-e[export key to SECSH file format]' \ + "(-b -l -C -O -v -w)-p[change passphrase of private key file]" \ + "(${${(@)cmn:#-m}})-i[import key to OpenSSH format]" \ + "(${${(@)cmn:#-m}})-e[export key to SECSH file format]" \ "($cmn)-y[get public key from private key]" \ - '(-b -l -N -m -v)-c[change comment in private and public key files]' \ + "(${${(@)cmn:#-[aCP]}})-c[change comment in private and public key files]" \ "($cmn)-B[show the bubblebabble digest of key]" \ "(-)-D+[download key stored in smartcard reader]:reader" \ "(${${(@)cmn:#-[lv]}})-F+[search for host in known_hosts file]:host:_ssh_hosts" \ "($cmn)-H[hash names in known_hosts file]" \ + "(${${(@)cmn:#-[aw]}} -f)-K[download resident keys from a FIDO authenticator]" \ "($cmn)-R+[remove host from known_hosts file]:host:_ssh_hosts" \ + "(${${(@)cmn:#-O}})-M+[moduli generation]:action:(( + generate\:generate\ candidates\ for\ DH-GEX\ moduli + screen\:screen\ candidates\ for\ DH-GEX\ moduli + ))" \ "($cmn)-L[print the contents of a certificate]" \ - "($cmn -l)-A[generate host keys for all key types]" \ + "(${${(@)cmn:#-a}})-A[generate host keys for all key types]" \ "($cmn)-Q[test whether keys have been revoked in a KRL]" \ + "($cmn)-Y+[signature action]:action:(( + find-principals\:find\ the\ principal\ associated\ with\ the\ public\ key\ of\ a\ signature + sign\:sign\ a\ file\ using\ SSH\ key + verify\:verify\ a\ signature\ generated\ using\ the\ sign\ option + check-novalidate\:check\ signature\ structure + ))" \ - finger \ "$p1($cmn)$algopt" \ - create \ '(-P -l)-q[silence ssh-keygen]' \ - "(-P -l)-t+[specify the type of the key to create]:key type:(rsa dsa ecdsa ed25519)" \ + "(-P -l)-t+[specify the type of the key to create]:key type:(rsa dsa ecdsa ed25519 ecdsa-sk ed25519-sk)" \ - dns \ "($cmn)-r[print DNS resource record]:hostname:_hosts" \ "$p1($cmn)-g[use generic DNS format]" \ - - primes \ - "(-P -N -C -l -m -f)-G+[generate candidates for DH-GEX moduli]:output file:_files" \ - "$p1(-P -N -C -l -m -f)-M+[specify amount of memory to use for generating DH-GEX moduli]:memory (MB)" \ - "$p1(-P -N -C -l -m -f)-S+[specify start point]:start point (hex)" \ - - screen \ - "(${${(@)cmn:#-v}})-T+[screen candidates for DH-GEX moduli]:output file:_files" \ - "${p1}(${${(@)cmn:#-v}})-a+[specify number of rounds]:rounds" \ - "${p1}(${${(@)cmn:#-v}})-J[exit after screening specified number of lines]" \ - "${p1}(${${(@)cmn:#-v}})-j+[start screening at the specified line number]:line number" \ - "${p1}(${${(@)cmn:#-v}})-K+[write the last line processed to file]:file:_files" \ - "${p1}(${${(@)cmn:#-v}})-W[specify desired generator]:generator" \ - certify \ "($cmn)-s[$sdesc]:CA key:_files" \ "$p1($cmn -f -k -u)-I+[specify key identifier to include in certificate]:key id" \ @@ -205,21 +241,10 @@ _ssh () { "$p1($cmn -f -k -u -D)-U[indicate that CA key is held by ssh-agent]" \ "$p1($cmn -f -k -u -U)-D+[indicate the CA key is stored in a PKCS#11 token]:PKCS11 shared library:_files -g '*.(so|dylib)(|.<->)(-.)'" \ "$p1($cmn -f -k -u)-n+[specify user/host principal names to include in certificate]:principals" \ - "$p1($cmn -f -k -u)*-O+[specify a certificate option]: : _values 'option' - clear critical\:name extension\:name force-command\:command\:_cmdstring - no-agent-forwarding no-port-forwarding no-pty no-user-rc no-x11-forwarding - permit-agent-forwarding permit-port-forwarding permit-pty permit-user-rc - permit-x11-forwarding source-address\:source\ address" \ "$p1($cmn -f -u)-V+[specify certificate validity interval]:interval" \ "($cmn -I -h -n -D -O -U -V)-k[generate a KRL file]" \ "$p1($cmn -I -h -n -D -O -U -V)-u[update a KRL]" \ - signature \ - "($cmn)-Y+[signature action]:action:(( - sign\:sign\ a\ file\ using\ SSH\ key - verify\:verify\ a\ signature\ generated\ using\ the\ sign\ option - check-novalidate\:check\ signature\ structure - ))" \ - "$p1-n+[specify namespace]:namespace" \ $sigargs return ;; @@ -244,6 +269,7 @@ _ssh () { '-b+[specify batch file to read]:batch file:_files' \ '-D+[connect directly to a local sftp server]:sftp server path' \ '-f[request that files be flushed immediately after transfer]' \ + '-N[disable implicit quiet mode set by -b]' \ '-R+[specify number of outstanding requests]:number of requests [64]' \ '-s+[specify SSH2 subsystem or path to sftp server on the remote host]:subsystem/path' \ '1:file:->rfile' '*:file:->file' "$common[@]" "$common_transfer[@]" && ret=0 -- cgit v1.2.3 From 61e4e43ac93b49eeed32ff1a2c9e208b3ba99b80 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Sun, 16 May 2021 21:23:15 +0200 Subject: 48783: update ansible completion to 2.10.8 --- ChangeLog | 3 +++ Completion/Unix/Command/_ansible | 38 +++++++++++++++++++++++++------------- 2 files changed, 28 insertions(+), 13 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index b69e429a2..8d0aad739 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-05-16 Oliver Kiddle <opk@zsh.org> + * 48783: Completion/Unix/Command/_ansible: update ansible + completion to 2.10.8 + * 48623: Completion/Unix/Command/_ssh: update options in openssh completion to version 8.6 diff --git a/Completion/Unix/Command/_ansible b/Completion/Unix/Command/_ansible index c81308586..65cae148e 100644 --- a/Completion/Unix/Command/_ansible +++ b/Completion/Unix/Command/_ansible @@ -46,9 +46,9 @@ case $service in ;| ansible|ansible-console|ansible-inventory|ansible-playbook|ansible-pull) args+=( - '--ask-vault-pass[ask for vault password]' + --ask-vault-pass{,word}'[ask for vault password]' '--vault-id=[specify vault identity to use]:vault identity' - '--vault-password-file=[specify vault password file]:vault password file:_files' + --vault-pass{,word}-file='[specify vault password file]:vault password file:_files' ) ;| ansible|ansible-console|ansible-inventory|ansible-playbook|ansible-pull) @@ -229,11 +229,11 @@ case $state in if zstyle -T ":completion:${curcontext}:plugins" verbose; then (( ${(P)#plugvar} )) || set -A ${plugvar} \ ${${(f)"$(_call_program plugins ansible-doc -t $plug -l)"}/ ##/:} - _describe -t plugins "${plug} plugin" $plugvar && ret=0 + _describe -t plugins "${plug} plugin" $plugvar -M 'r:|.=* r:|=*' && ret=0 else (( ${(P)#plugvar} )) || set -A ${plugvar} \ ${${(f)"$(_call_program plugins ansible-doc -t $plug -F)"}%% *} - _wanted plugins expl "${plug} plugin" compadd -a $plugvar && ret=0 + _wanted plugins expl "${plug} plugin" compadd -M 'r:|.=* r:|=*' -a $plugvar && ret=0 fi ;; tags) @@ -270,12 +270,19 @@ case $state in args+=( '(-c --ignore-certs)'{-c,--ignore-certs}'[ignore SSL certificate validation errors]' '(-s --server)'{-s+,--server=}'[specify API server destination]:server:_hosts' + --{token,api-key}='[specify ansible galaxy API key]:api key' \*{-v,--verbose}'[verbose mode]' ) ;| - collection-*) - args+=( '--api-key=[specify ansible galaxy API key]:api key' ) + role-setup) # order important here, source comes before github args + args+=( ': :_guard "^-*" "source"' '*:secret' ) ;| + role-(delete|import|setup)) + args+=( ': :_guard "^-*" "github username"' ':github repository' ) + ;| + role-(info|init|install|list|remove)) + args+=( '*: :_guard "^-*" "role name"' ) + ;; role-(info|search|list|remove|install)) args+=( '(-p --roles-path)'{-p,--roles-path}'[specify location of roles]:path:_directories' ) ;| @@ -334,23 +341,28 @@ case $state in collection-build) args+=( '--output-path=[specify path in which the collection is built to]:path [.]:_directories' + '*:collection directory to build:_directories' ) ;; collection-init) args+=( '--collection-skeleton=[specify path to a collection skeleton that the new role should be based upon]:path:_files' + ': :_guard "^-*" "collection name"' ) ;; collection-publish) args+=( "--no-wait[don't wait for import validation results]" '--import-timeout=[specify time to wait for import process]:time' + ':collection tarball:_files' ) ;; collection-install) args+=( '(-p --collections-path)'{-p+,--collections-path=}'[specify directory containing collections]:_directories' - '(-r --requirements-file)'{-r+,--requirements-file=}'[specify file containing a list of collections to install]:file:_files' + '(-r --requirements-file *)'{-r+,--requirements-file=}'[specify file containing a list of collections to install]:file:_files' + '--pre[include pre-release versions]' + '*:collecion name:_files' ) ;; esac @@ -362,13 +374,13 @@ case $state in (( $#words > 2 )) && ign='!' args=( "${ign}(-)"{-h,--help}'[display usage information]' - '--ask-vault-pass[ask for vault password]' + --ask-vault-pass{,word}'[ask for vault password]' '--vault-id=[specify vault identity to use]:vault identity' - '--vault-password-file=[specify vault password file]:vault password file:_files' + --vault-pass{,word}-file='[specify vault password file]:vault password file:_files' \*{-v,--verbose}'[verbose mode]' ) case $line[1] in - create|encrypt*|edit|rekey) + create|(de|en)crypt*|edit|rekey) args+=( '--encrypt-vault-id=[specify vault id to use to encrypt (required if more than one vault-id is provided)]:vault id' ) @@ -382,13 +394,13 @@ case $state in ) ;| create|edit|rekey|view) args+=( ':file:_files' ) ;| - (en|de)crypt) args+=( '::file:_files' ) ;; - rekey) + decrypt|rekey) args+=( '--new-vault-id=[specify new vault identity to use]:vault identity' '--new-vault-password-file=[specify new vault password file]:vault password file:_files' ) - ;; + ;| + (en|de)crypt) args+=( '::file:_files' ) ;; esac _arguments -s -S $args && ret=0 ;; -- cgit v1.2.3 From 93b4ee524df9cee5886785e9a36596af872f95f7 Mon Sep 17 00:00:00 2001 From: Jörg Sommer <joerg@jo-so.de> Date: Tue, 15 Dec 2020 22:32:46 +0100 Subject: users/26649: add zstyle for rake targets without description `rake -T` shows only these targets having a description. But it might be useful to see all. Allow this with the zsytle setting: zstyle :completion::complete:rake:argument-rest:targets extended true --- ChangeLog | 3 +++ Completion/Unix/Command/_rake | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 8d0aad739..6f8520db7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-05-16 Oliver Kiddle <opk@zsh.org> + * Jörg Sommer: users/26649: Completion/Unix/Command/_rake: + add zstyle for rake targets without description + * 48783: Completion/Unix/Command/_ansible: update ansible completion to 2.10.8 diff --git a/Completion/Unix/Command/_rake b/Completion/Unix/Command/_rake index 8814edaa5..10d621991 100644 --- a/Completion/Unix/Command/_rake +++ b/Completion/Unix/Command/_rake @@ -37,7 +37,9 @@ case "$state" in ;; target) local -a targets - targets=( ${${(f)"$(_call_program targets $words[1] -sT $opt_args[(I)(-N|--nosearch)] ${(kv)opt_args[(I)(-f|--rakefile)]} 2>/dev/null)"}/(#b)rake ([^ ]##) ##\# (*)/${${match[1]}//:/\\:}:${match[2]:l}} ) + local all + zstyle -t ":completion:${curcontext}:targets" extended && all=-A + targets=( ${${(f)"$(_call_program targets $words[1] $all -sT $opt_args[(I)(-N|--nosearch)] ${(kv)opt_args[(I)(-f|--rakefile)]} 2>/dev/null)"}/(#b)rake ([^ ]##) ##\# (*)/${${match[1]}//:/\\:}:${match[2]:l}} ) if (( ! ${targets[(I)rake aborted!]} )) then _describe -t targets 'rake target' targets && ret=0 else -- cgit v1.2.3 From 891d361572f6db01434c21adb9b699d6a82dba80 Mon Sep 17 00:00:00 2001 From: Marlon Richert <marlon.richert@gmail.com> Date: Fri, 21 May 2021 15:56:42 +0300 Subject: 48891: Fix pgrep/pkill -f completion Old completion produced false positives & took too much screen space. --- ChangeLog | 3 +++ Completion/Unix/Command/_pgrep | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 79dddba67..335e42ff0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-05-21 Oliver Kiddle <opk@zsh.org> + * Marlon Richert: 48891: Completion/Unix/Command/_pgrep: + Fix pgrep/pkill -f completion + * Marlon Richert: 48864: Completion/Zsh/Type/_parameters: Improve extra-verbose completion display strings for array parameter values diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index 51a4883df..5b1853e6b 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -166,8 +166,15 @@ case $state in ispat="" fi if (( ${+opt_args[-f]} )); then - _wanted process-args expl $ispat'process command line' \ - compadd ${${(f)"$(_call_program process-args ps -A -o args=)"}% *} + local -a matches=( ${(f)"$( + _call_program process-args pgrep -lf ${${:-$PREFIX$SUFFIX}:-.\*} + )"} ) + local -a displ=( "${${matches[@]//':'/'\:'}[@]/ /:}" ) + matches=( "${matches[@]##<-> }" ) + + local desc=$ispat'process command line' + _description process-args expl "$desc" + _describe -t process-args "$desc" displ matches "$@" -U "$expl[@]" else _wanted processes-names expl $ispat'process name' _process_names -a -t fi -- cgit v1.2.3 From 0c14732cf740149aa906017938624db2e864f08e Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Sat, 22 May 2021 00:00:29 +0200 Subject: 48897: completion updates for DragonFly 6.0 and OpenBSD 6.9 --- ChangeLog | 6 ++++++ Completion/Unix/Command/_dhclient | 1 - Completion/Unix/Command/_head | 8 +++++++- Completion/Unix/Command/_pgrep | 4 ++++ Completion/Unix/Command/_ping | 1 + Completion/Unix/Command/_sed | 8 ++++---- Completion/Unix/Command/_tail | 2 +- Completion/Unix/Command/_timeout | 4 ++-- Completion/Unix/Command/_uname | 14 ++++++++++---- 9 files changed, 35 insertions(+), 13 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 335e42ff0..da642cfb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2021-05-21 Oliver Kiddle <opk@zsh.org> + * 48897: Completion/Unix/Command/_sed, Completion/Unix/Command/_head, + Completion/Unix/Command/_dhclient, Completion/Unix/Command/_pgrep, + Completion/Unix/Command/_ping, Completion/Unix/Command/_tail, + Completion/Unix/Command/_timeout, Completion/Unix/Command/_uname: + completion updates for DragonFly 6.0 and OpenBSD 6.9 + * Marlon Richert: 48891: Completion/Unix/Command/_pgrep: Fix pgrep/pkill -f completion diff --git a/Completion/Unix/Command/_dhclient b/Completion/Unix/Command/_dhclient index d5ca5b271..e22586b04 100644 --- a/Completion/Unix/Command/_dhclient +++ b/Completion/Unix/Command/_dhclient @@ -20,7 +20,6 @@ case $OSTYPE in openbsd*) args+=( '-i+[ignore values provided by leases for specified options]:options' - '-L+[specify file to write option data too]:file:_files' "-n[don't configure any interfaces]" '-r[release the current lease back to the server it came from]' '-v[verbose log messages]' diff --git a/Completion/Unix/Command/_head b/Completion/Unix/Command/_head index 1e968cc11..f25c97c83 100644 --- a/Completion/Unix/Command/_head +++ b/Completion/Unix/Command/_head @@ -18,7 +18,13 @@ else case $OSTYPE in (freebsd*|darwin*|dragonfly*|netbsd*) args+=( '(-n)-c+[display the first specified bytes]:number of bytes' ) - ;; + ;| + dragonfly*|netbsd*) + args+=( + '(-v)-q[never print headers giving file names]' + '(-q)-v[always print headers giving file names]' + ) + ;; esac fi diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index 5b1853e6b..e10f42f53 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -125,6 +125,10 @@ else fi fi +if [[ $OSTYPE = dragonfly* ]]; then + arguments+=( '(-t)-T[match only processes associated with the current terminal]' ) +fi + arguments+=( $sig_arguments + o '*: :->pname' ) [[ $OSTYPE == linux* ]] || aopts+=( -A '*-' ) diff --git a/Completion/Unix/Command/_ping b/Completion/Unix/Command/_ping index e69173430..b371e808f 100644 --- a/Completion/Unix/Command/_ping +++ b/Completion/Unix/Command/_ping @@ -189,6 +189,7 @@ case ${variant}:${${service#ping}:-4} in args+=( '-E[audible bell for no packet]' '-e[audible bell for each packet]' + '-g[provide a visual display of packets received and lost]' '-T+[change TOS value]:TOS value:(critical inetcontrol lowdelay netcontrol throughput reliability ef af cs)' '-V+[specify routing table to be used]:routing table' ) diff --git a/Completion/Unix/Command/_sed b/Completion/Unix/Command/_sed index 73227901e..79a010c92 100644 --- a/Completion/Unix/Command/_sed +++ b/Completion/Unix/Command/_sed @@ -109,10 +109,10 @@ else ) ;| openbsd*|freebsd*|netbsd*|dragonfly*) args+=( '(-r -E)'-r$extended ) ;| - darwin*|freebsd*|netbsd*|openbsd*) args+=( '-i+'$inplace ) ;| - darwin*|freebsd*|netbsd*) args+=( '-l[make output line buffered]' ) ;| - freebsd*) args+=( '-u[disable data buffering]' ) ;| - freebsd*|netbsd*) + darwin*|freebsd*|netbsd*|openbsd*|dragonfly*) args+=( '-i+'$inplace ) ;| + darwin*|freebsd*|netbsd*|dragonfly*) args+=( '-l[make output line buffered]' ) ;| + freebsd*|dragonfly*) args+=( '-u[disable data buffering]' ) ;| + freebsd*|netbsd*|dragonfly*) args+=( '-I+[edit files in-place, treating all files as a single input stream]:: :_guard "^(*[@/; \\\]*|?(#c6,)|-*)" "suffix for backup"' ) diff --git a/Completion/Unix/Command/_tail b/Completion/Unix/Command/_tail index 3bfbe37ca..6d6e9b2d5 100644 --- a/Completion/Unix/Command/_tail +++ b/Completion/Unix/Command/_tail @@ -43,7 +43,7 @@ else '(-v)-q[never output headers giving file names]' ) ;| - (netbsd*) + (dragonfly*|netbsd*) args+=( '(-q)-v[always output headers giving file names]' ) ;; esac diff --git a/Completion/Unix/Command/_timeout b/Completion/Unix/Command/_timeout index d0ff085bb..223059e4d 100644 --- a/Completion/Unix/Command/_timeout +++ b/Completion/Unix/Command/_timeout @@ -2,8 +2,8 @@ local args -if [[ $service = g* || $OSTYPE != *bsd* ]]; then - # GNU coreutils as opposed to Free/NetBSD implementation +if [[ $service = g* || $OSTYPE != *(freebsd|netbsd)* ]]; then + # GNU coreutils or DFly as opposed to Free/NetBSD implementation args=( '(-v --verbose)'{-v,--verbose}'[indicate when signal is sent upon timeout]' '(- *)--help[display usage information]' diff --git a/Completion/Unix/Command/_uname b/Completion/Unix/Command/_uname index 0e55ba1c3..c58f2edfd 100644 --- a/Completion/Unix/Command/_uname +++ b/Completion/Unix/Command/_uname @@ -62,13 +62,19 @@ else '-v[print detailed operating system version]' ) case $OSTYPE in - freebsd*|dragonfly*) args+=( '-i[print kernel ident]' ) ;| - freebsd<10->.*) + freebsd*|dragonfly*) args+=( - '-K[print FreeBSD kernel version]' - '-U[print FreeBSD user environment version]' + '-i[print kernel ident]' + '-K[print kernel version]' + '-U[print user environment version]' ) ;| + dragonfly*) + args+=( + '-P[write ABI string for dports / pkgng, including odd-to-even version-munging]' + '-PP[write ABI string for dports / pkgng, without version-munging]' + ) + ;; freebsd<13->.*) args+=( "-b[print kernel's linker-generated build-id]" ) ;; -- cgit v1.2.3 From 31d9ff53ceb393672e1507ff3f0adbefce2a298e Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Thu, 3 Jun 2021 00:01:53 +0200 Subject: 48939: update completion of options for rsync 3.2.3 --- ChangeLog | 4 ++++ Completion/Unix/Command/_rsync | 53 ++++++++++++++++++++++++++++++------------ 2 files changed, 42 insertions(+), 15 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index da642cfb6..e49333723 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2021-06-02 Oliver Kiddle <opk@zsh.org> + + * 48939: Completion/Unix/Command/_rsync: update for rsync 3.2.3 + 2021-05-21 Oliver Kiddle <opk@zsh.org> * 48897: Completion/Unix/Command/_sed, Completion/Unix/Command/_head, diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync index 56efd7b13..e14c99cc6 100644 --- a/Completion/Unix/Command/_rsync +++ b/Completion/Unix/Command/_rsync @@ -85,6 +85,16 @@ _rsync_files() { _alternative "files:file:_files" "remote-files:remote file:_rsync_remote_files" } +_rsync_users_groups() { + local -a suf + if compset -P '*:'; then + _groups + else + compset -S ':*' || suf=( -qS ':' ) + _users $suf + fi +} + _rsync() { _arguments -s \ '*'{-v,--verbose}'[increase verbosity]' \ @@ -95,7 +105,7 @@ _rsync() { '--address=[bind to the specified address]:bind address:_bind_addresses' \ '--log-file-format=[log updates using specified format]:format' \ '--log-file=[log what rsync is doing to the specified file]:file:_files' \ - '(-T --temp-dir)'{-T,--temp-dir=}'[create temporary files in specified directory]:directory:_directories' \ + '(-T --temp-dir)'{-T+,--temp-dir=}'[create temporary files in specified directory]:directory:_directories' \ '--sockopts=[specify custom TCP options]' \ '(-4 -6 --ipv4 --ipv6)'{-4,--ipv4}'[prefer IPv4]' \ '(-4 -6 --ipv4 --ipv6)'{-6,--ipv6}'[prefer IPv6]' \ @@ -104,11 +114,12 @@ _rsync() { '--config=[specify alternate rsyncd.conf file]:file:_files' \ '--daemon[run as an rsync daemon]' \ '--detach[detach from the parent]' \ - '(-M --dparam)'{-M,--dparam=}'[override global daemon config parameter]:config parameter' \ + '(-M --dparam)'{-M+,--dparam=}'[override global daemon config parameter]:config parameter' \ '--no-detach[do not detach from the parent]' \ - client \ '(-)--help[display help information]' \ '*: :_rsync_files' \ + '--stderr=[change stderr output mode]:output mode [errors]:(errors all client)' \ '(-q --quiet)'{-q,--quiet}'[suppress non-error messages]' \ '--no-motd[suppress the daemon message-of-the-day output]' \ '(-c --checksum)'{-c,--checksum}'[skip based on checksums, not mod-time & size]' \ @@ -121,7 +132,7 @@ _rsync() { {--no-implied-dirs,--no-i-d}'[do not send implied dirs with --relative]' \ '(-b --backup)'{-b,--backup}'[make backups into hierarchy at indicated directory]' \ '--backup-dir=[make backups into specified directory]:backup directory:_directories' \ - '--suffix=[set backup suffix]:suffix:(\~)' \ + '--suffix=[set backup suffix]:suffix [~]' \ '(-u --update)'{-u,--update}'[skip files that are newer on the receiving side]' \ '--inplace[update destination files in-place]' \ '(--append-verify)--append[append data onto shorter files]' \ @@ -131,6 +142,7 @@ _rsync() { '--fake-super[use xattrs to save all file attributes]' \ '(-d --dirs)'{-d,--dirs}'[transfer directories without recursing]' \ {--no-d,--no-dirs}'[turn off --dirs]' \ + "--mkpath[create the destination's path component]" \ '(-l --links)'{-l,--links}'[copy symlinks as symlinks]' \ {--no-l,--no-links}'[turn off --links]' \ '(-L --copy-links)'{-L,--copy-links}'[transform symlinks into referent file/dir]' \ @@ -142,6 +154,7 @@ _rsync() { '(-K --keep-dirlinks)'{-K,--keep-dirlinks}'[treat symlinked dir on receiver as dir]' \ '(-p --perms -E --executability)'{-p,--perms}'[preserve permissions]' \ {--no-p,--no-perms}'[turn off --perms]' \ + '--fileflags[preserve file-flags (aka chflags)]' \ '(-E --executability)'{-E,--executability}'[preserve executability]' \ '(-o --owner)'{-o,--owner}'[preserve owner]' \ {--no-o,--no-owner}'[turn off --owner]' \ @@ -150,22 +163,25 @@ _rsync() { '(--devices --specials)-D[same as --devices --specials]' \ '(-D)--devices[preserve devices]' \ '--no-devices[turn off --devices]' \ - '--copy-devices[copy device contents as regular file]' \ '(-D)--specials[preserve special files]' \ '--no-specials[turn off --specials]' \ '--no-D[turn off --devices and --specials]' \ - '(-t --times)'{-t,--times}'[preserve times]' \ + '(-t --times)'{-t,--times}'[preserve modification times]' \ {--no-t,--no-times}'[turn off --times]' \ + \*{-U,--atimes}'[preserve access (use) times]' \ + '--open-noatime[avoid changing the atime on opened files]' \ + '(--crtimes -N)'{--crtimes,-N}'[preserve create times (newness)]' \ '(-O --omit-dir-times)'{-O,--omit-dir-times}'[omit directories when preserving times]' \ '(-J --omit-link-times)'{-J,--omit-link-times}'[omit symlinks when preserving times]' \ - '--chmod[change destination permissions]:mods' \ + '--chmod=[change destination permissions]:permissions' \ '(-S --sparse)'{-S,--sparse}'[handle sparse files efficiently]' \ + '--write-devices[write to devices as files (implies --inplace)]' \ '(-n --dry-run)'{-n,--dry-run}'[show what would have been transferred]' \ '(-W --whole-file)'{-W,--whole-file}'[copy files whole (without delta-transfer algorithm)]' \ {--no-W,--no-whole-file}'[turn off --whole-file]' \ - '--checksum-choice=[choose the checksum algorithms]:algorithm:_sequence -n 2 compadd - auto md4 md5 none' \ + '(--cc --checksum-choice)'{--cc,--checksum-choice}'=[choose the checksum algorithms]:algorithm:_sequence -n 2 compadd - auto md4 md5 none' \ '(-x --one-file-system)'{-x,--one-file-system}"[don't cross filesystem boundaries]" \ - '(-B --block-size)'{-B,--block-size=}'[force a fixed checksum block-size]:block size' \ + '(-B --block-size)'{-B+,--block-size=}'[force a fixed checksum block-size]:block size (bytes)' \ '(-e --rsh)'{-e+,--rsh=}'[specify the remote shell to use]:remote-shell command:(rsh ssh)' \ '--rsync-path=[specify path to rsync on the remote machine]:remote command' \ '--ignore-existing[ignore files that already exist on receiving side]' \ @@ -179,10 +195,14 @@ _rsync() { '(--del --delete-before --delete-during --delete-after)--delete-delay[receiver deletes after transfer]' \ '--delete-excluded[also delete excluded files on the receiving side]' \ '--ignore-errors[delete even if there are I/O errors]' \ - '--force[force deletion of directories even if not empty]' \ + --force{,-delete}'[force deletion of directories even if not empty]' \ + '--force-change[affect user-/system-immutable files/dirs]' \ + '--force-uchange[affect user-immutable files/dirs]' \ + '--force-schange[affect system-immutable files/dirs]' \ '--max-delete=[do not delete more than NUM files]:number' \ '--max-size=[do not transfer any file larger than specified size]:number' \ '--min-size=[do not transfer any file smaller than specified size]:number' \ + '--max-alloc=[set limit to individual memory allocation]:size (bytes) [1g]' \ '(-P)--partial[keep partially transferred files]' \ '--no-partial[turn off --partial]' \ '--partial-dir=[put a partially transferred file into specified directory]:directory:_directories' \ @@ -201,10 +221,11 @@ _rsync() { '(--compare-dest --link-dest)*--copy-dest=[like --compare-dest, but also includes copies of unchanged files]:directory:_directories' \ '(--compare-dest --copy-dest)*--link-dest=[hardlink to files in specified directory hierarchy when unchanged]:directory:_directories' \ '(-z --compress)'{-z,--compress}'[compress file data during the transfer]' \ - '--compress-level=[explicitly set compression level]:number' \ + '(--zc --compress-choice)'{--zc,--compress-choice}'=[override the automatic negotiation of the compression algorithm]:algorithm:(zstd lz4 zlibx zlib none)' \ + '(--zl --compress-level)'{--zl,--compress-level}'=[explicitly set compression level]:number' \ '--skip-compress=[skip compressing files with a listed suffix]:suffixes' \ '(-C --cvs-exclude)'{-C,--cvs-exclude}'[auto-ignore files the same way CVS does]' \ - '*'{-f=,--filter=}'[add a file-filtering rule]:rule' \ + '*'{-f+,--filter=}'[add a file-filtering rule]:rule' \ '*-F[same as --filter="dir-merge /.rsync-filter", repeated: --filter="- .rsync-filter"]' \ '--exclude-from=[read exclude patterns from specified file]:file:_files' \ '*--exclude=[exclude files matching pattern]:pattern' \ @@ -213,6 +234,7 @@ _rsync() { '--files-from=[read list of source-file names from specified file]:file:_files' \ '(-0 --from0)'{-0,--from0}'[all *-from file lists are delimited by nulls]' \ '(-s --protect-args)'{-s,--protect-args}'[no space-splitting; only wildcard special-chars]' \ + '--copy-as=[specify user & optional group for the copy]:user:_rsync_users_groups' \ '--version[print version number]' \ '*'{-h,--human-readable}'[output numbers in a human-readable format]' \ '--blocking-io[use blocking I/O for the remote shell]' \ @@ -227,23 +249,24 @@ _rsync() { '--out-format=[output updates using specified format]:format' \ '--password-file=[read daemon-access password from file]:file:_files' \ '--list-only[list the files instead of copying them]' \ + '--stop-after=[stop copying after specified time has elapsed]:time (minutes)' \ + '--stop-at=[stop copying when specified point in time is reached]:date/time (YYYY-MM-DDTHH\:MM):_dates -F -S "T"' \ '(--only-write-batch)--write-batch=[write a batched update to the specified file]:file:_files' \ '(--write-batch)--only-write-batch=[like --write-batch but w/o updating destination]:file:_files' \ '--protocol=[force an older protocol version to be used]:number' \ '--info=[fine-grained informational verbosity]:info option:_rsync_info' \ '--debug=[fine-grained debug verbosity]:debug option:_rsync_debug' \ - '--msgs2stderr[special output handling for debugging]' \ + '!(--stderr)--msgs2stderr' \ '--munge-links[munge symlinks to make them safer, but unusable]' \ '--ignore-missing-args[ignore missing source args without error]' \ '--delete-missing-args[delete missing source args from destination]' \ '(--usermap --chown)--usermap=[custom username mapping]:comma-separated mappings' \ '(--groupmap --chown)--groupmap=[custom groupname mapping]:comma-separated mappings' \ - '(--usermap --groupmap --chown)--chown=[simple username/groupname mapping]:user and/or group' \ - '*'{-M=,--remote-option=}'[send option to the remote side only]:option string' \ + '(--usermap --groupmap --chown)--chown=[simple username/groupname mapping]:user and/or group:_rsync_users_groups' \ + '*'{-M+,--remote-option=}'[send option to the remote side only]:option string' \ '--preallocate[preallocate the full length of new files]' \ '--iconv=[request charset conversion of filenames]:number' \ '--checksum-seed=:number' \ - "--noatime[don't alter atime when opening source files]" \ '--read-batch=[read a batched update from the specified file]:file:_files' } -- cgit v1.2.3 From a21c0b334c38e6d2a29bc7e0d7697b23d720b64c Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Thu, 3 Jun 2021 00:09:06 +0200 Subject: 48938: remove vim fold and option markers in completions --- ChangeLog | 3 ++ Completion/Unix/Command/_bpython | 3 -- Completion/Unix/Command/_pandoc | 62 ++++++++++++++++++++-------------------- 3 files changed, 34 insertions(+), 34 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index e49333723..772ac111a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-06-02 Oliver Kiddle <opk@zsh.org> + * 48938 (minus _cdrdao changes): Completion/Unix/Command/_pandoc, + Completion/Unix/Command/_bpython: remove vim fold and option markers + * 48939: Completion/Unix/Command/_rsync: update for rsync 3.2.3 2021-05-21 Oliver Kiddle <opk@zsh.org> diff --git a/Completion/Unix/Command/_bpython b/Completion/Unix/Command/_bpython index 233e032e6..2c2ea11b8 100644 --- a/Completion/Unix/Command/_bpython +++ b/Completion/Unix/Command/_bpython @@ -41,6 +41,3 @@ case "$service" in "$gtk_opts[@]" ;; esac - - -# vim:autoindent expandtab shiftwidth=2 tabstop=2 softtabstop=2 filetype=zsh diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index 2ff481e32..bdd261322 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -1,6 +1,6 @@ #compdef pandoc -# {{{ input or output formats with optional extensions +# input or output formats with optional extensions # required option: -T (input|output) (( $+functions[_pandoc_format] )) || _pandoc_format() { @@ -16,8 +16,8 @@ _pandoc_format() { _wanted formats expl 'format' compadd -S '+' -r '-+ ' -a formats fi } -# }}} -# {{{ all supported formats + +# all supported formats (( $+functions[_pandoc_all_formats] )) || _pandoc_all_formats(){ local -a expl @@ -25,16 +25,16 @@ _pandoc_all_formats(){ formats=( $(pandoc --list-input-formats) $(pandoc --list-output-formats) ) _wanted formats expl 'format' compadd -a formats } -# }}} -# {{{ pdf engine choice + +# pdf engine choice (( $+functions[_pandoc_pdf_engine] )) || _pandoc_pdf_engine(){ _alternative \ 'engines:engine:(pdflatex lualatex xelatex latexmk tectonic wkhtmltopdf weasyprint prince context pdfroff)' \ 'engine-executables:engine executable:_files -g "*(#q*)"' } -# }}} -# {{{ options to pass to --pdf-engine command + +# options to pass to --pdf-engine command (( $+functions[_pandoc_pdf_engine_opts] )) || _pandoc_pdf_engine_opts(){ local pdf_engine=${opt_args[--pdf-engine]} @@ -47,8 +47,8 @@ _pandoc_pdf_engine_opts(){ ;; esac } -# }}} -# {{{ data-dir specified by --data-dir option, or the default dir + +# data-dir specified by --data-dir option, or the default dir _pandoc_default_dir() { if (( $+opt_args[--data-dir] )); then echo ${opt_args[--data-dir]:a} @@ -59,7 +59,8 @@ _pandoc_default_dir() { pandoc --version | sed -ne 's/.*[Uu]ser data directory: \([^ ]*\).*/\1/p' fi } -# {{{ template file in $PWD or data-dir/templates/, or URL + +# template file in $PWD or data-dir/templates/, or URL (( $+functions[_pandoc_template] )) || _pandoc_template(){ # find output format from '-t format' or '-o xxx.format' @@ -73,16 +74,16 @@ _pandoc_template(){ "data-dir-templates:template in data-dir:_files -W $template_dir -g $pat" \ 'urls: :_urls' } -# }}} -# {{{ choose highlight-style + +# choose highlight-style (( $+functions[_pandoc_highlight_style] )) || _pandoc_highlight_style(){ _alternative \ 'styles:style:( $(pandoc --list-highlight-styles) )' \ 'style-files:style file:_files -g "*.theme"' } -# }}} -# {{{ filter file in $PWD, data-dir/filters/ or $PATH + +# filter file in $PWD, data-dir/filters/ or $PATH (( $+functions[_pandoc_filter] )) || _pandoc_filter(){ local filters_dir=$(_pandoc_default_dir)/filters @@ -91,8 +92,8 @@ _pandoc_filter(){ 'data-dir-filters:filter in data-dir:_files -W filters_dir' \ 'commands: : _command_names -e' } -# }}} -# {{{ lua filter in $PWD or data-dir/filters/ + +# lua filter in $PWD or data-dir/filters/ (( $+functions[_pandoc_lua_filter] )) || _pandoc_lua_filter(){ local filters_dir=$(_pandoc_default_dir)/filters @@ -100,8 +101,8 @@ _pandoc_lua_filter(){ 'local-filters:local filter:_files -g "*.lua"' \ 'data-dir-filters:filter in data-dir:_files -W filters_dir -g "*.lua"' } -# }}} -# {{{ default file in $PWD or data-dir/defaults/ + +# default file in $PWD or data-dir/defaults/ (( $+functions[_pandoc_defaults_file] )) || _pandoc_defaults_file() { local defaults_dir=$(_pandoc_default_dir)/defaults @@ -109,8 +110,8 @@ _pandoc_defaults_file() { 'local-defaults:default file:_files -g "*.yaml"' \ 'data-dir-defaults:default in data-dir:_files -W defaults_dir -g "*.yaml"' } -# }}} -# {{{ choose reference location + +# choose reference location (( $+functions[_pandoc_reference_location] )) || _pandoc_reference_location(){ local -a policies @@ -121,14 +122,14 @@ _pandoc_reference_location(){ ) _describe 'location' policies } -# }}} -# {{{ choose top level division + +# choose top level division (( $+functions[_pandoc_top_level_division] )) || _pandoc_top_level_division(){ _values 'top level division' default section chapter part } -# }}} -# {{{ choose email obfusication + +# choose email obfusication (( $+functions[_pandoc_email_obfusication] )) || _pandoc_email_obfusication(){ local -a policies @@ -139,8 +140,8 @@ _pandoc_email_obfusication(){ ) _describe 'obfusication' policies } -# }}} -# {{{ choose wrapping policy + +# choose wrapping policy (( $+functions[_pandoc_wrap] )) || _pandoc_wrap() { local -a policies @@ -151,8 +152,8 @@ _pandoc_wrap() { ) _describe 'policy' policies } -# }}} -# {{{ choose eol policy + +# choose eol policy (( $+functions[_pandoc_eol] )) || _pandoc_eol() { local -a policies @@ -163,8 +164,8 @@ _pandoc_eol() { ) _describe 'policy' policies } -# }}} -# {{{ choose changes tracking policy + +# choose changes tracking policy (( $+functions[_pandoc_track_changes] )) || _pandoc_track_changes() { local -a policies @@ -175,7 +176,6 @@ _pandoc_track_changes() { ) _describe 'policy' policies } -# }}} # The real thing _arguments -s \ -- cgit v1.2.3 From f4b2a03625680ad27a3bc77ccec358582aee9094 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Thu, 3 Jun 2021 00:12:54 +0200 Subject: 48952: expand octal codes for record separators in perl completion --- ChangeLog | 3 ++ Completion/Unix/Command/_perl | 99 ++++++++++++++++++++++++++----------------- 2 files changed, 63 insertions(+), 39 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 772ac111a..9edf9418b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-06-02 Oliver Kiddle <opk@zsh.org> + * 48952: Completion/Unix/Command/_perl: expand octal codes for + record separators in perl completion + * 48938 (minus _cdrdao changes): Completion/Unix/Command/_pandoc, Completion/Unix/Command/_bpython: remove vim fold and option markers diff --git a/Completion/Unix/Command/_perl b/Completion/Unix/Command/_perl index 0914264fe..4a917903c 100644 --- a/Completion/Unix/Command/_perl +++ b/Completion/Unix/Command/_perl @@ -1,14 +1,10 @@ #compdef perl -# -# zsh completion code for the Perl interpreter -# Adam Spiers <adam@spiers.net> -# -# Completions currently based on Perl 5.14.1. + typeset -A opt_args _perl () { _arguments -s \ - '-0-[input record separator ($/)]:$/ in octal or hex (\0, if no argument)' \ + '-0-[input record separator ($/)]:: :_perl_input_seps' \ '-a[autosplit mode with -n or -p (splits $_ into @F)]' \ '-C-[control some unicode features]: :_perl_unicode_flags' \ "-c[check syntax only (runs BEGIN and END blocks)]" \ @@ -24,7 +20,7 @@ _perl () { '-h[list help summary]' \ '-i-[edit <> files in place (make backup if extension supplied)]:backup file extension: ' \ '*-I-[specify @INC/#include directory (may be used more than once)]:include path:_files -/' \ - '-l-[enable line ending processing, specifies line terminator]:output record separator in octal: ' \ + '-l-[enable line ending processing, specifies line terminator]:: :_perl_output_seps' \ \*{-m,-M}"-[module.. executes \`use/no module...' before executing your script]:module:_perl_m_opt" \ "-n[assume 'while (<>) { ... }' loop around your script]" \ "-p[assume loop like -n but print line also like sed]" \ @@ -63,6 +59,27 @@ _perl_m_opt () { fi } +_perl_input_seps() { + if [[ $#PREFIX -eq 1 && $PREFIX != [0-9a-zA-Z] ]]; then + # convert a non-octal or potential option character into octal representation + compadd -i "$IPREFIX" -U $(( [##8] ##$PREFIX )) + else + _describe -x -t separators "input record separator, $/ in octal or hex (\0, if no argument) [\n]" '( + 0:paragraph\ mode + 777:slurp\ whole\ input\ files + )' || _comp_mesg=yes + fi +} + +_perl_output_seps() { + if [[ $#PREFIX -eq 1 && $PREFIX != [0-9a-zA-Z] ]]; then + # convert a non-octal or potential option character into octal representation + compadd -i "$IPREFIX" -U $(( [##8] ##$PREFIX )) + else + _message -e separators "output record separator, $\\ in octal or hex [$/]" + fi +} + _perl_config_vars () { if (( ! $+_perl_config_vars )); then _perl_config_vars=( $(perl -MConfig -e 'print join("\n", keys %Config);') ) @@ -80,44 +97,48 @@ _perl_config_vars () { _perl_unicode_flags () { _values -s '' 'unicode bitmask or flags' \ - 'I[ 1 STDIN is assumed to be in UTF-8]' \ - 'O[ 2 STDOUT will be in UTF-8]' \ - 'E[ 4 STDERR will be in UTF-8]' \ - 'S[ 7 I + O + E]' \ - 'i[ 8 UTF-8 is the default PerlIO layer for input streams]' \ - 'o[ 16 UTF-8 is the default PerlIO layer for output streams]' \ - 'D[ 24 i + o]' \ + '(S)I[ 1 STDIN is assumed to be in UTF-8]' \ + '(S)O[ 2 STDOUT will be in UTF-8]' \ + '(S)E[ 4 STDERR will be in UTF-8]' \ + '(I O E)S[ 7 I + O + E]' \ + '(D)i[ 8 UTF-8 is the default PerlIO layer for input streams]' \ + '(D)o[ 16 UTF-8 is the default PerlIO layer for output streams]' \ + '(i o)D[ 24 i + o]' \ 'A[ 32 the @ARGV elements are expected to be strings encoded in UTF-8]' \ 'L[ 64 make "IOEioA" conditional on the locale environment variables]' \ 'a[256 set ${^UTF8CACHE} to -1, used for debugging]' \ } _perl_debugging_flags () { - _values -s '' 'debugging bitmask or flags' \ - 'p[ 1 Tokenizing and parsing (with v, displays parse stack)]' \ - 's[ 2 Stack snapshots (with v, displays all stacks)]' \ - 'l[ 4 Context (loop) stack processing]' \ - 't[ 8 Trace execution]' \ - 'o[ 16 Method and overloading resolution]' \ - 'c[ 32 String/numeric conversions]' \ - 'P[ 64 Print profiling info, preprocessor command for -P, source file input state]' \ - 'm[ 128 Memory and SV allocation]' \ - 'f[ 256 Format processing]' \ - 'r[ 512 Regular expression parsing and execution]' \ - 'x[ 1024 Syntax tree dump]' \ - 'u[ 2048 Tainting checks]' \ - 'U[ 4096 Unofficial, User hacking (reserved for private, unreleased use)]' \ - 'H[ 8192 Hash dump -- usurps values()]' \ - 'X[ 16384 Scratchpad allocation]' \ - 'D[ 32768 Cleaning up]' \ - 'S[ 66536 Thread synchronization]' \ - 'T[ 131072 Tokenising]' \ - 'R[ 262144 Include reference counts of dumped variables (eg when using -Ds)]' \ - 'J[ 524288 Do not s,t,P-debug (Jump over) opcodes within package DB]' \ - 'v[1048576 Verbose: use in conjunction with other flags]' \ - 'C[2097152 Copy On Write]' \ - 'A[4194304 Consistency checks on internal structures]' \ - 'q[8388608 quiet - currently only suppresses the "EXECUTING" message]' \ + _values -s '' 'debug flag or bitmask' \ + 'p[ 1 tokenizing and parsing (with v, display parse stack)]' \ + 's[ 2 stack snapshots (with v, display all stacks)]' \ + 'l[ 4 context (loop) stack processing]' \ + 't[ 8 trace execution]' \ + 'o[ 16 method and overload resolution]' \ + 'c[ 32 string/numeric conversions]' \ + 'P[ 64 print profiling info, source file input state]' \ + 'm[ 128 memory and SV allocation]' \ + 'f[ 256 format processing]' \ + 'r[ 512 regular expression parsing and execution]' \ + 'x[ 1024 syntax tree dump]' \ + 'u[ 2048 tainting checks]' \ + 'U[ 4096 unofficial, user hacking (reserved for private, unreleased use)]' \ + 'X[ 16384 scratchpad allocation]' \ + 'D[ 32768 cleaning up]' \ + 'S[ 66536 Op slab allocation]' \ + 'T[ 131072 tokenising]' \ + 'R[ 262144 include reference counts of dumped variables (e.g. when using -Ds)]' \ + "J[ 524288 show s,t,P-debug (don't jump over) on opcodes within package DB]" \ + 'v[ 1048576 verbose: use in conjunction with other flags]' \ + 'C[ 2097152 copy-on-write]' \ + 'A[ 4194304 consistency checks on internal structures]' \ + 'q[ 8388608 quiet - currently only suppresses the "EXECUTING" message]' \ + 'M[ 16777216 trace smart match resolution]' \ + 'B[ 33554432 dump subroutine definitions, including special blocks like BEGIN]' \ + 'L[ 67108864 trace locale-related info]' \ + 'i[134217728 trace PerlIO layer processing]' \ + 'y[268435456 trace y///, tr/// compilation and execution]' } _perl "$@" -- cgit v1.2.3 From 32450b7c816159d540fe872bf7340928300aa360 Mon Sep 17 00:00:00 2001 From: dana <dana@dana.is> Date: Mon, 14 Jun 2021 22:18:16 -0500 Subject: 48920: _pgrep: Clarify -x description --- ChangeLog | 4 ++++ Completion/Unix/Command/_pgrep | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 83c2ac12d..1f559c22e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2021-06-14 dana <dana@dana.is> + + * 48920: Completion/Unix/Command/_pgrep: Clarify -x description + 2021-06-13 Bart Schaefer <schaefer@zsh.org> * 49069: NEWS, Src/builtin.c: literal interpretation of subscripts diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index e10f42f53..443acf3c8 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -167,7 +167,7 @@ case $state in (pname) local ispat="pattern matching " if (( ${+opt_args[-x]} )); then - ispat="" + ispat+="full " fi if (( ${+opt_args[-f]} )); then local -a matches=( ${(f)"$( -- cgit v1.2.3 From c6603669a2667a4905aa4831f40e276b2c3bd4a4 Mon Sep 17 00:00:00 2001 From: dana <dana@dana.is> Date: Mon, 14 Jun 2021 22:19:38 -0500 Subject: 48920: _pgrep: Address issues related to -f completion --- ChangeLog | 3 +++ Completion/Unix/Command/_pgrep | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 1f559c22e..648f030e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-06-14 dana <dana@dana.is> + * 48920: Completion/Unix/Command/_pgrep: Address issues related to + -f completion + * 48920: Completion/Unix/Command/_pgrep: Clarify -x description 2021-06-13 Bart Schaefer <schaefer@zsh.org> diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index 443acf3c8..38b1aebd8 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -170,10 +170,13 @@ case $state in ispat+="full " fi if (( ${+opt_args[-f]} )); then + local -a opts=( -lf ) + [[ $OSTYPE == linux* ]] && opts=( -a ) local -a matches=( ${(f)"$( - _call_program process-args pgrep -lf ${${:-$PREFIX$SUFFIX}:-.\*} + _call_program process-args pgrep ${(@q)opts} -- \ + ${(q)${${:-$PREFIX$SUFFIX}:-.\*}} )"} ) - local -a displ=( "${${matches[@]//':'/'\:'}[@]/ /:}" ) + local -a displ=( "${${matches[@]//:/\:}[@]/ /:}" ) matches=( "${matches[@]##<-> }" ) local desc=$ispat'process command line' -- cgit v1.2.3 From f1d4a07845a3210401f3619aa59a2653e415f99a Mon Sep 17 00:00:00 2001 From: Max Voit <max.voit+mlzs@with-eyes.net> Date: Thu, 8 Jul 2021 19:47:41 +0200 Subject: 49153: cut off .lua extension from module files that occurs when using lmod for module --- ChangeLog | 6 ++++++ Completion/Unix/Command/_module | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 43129ecc2..1e5ea45bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2021-07-08 Oliver Kiddle <opk@zsh.org> + + * Max Voit: 49153: Completion/Unix/Command/_module: + cut off .lua extension from module files that occurs + when using lmod for module + 2021-07-06 Suraj N. Kurapati <sunaku@riseup.net> * 49128 (github #76): Misc/vcs_info-examples: optimize diff --git a/Completion/Unix/Command/_module b/Completion/Unix/Command/_module index 2a4dba740..23cf0c589 100644 --- a/Completion/Unix/Command/_module +++ b/Completion/Unix/Command/_module @@ -85,7 +85,7 @@ _module_available_modules() { if [[ -n $MODULEPATH ]] && [[ ${+_available_modules} -eq 0 ]] then - _available_modules=(${$(find -L ${(e)=MODULEPATH//:/ } -type f -print 2>/dev/null | grep -v \\.version | sed -e 's,\('${${(e)=MODULEPATH//:/\/\\\|}%\\\|}'\),,g' -e 's,^/*,,g'):#*\~}) + _available_modules=(${$(find -L ${(e)=MODULEPATH//:/ } -type f -print 2>/dev/null | grep -v \\.version | sed -e 's,\('${${(e)=MODULEPATH//:/\/\\\|}%\\\|}'\),,g' -e 's,^/*,,g' -e 's,\.lua$,,g'):#*\~}) fi } -- cgit v1.2.3 From bffe543142978b036621291dcfe08771ad6b4bda Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Fri, 9 Jul 2021 00:08:25 +0200 Subject: 49149: add specific values in completion after ssh-keygen -b depending on the key type --- ChangeLog | 3 +++ Completion/Unix/Command/_ssh | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 1e5ea45bf..eb77f775e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-07-08 Oliver Kiddle <opk@zsh.org> + * 49149: Completion/Unix/Command/_ssh: add specific values + in completion after ssh-keygen -b depending on the key type + * Max Voit: 49153: Completion/Unix/Command/_module: cut off .lua extension from module files that occurs when using lmod for module diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index 82a2a1827..c896f9316 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -5,7 +5,7 @@ _ssh () { local curcontext="$curcontext" state line expl suf arg ret=1 local args sigargs common common_transfer options algopt tmp p1 file cmn cmds sdesc tdesc - typeset -A opt_args + typeset -A opt_args tsizes common=( '(-6)-4[force ssh to use IPv4 addresses only]' @@ -188,9 +188,14 @@ _ssh () { cmds=( -p -i -e -y -c -l -B -D -F -H -K -R -r -M -s -L -A -k -Q -Y ) # basic commands cmn=( -a -b -P -N -C -l -m -O -v -w -Z ) # options common to many basic commands (except -f which is common to most) cms=( -E -q -t -g -M -I -h -n -V -u -U ) # options specific to one basic command + tsizes=( + dsa 1024 + ecdsa '256 384 521' # values appear in key names as listed with ssh -Q key - 521 really is correct + rsa '1024 2048 4096' + ) _arguments -s $args \ - "${p1}(${${(@)cmds:#-[pcKAO]}} ${${(@)cms:#-[t]}} -O)-a+[specify number of rounds]:rounds" \ - "(${${(@)cmds:#-M}} -P ${${(@)cms:#-[MS]}})-b+[specify number of bits in key]:bits in key" \ + "${p1}(${${(@)cmds:#-[pcKAO]}} ${${(@)cms:#-[t]}} -O)-a+[specify number of rounds]:rounds [16]" \ + "(${${(@)cmds:#-M}} -P ${${(@)cms:#-[MS]}})-b+[specify number of bits in key]:bits in key [2048]:"'compadd ${expl\:/-X/-x} ${_comp_mesg\:=-} ${=tsizes[${opt_args[create--t]\:-rsa}]}' \ "$p1(${${(@)cmds:#-[pc]}} -b $cms)-P+[provide old passphrase]:old passphrase" \ "(${${(@)cmds:#-p}} -v ${${(@)cms:#-[qt]}})-N+[provide new passphrase]:new passphrase" \ "(${${(@)cmds:#-c}} -v $cms)-C+[provide new comment]:new comment" \ -- cgit v1.2.3 From e6fdd35a83881a957ac206b4e128886d07f37c71 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Fri, 9 Jul 2021 00:23:52 +0200 Subject: 49150: consistently use singular form for headings on completion match groups --- ChangeLog | 3 +++ Completion/BSD/Command/_portmaster | 14 +++++++------- Completion/BSD/Command/_sysrc | 2 +- Completion/BSD/Command/_systat | 2 +- Completion/Base/Widget/_bash_completions | 2 +- Completion/Base/Widget/_complete_tag | 4 ++-- Completion/Darwin/Command/_defaults | 2 +- Completion/Darwin/Command/_hdiutil | 4 ++-- Completion/Darwin/Command/_softwareupdate | 2 +- Completion/Debian/Command/_apt | 2 +- Completion/Debian/Command/_axi-cache | 2 +- Completion/Debian/Command/_lintian | 6 +++--- Completion/Debian/Command/_module-assistant | 2 +- Completion/Linux/Command/_fusermount | 2 +- Completion/Linux/Command/_ipset | 4 ++-- Completion/Linux/Command/_mdadm | 2 +- Completion/Linux/Command/_sysstat | 6 +++--- Completion/Linux/Type/_fuse_values | 2 +- Completion/Mandriva/Command/_urpmi | 2 +- Completion/Redhat/Command/_yum | 2 +- Completion/Solaris/Command/_coreadm | 2 +- Completion/Solaris/Type/_svcs_fmri | 6 +++--- Completion/Unix/Command/_ack | 4 ++-- Completion/Unix/Command/_adb | 14 +++++++------- Completion/Unix/Command/_baz | 22 ++++++++++----------- Completion/Unix/Command/_bzr | 14 +++++++------- Completion/Unix/Command/_ctags | 4 ++-- Completion/Unix/Command/_cvs | 12 ++++++------ Completion/Unix/Command/_ecasound | 4 ++-- Completion/Unix/Command/_fetchmail | 2 +- Completion/Unix/Command/_ffmpeg | 6 +++--- Completion/Unix/Command/_find | 2 +- Completion/Unix/Command/_fuser | 2 +- Completion/Unix/Command/_gem | 2 +- Completion/Unix/Command/_git | 14 +++++++------- Completion/Unix/Command/_gradle | 8 ++++---- Completion/Unix/Command/_initctl | 22 ++++++++++----------- Completion/Unix/Command/_install | 2 +- Completion/Unix/Command/_joe | 2 +- Completion/Unix/Command/_locate | 2 +- Completion/Unix/Command/_lp | 6 +++--- Completion/Unix/Command/_ls | 2 +- Completion/Unix/Command/_make | 2 +- Completion/Unix/Command/_moosic | 4 ++-- Completion/Unix/Command/_mysql_utils | 2 +- Completion/Unix/Command/_mysqldiff | 4 ++-- Completion/Unix/Command/_nm | 2 +- Completion/Unix/Command/_objdump | 2 +- Completion/Unix/Command/_perforce | 2 +- Completion/Unix/Command/_perl | 4 ++-- Completion/Unix/Command/_perldoc | 4 ++-- Completion/Unix/Command/_ps | 4 ++-- Completion/Unix/Command/_qemu | 4 ++-- Completion/Unix/Command/_quilt | 22 ++++++++++----------- Completion/Unix/Command/_rclone | 6 +++--- Completion/Unix/Command/_rsync | 4 ++-- Completion/Unix/Command/_runit | 6 +++--- Completion/Unix/Command/_scons | 2 +- Completion/Unix/Command/_ssh | 2 +- Completion/Unix/Command/_tla | 22 ++++++++++----------- Completion/Unix/Command/_tmux | 30 ++++++++++++++--------------- Completion/Unix/Command/_tput | 2 +- Completion/Unix/Command/_unison | 2 +- Completion/Unix/Command/_w3m | 2 +- Completion/Unix/Command/_wget | 2 +- Completion/Unix/Command/_xmlsoft | 4 ++-- Completion/Unix/Command/_xmms2 | 16 +++++++-------- Completion/Unix/Command/_yafc | 2 +- Completion/Unix/Type/_email_addresses | 2 +- Completion/Unix/Type/_urls | 2 +- Completion/X/Command/_mozilla | 2 +- Completion/X/Command/_mplayer | 6 +++--- Completion/X/Command/_netscape | 2 +- Completion/X/Command/_pdftk | 12 ++++++------ Completion/X/Command/_vnc | 2 +- Completion/X/Command/_xauth | 2 +- Completion/X/Command/_xournal | 2 +- Completion/Zsh/Command/_bindkey | 2 +- Completion/Zsh/Command/_disable | 10 +++++----- Completion/Zsh/Command/_enable | 10 +++++----- Completion/Zsh/Command/_sched | 2 +- Completion/Zsh/Command/_typeset | 2 +- Completion/Zsh/Command/_zmodload | 4 ++-- Completion/Zsh/Command/_zstyle | 2 +- Completion/Zsh/Context/_subscript | 2 +- Completion/Zsh/Context/_zcalc_line | 2 +- Completion/Zsh/Function/_add-zsh-hook | 2 +- Completion/openSUSE/Command/_hwinfo | 2 +- Completion/openSUSE/Command/_zypper | 12 ++++++------ 89 files changed, 233 insertions(+), 230 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index eb77f775e..489fbbd3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-07-08 Oliver Kiddle <opk@zsh.org> + * 49150: Completion/...: consistently use singular form for + headings on completion match groups + * 49149: Completion/Unix/Command/_ssh: add specific values in completion after ssh-keygen -b depending on the key type diff --git a/Completion/BSD/Command/_portmaster b/Completion/BSD/Command/_portmaster index 48390c9ad..ee6fefc6e 100644 --- a/Completion/BSD/Command/_portmaster +++ b/Completion/BSD/Command/_portmaster @@ -8,11 +8,11 @@ _portmaster_ports() { local expl ret=1 _fbsd_ports _fbsd_cat _fbsd_cat=(${PORTSDIR:-/usr/ports}/[a-z]*(/:t)) if [[ $PREFIX != */* ]] ; then - _wanted cat_packages expl 'category/ports' compadd -S '/' $_fbsd_cat + _wanted cat_packages expl 'category/port' compadd -S '/' $_fbsd_cat else compset -P '*/' _fbsd_ports=(${PORTSDIR:-/usr/ports}/$IPREFIX/*(/:t)) - _wanted cat_packages expl 'category/ports' compadd $_fbsd_ports + _wanted cat_packages expl 'category/port' compadd $_fbsd_ports fi return ret } @@ -77,7 +77,7 @@ _portmaster() { _arguments -s \ $standalone_args \ $common_args \ - '*:packages and ports:_portmaster_pkgs_and_ports' + '*:package or port:_portmaster_pkgs_and_ports' else case "$words[2]" in --clean-distfiles|--clean-distfiles-all|--check-depends|--check-port-dbdir|--version|-help|-h) @@ -86,14 +86,14 @@ _portmaster() { *) if (( $words[(I)-(e|r)] ));then _arguments -s \ - '*:packages:_portmaster_pkgs' + '*:package:_portmaster_pkgs' elif (( kid=$words[(I)-o] ));then if (( CURRENT == $kid + 1 ));then _arguments -s \ - '*:ports replacing:_portmaster_ports' + '*:replacement port:_portmaster_ports' elif (( CURRENT == $kid + 2 )); then _arguments -s \ - '*:package to replace:_portmaster_pkgs' + '*:package to replace:_portmaster_pkgs' else return 0 fi @@ -102,7 +102,7 @@ _portmaster() { else _arguments -s \ $common_args \ - '*:packages and ports:_portmaster_pkgs_and_ports' + '*:package or port:_portmaster_pkgs_and_ports' fi ;; esac diff --git a/Completion/BSD/Command/_sysrc b/Completion/BSD/Command/_sysrc index f0c12a2be..892dac407 100644 --- a/Completion/BSD/Command/_sysrc +++ b/Completion/BSD/Command/_sysrc @@ -29,7 +29,7 @@ _sysrc() { '(- *)-h[print short usage message]' \ '(- *)--help[print full usage message]' \ '-i[ignore unknown variables]' \ - '-j+[jail to operate within]:jails:_jails' \ + '-j+[jail to operate within]:jail:_jails' \ '-n[print only variable values]' \ '-N[print only variable names]' \ '-R+[specify an alternative root]:alternative root:_files -/' \ diff --git a/Completion/BSD/Command/_systat b/Completion/BSD/Command/_systat index 7d837790a..03df07631 100644 --- a/Completion/BSD/Command/_systat +++ b/Completion/BSD/Command/_systat @@ -84,7 +84,7 @@ esac if (( $#screens )); then _arguments -M 'r:|.=* r:|=*' : $opts \ - '1:systat(1) displays:(( ${pre}$^screens ))' \ + '1:systat(1) display:(( ${pre}$^screens ))' \ '2:refresh interval' return fi diff --git a/Completion/Base/Widget/_bash_completions b/Completion/Base/Widget/_bash_completions index 7abb654d4..feb721451 100644 --- a/Completion/Base/Widget/_bash_completions +++ b/Completion/Base/Widget/_bash_completions @@ -32,7 +32,7 @@ local key=$KEYS[-1] expl case $key in '!') _main_complete _command_names ;; - '$') _main_complete - parameters _wanted parameters expl 'exported parameters' \ + '$') _main_complete - parameters _wanted parameters expl 'exported parameter' \ _parameters -g '*export*' ;; '@') _main_complete _hosts diff --git a/Completion/Base/Widget/_complete_tag b/Completion/Base/Widget/_complete_tag index 5b50f1d85..397b8d901 100644 --- a/Completion/Base/Widget/_complete_tag +++ b/Completion/Base/Widget/_complete_tag @@ -50,13 +50,13 @@ if [[ -f $c_path$c_Tagsfile ]]; then -e '/^[a-zA-Z_].*/p' $c_path$c_Tagsfile)) # c_tags_array=($(perl -ne '/([a-zA-Z_0-9]+)[ \t:;,\(]*\x7f/ && # print "$1\n"' $c_path$c_Tagsfile)) - _main_complete - '' _wanted etags expl 'emacs tags' \ + _main_complete - '' _wanted etags expl 'emacs tag' \ compadd -a c_tags_array elif [[ -f $c_path$c_tagsfile ]]; then # tags doesn't have as much in, but the tag is easy to find. # we can use awk here. c_tags_array=($(awk '{ print $1 }' $c_path$c_tagsfile)) - _main_complete - '' _wanted vtags expl 'vi tags' compadd -a c_tags_array + _main_complete - '' _wanted vtags expl 'vi tag' compadd -a c_tags_array else return 1 fi diff --git a/Completion/Darwin/Command/_defaults b/Completion/Darwin/Command/_defaults index ca5d87e65..b05222af6 100644 --- a/Completion/Darwin/Command/_defaults +++ b/Completion/Darwin/Command/_defaults @@ -42,7 +42,7 @@ _defaults(){ _arguments \ "(1)-app:application:_mac_applications" \ "(-app)1:domain:_defaults_domains" \ - "2:keys:_defaults_keys" + "2:key:_defaults_keys" ;; write) _arguments \ diff --git a/Completion/Darwin/Command/_hdiutil b/Completion/Darwin/Command/_hdiutil index 04e81e655..20e69cbc5 100644 --- a/Completion/Darwin/Command/_hdiutil +++ b/Completion/Darwin/Command/_hdiutil @@ -10,7 +10,7 @@ _hdiutil_disk() { disk_desc+=( "$disk_name:${${(M)REPLY% *}#?}" ) fi done - _describe -t devices disks disk_desc + _describe -t devices disk disk_desc } _hdiutil_device() { @@ -143,7 +143,7 @@ _hdiutil(){ _arguments -C '*:: :->subcmds' if (( CURRENT == 1 )); then - _describe -t commands "hdiutil subcommands" _1st_arguments + _describe -t commands "hdiutil subcommand" _1st_arguments return fi diff --git a/Completion/Darwin/Command/_softwareupdate b/Completion/Darwin/Command/_softwareupdate index 6db577b06..6054fd768 100644 --- a/Completion/Darwin/Command/_softwareupdate +++ b/Completion/Darwin/Command/_softwareupdate @@ -55,7 +55,7 @@ _softwareupdate() { ignored_subcmd=(add remove) if (( CURRENT == 1 )); then - _describe -t commands "subcommands" ignored_subcmd && return 0 + _describe -t commands "subcommand" ignored_subcmd && return 0 fi case $words[1] in add) diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt index 4d60cd249..494d3bf82 100644 --- a/Completion/Debian/Command/_apt +++ b/Completion/Debian/Command/_apt @@ -531,7 +531,7 @@ _apt-cache () { --installed:bool \ -- \ /$'help\0'/ \| \ - /$'add\0'/ /$'[^\0]#\0'/ ':files:index files:_files' \# \| \ + /$'add\0'/ /$'[^\0]#\0'/ ':files:index file:_files' \# \| \ /$'gencaches\0'/ \| \ /$'showpkg\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ /$'showsrc\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ diff --git a/Completion/Debian/Command/_axi-cache b/Completion/Debian/Command/_axi-cache index bdefdd979..5fd4c38f8 100644 --- a/Completion/Debian/Command/_axi-cache +++ b/Completion/Debian/Command/_axi-cache @@ -10,7 +10,7 @@ _arguments \ '*:args:->args' && return 0 if (( CURRENT == 2 )); then - _wanted tag expl 'axi-cache commands' \ + _wanted tag expl 'axi-cache command' \ compadd help search more last show again info \ rdetails depends madison policy showpkg showsrc else diff --git a/Completion/Debian/Command/_lintian b/Completion/Debian/Command/_lintian index 71e71ee3d..03491624f 100644 --- a/Completion/Debian/Command/_lintian +++ b/Completion/Debian/Command/_lintian @@ -8,8 +8,8 @@ case "$service" in '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-S,--setup-lab}'[setup or update the laboratory]' \ '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-R,--remove-lab}'[remove the laboratory directory]' \ '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-c,--check}'[run all checks over the specified packages]' \ - '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-C,--check-part}'[run only the specified checks]:checks:_values -s , "lintian checks" binaries bin changelog-file chg conffiles cnf control-file dctrl control-files ctl copyright-file cpy cruft deb deb-format dfmt debconf dc debdiff dif debian-readme drm debhelper dh description des etcfiles etc fields fld files fil huge-usr-share hus infofiles info init.d ini manpages man md5sums md5 menus men menu-format mnf perl prl po-debconf pd scripts scr shared-libs shl spelling splr standards-version std' \ - '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-X,--dont-check-part}'[run only the specified checks]:checks:_values -s , "lintian checks" binaries bin changelog-file chg conffiles cnf control-file dctrl control-files ctl copyright-file cpy cruft deb deb-format dfmt debconf dc debdiff dif debian-readme drm debhelper dh description des etcfiles etc fields fld files fil huge-usr-share hus infofiles info init.d ini manpages man md5sums md5 menus men menu-format mnf perl prl po-debconf pd scripts scr shared-libs shl spelling splr standards-version std' \ + '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-C,--check-part}'[run only the specified checks]: :_values -s , "lintian check" binaries bin changelog-file chg conffiles cnf control-file dctrl control-files ctl copyright-file cpy cruft deb deb-format dfmt debconf dc debdiff dif debian-readme drm debhelper dh description des etcfiles etc fields fld files fil huge-usr-share hus infofiles info init.d ini manpages man md5sums md5 menus men menu-format mnf perl prl po-debconf pd scripts scr shared-libs shl spelling splr standards-version std' \ + '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-X,--dont-check-part}'[run only the specified checks]: :_values -s , "lintian check" binaries bin changelog-file chg conffiles cnf control-file dctrl control-files ctl copyright-file cpy cruft deb deb-format dfmt debconf dc debdiff dif debian-readme drm debhelper dh description des etcfiles etc fields fld files fil huge-usr-share hus infofiles info init.d ini manpages man md5sums md5 menus men menu-format mnf perl prl po-debconf pd scripts scr shared-libs shl spelling splr standards-version std' \ '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-u,--unpack}'[unpack up to unpack level]' \ '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-r,--remove}'[clean packages up to current unpack level]' \ '(-h --help)'{-h,--help}'[help]' \ @@ -23,7 +23,7 @@ case "$service" in '(-o --no-override)'{-o,--no-override}'[do not use the overrides file]' \ '--show-overrides[output tags that have been overridden]' \ '--color:when:(never always auto)' \ - '(-U --unpack-info)'{-U,--unpack-info}'[collect information]:info:_values -s , "collectibles" changelog-file copyright-file debfiles debian-readme diffstat doc-base-files file-info init.d md5sums menu-files objdump-info override-file scripts source-control-file' \ + '(-U --unpack-info)'{-U,--unpack-info}'[collect information]:info:_values -s , "collectible" changelog-file copyright-file debfiles debian-readme diffstat doc-base-files file-info init.d md5sums menu-files objdump-info override-file scripts source-control-file' \ '(-m --md5sums)'{-m,--md5sums}'[check md5sums when processing a .changes file]' \ '--allow-root[override warning when run with superuser privileges]' \ '--cfg:config file:_files' \ diff --git a/Completion/Debian/Command/_module-assistant b/Completion/Debian/Command/_module-assistant index d75284954..b2c1e56ee 100644 --- a/Completion/Debian/Command/_module-assistant +++ b/Completion/Debian/Command/_module-assistant @@ -33,5 +33,5 @@ _arguments -A \ '(-k --kernel-dir)'{-k,--kernel-dir}'[list of kernel headers/source directories, comma separated]:list of dirs:_files -/' \ '(-t --text-mode)'{-t,--text-mode}'[no progress bars]' \ '1:list of commands:_values -s , subcommands "${_module_assistant_commands[@]}"' \ - '*:packages: compadd /usr/src/modass/var_cache_modass/*.avail_version(N:t:r) /var/cache/modass/*.avail_version(N:t:r)' + '*:package: compadd /usr/src/modass/var_cache_modass/*.avail_version(N:t:r) /var/cache/modass/*.avail_version(N:t:r)' diff --git a/Completion/Linux/Command/_fusermount b/Completion/Linux/Command/_fusermount index 02cb57237..41d3dec72 100644 --- a/Completion/Linux/Command/_fusermount +++ b/Completion/Linux/Command/_fusermount @@ -6,7 +6,7 @@ typeset -A opt_args _arguments \ '-h[display help information]' \ '-V[display version information]' \ - '-o[specify mount options]:mount options:_fuse_values "mount options"' \ + '-o[specify mount options]:mount option:_fuse_values "mount option"' \ '-u[unmount a fuse mount]' \ '-z[unmount lazily (work even when if the resource is still busy)]' \ '-q[suppress nonessential output]' \ diff --git a/Completion/Linux/Command/_ipset b/Completion/Linux/Command/_ipset index d05f13caf..061d16799 100644 --- a/Completion/Linux/Command/_ipset +++ b/Completion/Linux/Command/_ipset @@ -25,7 +25,7 @@ _set_types () { _ipsets () { local -a vals vals=( ${${(M)${(f)"$(_call_program ipsets ipset -L)"}%Name: *}#Name: } ) - _describe -t ipsets "IP sets" vals + _describe -t ipsets "IP set" vals } _sets () { _ipsets @@ -118,7 +118,7 @@ _ips () { if (( $ips )); then vals1+=$i; else bindings+=${i/ ->/:}; fi done _describe -t ips "IPs from $words[offset+3] set" vals1 - _describe -t special_values "special values" vals2 + _describe -t special_values "special value" vals2 fi } diff --git a/Completion/Linux/Command/_mdadm b/Completion/Linux/Command/_mdadm index b6dce7ccb..5b73ef4be 100644 --- a/Completion/Linux/Command/_mdadm +++ b/Completion/Linux/Command/_mdadm @@ -156,7 +156,7 @@ _mds () { return 1 fi vals=( ${${${(M)${(f)"$(< $mdadm_conf)"}##ARRAY *}//ARRAY /}%%[[:blank:]]*} ) - _describe -t mds "RAID devices" vals + _describe -t mds "RAID device" vals _arguments \ "(-h --help)"{-h,--help}'[display a mode specific help message]' } diff --git a/Completion/Linux/Command/_sysstat b/Completion/Linux/Command/_sysstat index e091dd3ea..4de855b69 100644 --- a/Completion/Linux/Command/_sysstat +++ b/Completion/Linux/Command/_sysstat @@ -96,12 +96,12 @@ _sar() { '(--human -p)-h[make output easier to read: implies --human and -p]' \ '(- 1 2)--help[display usage information]' \ '--human[print sizes in human readable format]' \ - '*-I[report statistics for interrupts]:interrupts: _values -s "," interrupts 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 SUM ALL XALL' \ + '*-I[report statistics for interrupts]: : _values -s "," interrupt 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 SUM ALL XALL' \ '-i[select records as close as possible to interval]:interval' \ '--iface=-[specify network interfaces for which statistics are to be displayed]:network interface:_sequence _net_interfaces' \ '-j[display persistent device names]:type:(ID LABEL PATH UUID)' \ - '-m[report power management statistics]:keywords: _values -s "," keywords CPU FAN FREQ IN TEMP USB ALL' \ - '-n[report network statistics]:keywords: _values -s "," keywords DEV EDEV NFS NFSD SOCK IP EIP ICMP EICMP TCP ETCP UDP SOCK6 IP6 EIP6 ICMP6 EICMP6 UDP6 FC SOFT ALL' \ + '-m[report power management statistics]:keyword:_sequence compadd - CPU FAN FREQ IN TEMP USB ALL' \ + '-n[report network statistics]:keyword:_sequence compadd - DEV EDEV NFS NFSD SOCK IP EIP ICMP EICMP TCP ETCP UDP SOCK6 IP6 EIP6 ICMP6 EICMP6 UDP6 FC SOFT ALL' \ '-o[save readings to file in binary form]:file:_files' \ '-P[report per-processor statistics]:processor: _values -s "," processors ALL' \ '-p[pretty-print device names]' \ diff --git a/Completion/Linux/Type/_fuse_values b/Completion/Linux/Type/_fuse_values index be830cb40..211eb5b35 100644 --- a/Completion/Linux/Type/_fuse_values +++ b/Completion/Linux/Type/_fuse_values @@ -47,7 +47,7 @@ fvals=( [[ -n $cvalsvar ]] && set -- "$@" ${(P)cvalsvar} if [[ $# -eq 0 ]]; then - set -- 'mount options' $fvals + set -- 'mount option' $fvals else set -- "$@" $fvals fi diff --git a/Completion/Mandriva/Command/_urpmi b/Completion/Mandriva/Command/_urpmi index d897f2c4b..9ab9e45b7 100644 --- a/Completion/Mandriva/Command/_urpmi +++ b/Completion/Mandriva/Command/_urpmi @@ -286,7 +286,7 @@ _urpmi() { "($help --all --interactive --name)--summary[print tag summary: summary]" \ "($help)--uniq[do not print identical lines]" \ "($help --all --interactive --name)--url[print tag url: url]" \ - "*:hdlist files:_files -g '*.cz(-.)'" \ + "*:hdlist file:_files -g '*.cz(-.)'" \ && ret=0 ;; esac diff --git a/Completion/Redhat/Command/_yum b/Completion/Redhat/Command/_yum index a30aa579f..9425ba57c 100644 --- a/Completion/Redhat/Command/_yum +++ b/Completion/Redhat/Command/_yum @@ -167,7 +167,7 @@ _yumdb() { if [ "$cmd" = "help" ]; then if (( CURRENT == 2 )); then - _describe -t commands 'yum commands' _yum_cmds && ret=0 + _describe -t commands 'yum command' _yum_cmds && ret=0 else # help takes one argument _message 'no more arguments' diff --git a/Completion/Solaris/Command/_coreadm b/Completion/Solaris/Command/_coreadm index 7262e6423..655b48e63 100644 --- a/Completion/Solaris/Command/_coreadm +++ b/Completion/Solaris/Command/_coreadm @@ -40,6 +40,6 @@ _arguments -s \ - set2 \ '-p[PID-specific per-process core file name pattern]:' \ '-P[PID-specific per-process core file content]:content:_values -s + "content" $content' \ - '*:pids:_pids' \ + '*:pid:_pids' \ - set3 \ '-u[update options from coreadm.conf]' diff --git a/Completion/Solaris/Type/_svcs_fmri b/Completion/Solaris/Type/_svcs_fmri index ffade6985..b090461c5 100644 --- a/Completion/Solaris/Type/_svcs_fmri +++ b/Completion/Solaris/Type/_svcs_fmri @@ -66,18 +66,18 @@ _svcs_fmri() { # _wanted fmri expl "full or unambiguously abbreviated FMRIs" \ # _multi_parts -i / fmri_abbrevs - _wanted fmri expl "full or unambiguously abbreviated FMRIs" \ + _wanted fmri expl "full or unambiguously abbreviated FMRI" \ compadd $fmri_abbrevs ;; (-m) - _wanted fmri expl "milestone FMRIs" \ + _wanted fmri expl "milestone FMRI" \ compadd $(svcs -H -o fmri svc:/milestone/\*) all ;; (-r) # TODO: need some way to pick out only restarters - _wanted fmri expl "restarter FMRIs" \ + _wanted fmri expl "restarter FMRI" \ compadd master reset svc:/network/inetd:default ;; diff --git a/Completion/Unix/Command/_ack b/Completion/Unix/Command/_ack index e83a9330e..6dc3ab0d1 100644 --- a/Completion/Unix/Command/_ack +++ b/Completion/Unix/Command/_ack @@ -72,7 +72,7 @@ _arguments -C -s -S \ '(1)-g[print files where the relative path + filename matches the given pattern]:pattern to match against filenames' \ '--sort-files[sorts the found files lexically]' \ '--show-types[print the file types that ack associates with each file]' \ - '(--files-from -x)--files-from=[read the list of files to search from specified file]:files:_files' \ + '(--files-from -x)--files-from=[read the list of files to search from specified file]:file:_files' \ '(-x --files-from)-x[read the list of files to search from standard input]' \ '*--ignore-dir'{,ectory}'=[ignore directory]:directory:_directories' \ '*--noignore-dir'{,ectory}'=[remove directory from ignored list]:directory:_directories' \ @@ -86,7 +86,7 @@ _arguments -C -s -S \ '*--type-'{add,set}'=[files with the given extensions are recognized as being of the given type]:type-def:->type-defs' \ '*--type-del=[remove all filters associated with specified file type]: :->file-types' \ '(--env)--noenv[ignore environment variables and global ackrc files]' '!(--noenv)--env)' \ - '--ackrc=[specify an ackrc file to use]:files:_files' \ + '--ackrc=[specify an ackrc file to use]:file:_files' \ '--ignore-ack-defaults[ignore default definitions included with ack]' \ "${ign}(- 1 *)--create-ackrc[output an ackrc based on customizations]" \ "${ign}(- 1 *)"{-\?,--help}'[display usage information]' \ diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb index 75a447dfc..21cd68761 100644 --- a/Completion/Unix/Command/_adb +++ b/Completion/Unix/Command/_adb @@ -85,7 +85,7 @@ _adb() { '-s[serial]: :_adb_device_serial' \ '( -e)-d[device]' \ '(-d )-e[emulator]' \ - '1:options:_adb_options_handler' \ + '1:option:_adb_options_handler' \ '*: : _default' return @@ -141,7 +141,7 @@ _adb_dispatch_command () { '(-d -e)-s[serial]: :_adb_device_serial' \ '(-s -e)-d[device]' \ '(-d -s)-e[emulator]' \ - '*:options:_adb_options_handler' + '*:option:_adb_options_handler' ;; esac } @@ -392,7 +392,7 @@ _adb_check_log_redirect () { (( $+functions[_adb_trace_opts] )) || _adb_trace_opts() { - _values -s , 'adb trace options' \ + _values -s , 'adb trace option' \ '(1 adb sockets packets rwx usb sync sysdeps transport jdwp)all' \ '(all adb sockets packets rwx usb sync sysdeps transport jdwp)1' \ 'adb' \ @@ -418,7 +418,7 @@ _adb_device_serial() { devices[(i)${device%:*}:*]=$device fi done - _describe -t dev_serial 'available devices' devices + _describe -t dev_serial 'available device' devices } (( $+functions[_adb_logcat_filter_specification] )) || @@ -459,13 +459,13 @@ _adb_dispatch_logcat() { (( $+functions[_adb_options_handler] )) || _adb_options_handler() { local expl - _wanted adb_options expl 'adb options' compadd "${ALL_ADB_COMMANDS[@]}" + _wanted adb_options expl 'adb option' compadd "${ALL_ADB_COMMANDS[@]}" } (( $+functions[_adb_shell_commands_handler] )) || _adb_shell_commands_handler() { local expl - _wanted adb_shell_commands expl 'adb shell commands' compadd ls pm am mkdir rmdir rm cat + _wanted adb_shell_commands expl 'adb shell command' compadd ls pm am mkdir rmdir rm cat } (( $+functions[_adb_device_available] )) || @@ -514,7 +514,7 @@ _adb_installed_packages() { _adb_users() { local -a users users=( ${${${(M)${(f)"$(adb shell pm list users)"}:#*UserInfo*}#*UserInfo\{}%:*} ) - _describe -t users 'users' users + _describe -t users 'user' users } (( $+functions[_adb_cache_policy_single_command] )) || diff --git a/Completion/Unix/Command/_baz b/Completion/Unix/Command/_baz index 6787f41e2..4dfcdf882 100644 --- a/Completion/Unix/Command/_baz +++ b/Completion/Unix/Command/_baz @@ -38,8 +38,8 @@ _baz_revisions () { _arch_namespace baz 4 "$argv[@]" } (( $+functions[_baz_local_revisions] )) || _baz_local_revisions () { local expl1 expl2 tree_version=`$BAZ tree-version` - _description -V applied-patches expl1 "patches from this version" - _description -V other-patches expl2 "patches from other versions" + _description -V applied-patches expl1 "patch from this version" + _description -V other-patches expl2 "patch from other versions" compadd "$expl1[@]" `$BAZ logs` compadd "$expl2[@]" `$BAZ logs --full $($BAZ log-versions | grep -v $tree_version)` # This is incredibly slow. @@ -82,7 +82,7 @@ _baz_limit () { #presently only does push-mirror style limits if [[ $PREFIX != *--* ]]; then _description -V categories expl "categories in $archive" - compadd -q -S -- "$expl[@]" `$BAZ categories $archive` + compadd -q -S -- "$expl[@]" `$BAZ category $archive` else _baz_namespace_branches 3 fi @@ -98,7 +98,7 @@ _baz_tree_or_rev () { _baz_libraries () { local libraries expl libraries=($(_call_program baz $BAZ my-revision-library)) - _description -V libraries expl "revision libraries" + _description -V libraries expl "revision library" compadd "$expl[@]" -a libraries } @@ -115,7 +115,7 @@ _baz_my_revision_library () { _baz_log_versions () { local logs expl logs=($(_call_program baz $BAZ log-versions)) - _description -V versions expl "log versions" + _description -V versions expl "log version" compadd "$expl[@]" -a logs } @@ -238,12 +238,12 @@ methods=( cmd_tagging_method=($cmd_id_tagging_method) local cmd_add cmd_add_id cmd_add_tag -cmd_add=('*:files to add:_files') +cmd_add=('*:file to add:_files') cmd_add_id=($cmd_add) cmd_add_tag=($cmd_add) local cmd_delete cmd_delete_id cmd_delete_tag -cmd_delete=('*:files to delete:_files') +cmd_delete=('*:file to delete:_files') cmd_delete_id=($cmd_delete) cmd_delete_tag=($cmd_delete) @@ -272,7 +272,7 @@ cmd_changeset=( ':ORIG:_files -/' ':MOD:_files -/' ':DEST:_files -/' - '*:files:_files' + '*:file:_files' ) cmd_mkpatch=("$cmd_changeset[@]") @@ -288,7 +288,7 @@ local cmd_make_archive cmd_make_archive=('::name:' ':location:_files -/') local cmd_archive_setup -cmd_archive_setup=('*:versions:_baz_branches --trailing-dashes') +cmd_archive_setup=('*:version:_baz_branches --trailing-dashes') local cmd_make_category cmd_make_category=(':category:_baz_archives -S /') @@ -304,7 +304,7 @@ cmd_import=('::version:_baz_versions') cmd_imprev=($cmd_import) local cmd_commit cmd_cmtrev -cmd_commit=('*:files:_files') +cmd_commit=('*:file:_files') cmd_cmtrev=($cmd_commit) local cmd_get cmd_getrev @@ -573,7 +573,7 @@ _baz_main () { local -U cmds help=(${(f)"$($BAZ help)"}) cmds=(${${${${(M)help:#* :*}/ #: #/:}%% ##}## #}) - arguments=(':commands:(($cmds))') + arguments=(':command:(($cmds))') fi _arguments -S -A '-*' \ {"${hide_short}(: -)-V",'(: -)--version'}'[display version]' \ diff --git a/Completion/Unix/Command/_bzr b/Completion/Unix/Command/_bzr index 1b755b4ec..121c28166 100644 --- a/Completion/Unix/Command/_bzr +++ b/Completion/Unix/Command/_bzr @@ -65,7 +65,7 @@ case $cmd in '--no-recurse[do not recurse into subdirectories]' '(-q --quiet -v --verbose)'{--quiet,-q}'[be quiet]' '(-v --verbose -q --quiet)'{--verbose,-v}'[display more information]' - '*:unknown files:_bzr_unknownFiles' + '*:unknown file:_bzr_unknownFiles' ) ;; @@ -74,7 +74,7 @@ case $cmd in '--all[show annotations on all lines]' '--long[show date in annotations]' '(-r --revision)'{--revision=,-r}'[the revision to show]:rev:' - '*:files:_bzr_versionedFiles' + '*:file:_bzr_versionedFiles' ) ;; @@ -100,7 +100,7 @@ case $cmd in (rename|move|mv) if (( CURRENT == 2 )); then - args+=( '*:files:_bzr_versionedFiles' ) + args+=( '*:file:_bzr_versionedFiles' ) else args=( '*:destination dir:_files -/' ) fi @@ -218,7 +218,7 @@ case $cmd in '--unchanged[include unchanged files]' '(-q --quiet -v --verbose)'{--quiet,-q}'[be quiet]' '(-v --verbose -q --quiet)'{--verbose,-v}'[display more information]' - '*:modified files:_bzr_modifiedFiles' + '*:modified file:_bzr_modifiedFiles' ) ;; @@ -229,7 +229,7 @@ case $cmd in '--all[shelve all changes]' '(-q --quiet)'{--quiet,-q}'[be quiet]' '(-v --verbose)'{--verbose,-v}'[display more information]' - '*:modified files:_bzr_modifiedFiles' + '*:modified file:_bzr_modifiedFiles' ) ;; @@ -279,7 +279,7 @@ case $cmd in '(-r --revision)'{--revision=,-r}'[revision]:revision:' '--diff-options=[options to pass to gdiff]:diff options:' '(-p --prefix)'{--prefix,-p}'[set prefix added to old and new filenames]' - '*:files:_files' + '*:file:_files' ) ;; @@ -376,7 +376,7 @@ case $cmd in args+=( '--all[show annotations on all lines]' "--plain[don't highlight annotation lines]" - '*:files:_bzr_versionedFiles' + '*:file:_bzr_versionedFiles' ) ;; diff --git a/Completion/Unix/Command/_ctags b/Completion/Unix/Command/_ctags index 3c80ba1c5..e2b28011b 100644 --- a/Completion/Unix/Command/_ctags +++ b/Completion/Unix/Command/_ctags @@ -147,7 +147,7 @@ if [ "$_ctags_type" = "universal" ]; then "--roles--[enable/disable tag roles for kinds of <lang>]:language:->languagedot" "--sort=-[should tags be sorted]:argument:(yes no foldcase)" "--tag-relative=-[should paths be relative to location of tag file]:argument:(yes no always never)" - "--totals=-[print stats about input and tag files]:arguments:(yes no extra)" + "--totals=-[print stats about input and tag files]:argument:(yes no extra)" "(--verbose -V)--verbose=-[enable verbose messages describing actions]:bool:(yes no)" "(--verbose -V)-V[enable verbose messages describing actions]" "--version[print version]" @@ -196,7 +196,7 @@ elif [ "$_ctags_type" = "exuberant" ]; then "--regex--[define regex for locating tags in specific lang]:language:->language" "--sort=-[should tags be sorted]:argument:(yes no foldcase)" "--tag-relative=-[should paths be relative to location of tag file]:argument:(yes no)" - "--totals=-[print stats about input and tag files]:arguments:(yes no)" + "--totals=-[print stats about input and tag files]:argument:(yes no)" "(--verbose -V)--verbose=-[enable verbose messages describing actions]:bool:(yes no)" "(--verbose -V)-V[enable verbose messages describing actions]" "--version[print version]" diff --git a/Completion/Unix/Command/_cvs b/Completion/Unix/Command/_cvs index cba3eb773..4dc5b6c60 100644 --- a/Completion/Unix/Command/_cvs +++ b/Completion/Unix/Command/_cvs @@ -371,10 +371,10 @@ _cvs_log() { '-R[print the name of RCS file in the repository]' \ '-N[don'\''t list tags]' \ '(-h)-t[header with descriptive text]' \ - '-d+[specify dates]:dates' \ + '-d+[specify dates]:date range' \ '-r-[specify revisions]:revisions' \ - '-s+[specify states]:states:(Exp Stab Rel dead)' \ - '-w-[specify logins]:logins' \ + '-s+[specify states]:state:_sequence compadd - Exp Stab Rel dead' \ + '-w-[specify logins]:login list' \ '*:file:_cvs_files' } @@ -388,10 +388,10 @@ _cvs_rlog() { '(-l)-R[recursive]' \ '-N[don'\''t list tags]' \ '(-h)-t[header with descriptive text]' \ - '-d+[specify dates]:dates' \ + '-d+[specify dates]:date range' \ '-r-[specify revisions]:revisions' \ - '-s+[specify states]:states:(Exp Stab Rel dead)' \ - '-w-[specify logins]:logins' \ + '-s+[specify states]:state:_sequence compadd - Exp Stab Rel dead' \ + '-w-[specify logins]:login list' \ '*:file:_cvs_modules' } diff --git a/Completion/Unix/Command/_ecasound b/Completion/Unix/Command/_ecasound index a39e426db..5fd9055a7 100644 --- a/Completion/Unix/Command/_ecasound +++ b/Completion/Unix/Command/_ecasound @@ -102,9 +102,9 @@ case $state in elif compset -P '*,*,'; then _message 'sampling rate' elif compset -P '*,'; then - _message 'channels' + _message 'channel' else - _values 'sampling parameters' \ + _values 'sampling parameter' \ 'u8[unsigned 8-bit]' \ 's16_le[signed 16-bit little endian]' \ 's16_be[signed 16-bit big endian]' \ diff --git a/Completion/Unix/Command/_fetchmail b/Completion/Unix/Command/_fetchmail index 31a92d984..bc5a39688 100644 --- a/Completion/Unix/Command/_fetchmail +++ b/Completion/Unix/Command/_fetchmail @@ -4,7 +4,7 @@ _arguments -S \ {--bsmtp,'(--logfile)-L','(-L)--logfile','(--fetchmailrc)-f','(-f)--fetchmailrc','(--idfile)-i','(-i)--idfile'}':file:_files' \ {--plugin,--plugout,'(--mda)-m','(-m)--mda'}':command:_command_names -e' \ {'(--username)-u','(-u)--username'}:user:_users \ - '--auth:authentication types:(password kerberos kerberos_v5)' \ + '--auth:authentication type:(password kerberos kerberos_v5)' \ {'(--protocol)-p','(-p)--protocol'}:protocol:'(auto pop2 pop3 apop rpop kpop sdps imap imap-k4 imap-gss etrn)' \ {'(--port)-P','(-P)--port'}':port number' \ '*:mail server:_hosts' \ diff --git a/Completion/Unix/Command/_ffmpeg b/Completion/Unix/Command/_ffmpeg index c0b229f35..1329939cd 100644 --- a/Completion/Unix/Command/_ffmpeg +++ b/Completion/Unix/Command/_ffmpeg @@ -6,7 +6,7 @@ typeset -A opt_args (( $+functions[_ffmpeg_presets] )) || _ffmpeg_presets() { local presets presets=(~/.ffmpeg/*.ffpreset(:t:r) "$FFMPEG_DATADIR"/*.ffpreset(:t:r)) - _wanted ffmpeg-presets expl 'select preset' compadd -a presets + _wanted ffmpeg-presets expl 'preset' compadd -a presets } (( $+functions[_ffmpeg_acodecs] )) || _ffmpeg_acodecs() { @@ -49,7 +49,7 @@ typeset -A _ffmpeg_flags (( $+functions[_ffmpeg_flag_options] )) || _ffmpeg_flag_options() { local expl - _wanted options expl 'select flags' compadd -S '' -- {-,+}${^flag_options} + _wanted options expl 'flag' compadd -S '' -- {-,+}${^flag_options} } (( $+functions[_ffmpeg_more_flag_options] )) || _ffmpeg_more_flag_options() { @@ -177,7 +177,7 @@ _arguments -C -S \ && return [[ "$state" == "vfilters" ]] && - _values -s , -S = 'video filters' \ + _values -s , -S = 'video filter' \ 'aspect:set aspect ratio (rational number X\:Y or decimal number):' \ 'crop:crop input video (x\:y\:width\:height):' \ 'format: :_sequence -s : _ffmpeg_pix_fmts' \ diff --git a/Completion/Unix/Command/_find b/Completion/Unix/Command/_find index 916fcf2e6..8ff60baf2 100644 --- a/Completion/Unix/Command/_find +++ b/Completion/Unix/Command/_find @@ -89,7 +89,7 @@ case $variant in '-X[warn if filename contains characters special to xargs]' '-f[specify file hierarchy to traverse]:path:_directories' "-x[don't span filesystems]" - '*-flags:flags:_chflags' + '*-flags:flag:_chflags' ) ;| freebsd*|dragonfly*) args+=( '*-sparse' ) ;| diff --git a/Completion/Unix/Command/_fuser b/Completion/Unix/Command/_fuser index f497729fc..05de1c529 100644 --- a/Completion/Unix/Command/_fuser +++ b/Completion/Unix/Command/_fuser @@ -50,7 +50,7 @@ case $variant in ) argf=( '*:name: _alternative "files:file:_files" "services:service:_fuser_services"' ) [[ -prefix - && -z ${${words[1,CURRENT-1]}[(r)-[A-Z][A-Z]*]} ]] && - argf[1]+=' "signal:signals:_signals -P-"' + argf[1]+=' "signals:signal:_signals -P-"' ;; freebsd*|openbsd*|solaris2.<9->) args+=( diff --git a/Completion/Unix/Command/_gem b/Completion/Unix/Command/_gem index b35a5c358..53adfb89c 100644 --- a/Completion/Unix/Command/_gem +++ b/Completion/Unix/Command/_gem @@ -46,7 +46,7 @@ if [[ $state = command ]]; then 'gem_dependencies:gem dependencies file guide' 'platforms:show information about platforms' ) - _describe -t topics 'help topics' helptopics -- && ret=0 + _describe -t topics 'help topic' helptopics -- && ret=0 ;& subcommands) cmds=( ${${${(M)${(f)"$(_call_program commands gem help commands)"}:# [^ ]*}## #}/ ##/:} ) diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 0267acfa8..d27b43098 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -76,8 +76,8 @@ _git-add () { declare -a ignored_files_alternatives if [[ -n ${opt_args[(I)-f|--force]} ]]; then ignored_files_alternatives=( - 'ignored-modified-files:ignored modified files:__git_ignore_line_inside_arguments __git_modified_files --ignored' - 'ignored-other-files:ignored other files:__git_ignore_line_inside_arguments __git_other_files --ignored') + 'ignored-modified-files:ignored modified file:__git_ignore_line_inside_arguments __git_modified_files --ignored' + 'ignored-other-files:ignored other file:__git_ignore_line_inside_arguments __git_other_files --ignored') fi _alternative \ @@ -330,7 +330,7 @@ _git-branch () { "($l $m $d -f --force)"{-f,--force}'[force the creation of a new branch]' \ "($l $m $d -t --track)"{-t,--track}'[setup configuration so that pull merges from the start point]' \ "($l $m $d)--no-track[override the branch.autosetupmerge configuration variable]" \ - "($l $m $d -u --set-upstream --set-upstream-to --unset-upstream)"{-u+,--set-upstream-to=}'[set up configuration so that pull merges]:remote-branches:__git_remote_branch_names' \ + "($l $m $d -u --set-upstream --set-upstream-to --unset-upstream)"{-u+,--set-upstream-to=}'[set up configuration so that pull merges]:remote branch:__git_remote_branch_names' \ "($l $m $d -u --set-upstream --set-upstream-to --unset-upstream)--unset-upstream[remove upstream configuration]" \ "($l $m $d)*--contains=[only list branches that contain the specified commit]: :__git_committishs" \ "($l $m $d)*--no-contains=[only list branches that don't contain the specified commit]: :__git_committishs" \ @@ -3138,7 +3138,7 @@ __git_config_option-or-value () { ;; (*.) local -a existing_subsections=( ${${${(M)git_present_options:#${IPREFIX}*.*}#${IPREFIX}}%.*} ) - _describe -t existing-subsections "existing subsections" existing_subsections -S . && ret=0 + _describe -t existing-subsections "existing subsection" existing_subsections -S . && ret=0 ;; esac else @@ -4070,7 +4070,7 @@ _git-help () { '(-a --all -g --guides -c --config -i --info -m --man)'{-w,--web}'[display manual for the command in HTML format]' \ '(-g --guides -c --config -i --info -m --man -w --web)'{-g,--guides}'[prints a list of useful guides on the standard output]' \ '(-v --verbose)'{-v,--verbose}'[print command descriptions]' \ - ': : _alternative commands:command:_git_commands "guides:git guides:(attributes cli core-tutorial cvs-migration diffcore everyday glossary hooks ignore modules namespaces repository-layout revisions tutorial tutorial-2 workflows)"' + ': : _alternative commands:command:_git_commands "guides:git guide:(attributes cli core-tutorial cvs-migration diffcore everyday glossary hooks ignore modules namespaces repository-layout revisions tutorial tutorial-2 workflows)"' } (( $+functions[_git-instaweb] )) || @@ -5381,7 +5381,7 @@ _git-pack-redundant () { '(:)--all[process all packs]' \ '--alt-odb[do not require objects to be present in local packs]' \ '--verbose[output some statistics to standard error]' \ - '(--all)*::packs:_files -g "*.pack(-.)"' + '(--all)*::pack:_files -g "*.pack(-.)"' } (( $+functions[_git-rev-list] )) || @@ -7317,7 +7317,7 @@ __git_repositories () { __git_local_repositories () { local expl - _wanted local-repositories expl 'local repositories' _directories + _wanted local-repositories expl 'local repository' _directories } (( $+functions[__git_repositories_or_urls] )) || diff --git a/Completion/Unix/Command/_gradle b/Completion/Unix/Command/_gradle index 9a75daefb..adf5e9aa8 100644 --- a/Completion/Unix/Command/_gradle +++ b/Completion/Unix/Command/_gradle @@ -95,18 +95,18 @@ if [[ $words[CURRENT] != -* ]]; then _tags gradle_group gradle_all while _tags; do # Offer main tasks and secondary tasks in different tags. - _requested gradle_group && _describe 'group tasks' gradle_group_tasks && ret=0 - _requested gradle_all && _describe 'secondary tasks' gradle_all_tasks && ret=0 + _requested gradle_group && _describe 'group task' gradle_group_tasks && ret=0 + _requested gradle_all && _describe 'secondary task' gradle_all_tasks && ret=0 (( ret )) || break done elif [[ $state == alltask ]]; then # After '--exclude-task', we don't make a distinction between main tasks and # secondary tasks. - _describe 'all tasks' gradle_group_tasks -- gradle_all_tasks && ret=0 + _describe 'task' gradle_group_tasks -- gradle_all_tasks && ret=0 fi fi else - _describe 'built-in tasks' '( + _describe 'built-in task' '( "dependencies:Displays all dependencies declared in root project." "dependencyInsight:Displays the insight into a specific dependency in root project." "help:Displays a help message." diff --git a/Completion/Unix/Command/_initctl b/Completion/Unix/Command/_initctl index 2d7c2494b..b404c0c16 100644 --- a/Completion/Unix/Command/_initctl +++ b/Completion/Unix/Command/_initctl @@ -51,14 +51,14 @@ _initctl_known_events() _initctl_multiple_known_events() { [[ ${#_initctl_events_list} -eq 0 ]] && _initctl_fillarray_events_args - _values -s "," "Events" "$_initctl_events_list[@]" + _values -s "," "event" "$_initctl_events_list[@]" } # list KEY= arguments, generate array if necessary _initctl_known_eventargs() { [[ ${#_initctl_eventargs_list} -eq 0 ]] && _initctl_fillarray_events_args - _values "Argument Keys" "$_initctl_eventargs_list[@]" + _values "argument key" "$_initctl_eventargs_list[@]" } # describe and offer commands for initctl, then call matching completion function @@ -82,7 +82,7 @@ _initctl_command() ) if (( CURRENT == 1 )); then - _describe -t command "initctl Commands" cmds + _describe -t command "initctl command" cmds fi local cmd=$words[1] @@ -97,8 +97,8 @@ _initctl_startstop() _arguments \ '--no-wait[do not wait for operation to complete before exiting]' \ "${common_args[@]}" \ - ':Upstart Jobs:_initctl_helper_jobs' \ - '*::Argument Keys:_initctl_known_eventargs' + ':upstart job:_initctl_helper_jobs' \ + '*::argument key:_initctl_known_eventargs' } # completion for anything that takes one job @@ -106,7 +106,7 @@ _initctl_argjob() { _arguments \ "${common_args[@]}" \ - ':Upstart Jobs:_initctl_helper_jobs' \ + ':upstart job:_initctl_helper_jobs' \ '*::' } @@ -116,8 +116,8 @@ _initctl_emit() _arguments \ '--no-wait[do not wait for event to finish before exiting]' \ "${common_args[@]}" \ - ':Events:_initctl_known_events' \ - '*::Argument Keys:_initctl_known_eventargs' + ':event:_initctl_known_events' \ + '*::argument key:_initctl_known_eventargs' } # the fallback, just the options @@ -133,7 +133,7 @@ _initctl_show-config() _arguments \ "(-e --enumerate)"{-e,--enumerate}"[enumerate emit lines]" \ "${common_args[@]}" \ - '::Upstart Jobs:_initctl_helper_jobs' \ + '::upstart job:_initctl_helper_jobs' \ '*::' } @@ -144,7 +144,7 @@ _initctl_check-config() "(-i --ignore-events)"{-i,--ignore-events}"[list of comma-separated events to ignore]:Events:_initctl_multiple_known_events" \ "(-w --warn)"{-w,--warn}"[treat any unknown jobs or events as error]" \ "${common_args[@]}" \ - '::Upstart Jobs:_initctl_helper_jobs' \ + '::upstart job:_initctl_helper_jobs' \ '*::' } @@ -172,7 +172,7 @@ _initctl() # depending on which command was used, call different completion functions case $service in initctl) - _arguments "${common_args[@]}" '*::Initctl Commands:_initctl_command' + _arguments "${common_args[@]}" '*::initctl command:_initctl_command' ;; start|stop|restart|reload|status) _call_function ret _initctl_${cmd_completion_funcs[${service}]-${cmd_completion_default}} diff --git a/Completion/Unix/Command/_install b/Completion/Unix/Command/_install index 5ad84645e..364119961 100644 --- a/Completion/Unix/Command/_install +++ b/Completion/Unix/Command/_install @@ -106,7 +106,7 @@ case $state in 'a[symlinks use absolute path]' 'r[symlinks use relative path]' ) - _values -S '' 'link flags' $tmp && ret=0 + _values -S '' 'link flag' $tmp && ret=0 ;; esac diff --git a/Completion/Unix/Command/_joe b/Completion/Unix/Command/_joe index 592c34a10..74b0bf1a3 100644 --- a/Completion/Unix/Command/_joe +++ b/Completion/Unix/Command/_joe @@ -36,4 +36,4 @@ _arguments \ '-linums[display line numbers before each line]' \ '-rdonly[make file read-only]' \ '-keymap[use an alternate section of joerc for keybindings]:keymap name' \ - '*:files:_files' + '*:file:_files' diff --git a/Completion/Unix/Command/_locate b/Completion/Unix/Command/_locate index 23305f798..af07473b3 100644 --- a/Completion/Unix/Command/_locate +++ b/Completion/Unix/Command/_locate @@ -44,7 +44,7 @@ case $variant in -u'[create slocate database starting at path /]' -U'[create slocate database starting at given path]:directory:_files -/' -c'[parse GNU locate updatedb with -u, -U]' - -e'[exclude directories with -u, -U]:directories:_files -/' + -e'[exclude directories with -u, -U]: : _dir_list -s,' -f'[exclude file system types from db with -u, -U]:file system:_file_systems' -l'[security level]:level:(0 1)' -q'[quiet mode]' diff --git a/Completion/Unix/Command/_lp b/Completion/Unix/Command/_lp index 914d63ff2..ad7e97203 100644 --- a/Completion/Unix/Command/_lp +++ b/Completion/Unix/Command/_lp @@ -83,7 +83,7 @@ _lp_job_options() "DuplexTumble:flip short side" "DuplexNoTumble:flip long side" "None") - _describe "duplex options" desc_opts + _describe "duplex option" desc_opts ;; (*) @@ -103,11 +103,11 @@ _lp_job_options() eq_suffix=(-S '=') fi - _description lpopts expl "generic printer options" + _description lpopts expl "generic printer option" compadd "$expl[@]" $eq_suffix $lopts_with_args compadd "$expl[@]" $lopts_no_args - _description printeropts expl "printer specific options" + _description printeropts expl "printer specific option" compadd "$expl[@]" $eq_suffix \ $(_call_program list-printer-options \ lpoptions $printer -l | cut -d/ -f1) diff --git a/Completion/Unix/Command/_ls b/Completion/Unix/Command/_ls index 1fd9383f5..df14e7e2c 100644 --- a/Completion/Unix/Command/_ls +++ b/Completion/Unix/Command/_ls @@ -196,7 +196,7 @@ else '(-q --hide-control-chars)--show-control-chars' '(- :)--help[display help information]' '(- :)--version[display version information]' - '*:files:_files' + '*:file:_files' ) if [[ $OSTYPE = linux* ]]; then arguments+=( diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make index 21ed56184..ae91440f0 100644 --- a/Completion/Unix/Command/_make +++ b/Completion/Unix/Command/_make @@ -204,7 +204,7 @@ _make() { ;; (debug) - _values -s , 'debug options' \ + _values -s , 'debug option' \ '(b v i j m)a[all debugging output]' \ 'b[basic debugging output]' \ '(b)v[one level above basic]' \ diff --git a/Completion/Unix/Command/_moosic b/Completion/Unix/Command/_moosic index 54d768c8c..475a0c75c 100644 --- a/Completion/Unix/Command/_moosic +++ b/Completion/Unix/Command/_moosic @@ -216,7 +216,7 @@ _moosic_cmd_version() { _moosic_song_files() { _arguments -A '-*' $main_opts $filelist_opts $auto_opts \ - '*:song files:_files' + '*:song file:_files' } _moosic_cmd_append() { @@ -282,7 +282,7 @@ _moosic_cmd_stagger-merge() { _moosic_cmd_interval-add() { _arguments -A '-*' $main_opts $filelist_opts \ '1:interval:' \ - '*:song files:_files' + '*:song file:_files' } ### REMOVING COMMANDS diff --git a/Completion/Unix/Command/_mysql_utils b/Completion/Unix/Command/_mysql_utils index f1ad97bcd..a7b285f1c 100644 --- a/Completion/Unix/Command/_mysql_utils +++ b/Completion/Unix/Command/_mysql_utils @@ -187,7 +187,7 @@ _mysqladmin() { _wanted databases expl "MySQL database" _mysql_databases && ret=0 ;; kill) - _message -e ids 'thread ids' + _message -e ids 'thread id' ;; password) _message -e passwords 'new password' diff --git a/Completion/Unix/Command/_mysqldiff b/Completion/Unix/Command/_mysqldiff index 4b46c86df..52b96ef21 100644 --- a/Completion/Unix/Command/_mysqldiff +++ b/Completion/Unix/Command/_mysqldiff @@ -20,8 +20,8 @@ _mysqldiff () { _mysql_db_or_file () { _alternative \ - 'databases:MySQL databases:_mysql_databases' \ - 'files:MySQL database definition files:_files -g "*.(my|)sql(-.)"' + 'databases:MySQL database:_mysql_databases' \ + 'files:MySQL database definition file:_files -g "*.(my|)sql(-.)"' } _mysql_utils diff --git a/Completion/Unix/Command/_nm b/Completion/Unix/Command/_nm index 423fd3223..2f608c5fc 100644 --- a/Completion/Unix/Command/_nm +++ b/Completion/Unix/Command/_nm @@ -66,7 +66,7 @@ if _pick_variant -r variant binutils=GNU elftoolchain=elftoolchain elfutils=elfu '--plugin[load specified plugin]:plugin' '--special-syms[include special symbols in the output]' '--synthetic[display synthetic symbols as well]' - "--target=[target object format]:targets:(${${(@M)${(f)$(_call_program targets nm --help)}:#*supported targets:*}##*: })" + "--target=[target object format]:target:(${${(@M)${(f)$(_call_program targets nm --help)}:#*supported targets:*}##*: })" '--with-symbol-versions[display version strings after symbol names]' ) ;; diff --git a/Completion/Unix/Command/_objdump b/Completion/Unix/Command/_objdump index 989cd3f0b..5152e6b6e 100644 --- a/Completion/Unix/Command/_objdump +++ b/Completion/Unix/Command/_objdump @@ -184,7 +184,7 @@ case "$state" in ${=${(M)${(f)"$(_call_program targets objdump --help)"}##* supported architectures:*}##*: } && ret=0 ;; disassembler_options) - _values -s , "disassembler options" "${(@)${(@)${(@M)${(f)${(ps.-M switch.)$(_call_program targets objdump --help)}[2]}:# [^ ]*}# }%% *}" && ret=0 + _values -s , "disassembler option" "${(@)${(@)${(@M)${(f)${(ps.-M switch.)$(_call_program targets objdump --help)}[2]}:# [^ ]*}# }%% *}" && ret=0 ;; llvm_targets) _values "target architecture" "${(z)${(@)${(f)$(_call_program targets diff --git a/Completion/Unix/Command/_perforce b/Completion/Unix/Command/_perforce index 0d007e3bc..4e69dee78 100644 --- a/Completion/Unix/Command/_perforce +++ b/Completion/Unix/Command/_perforce @@ -1354,7 +1354,7 @@ _perforce_fstat_fields() { ${${${${(M)${(f)"$(_perforce_call_p4 help-fstat help fstat)"}:#[[:blank:]]#[a-zA-Z]##(|\#)[[:blank:]]##--*}##[[:blank:]]#}:#fstat *}//[[:blank:]]##--[[:blank:]]##/:} ) compset -P '*[,[:blank:]]' - _describe -t fstat-fields 'Perforce fstat fields' values -S, -q + _describe -t fstat-fields 'Perforce fstat field' values -S, -q } diff --git a/Completion/Unix/Command/_perl b/Completion/Unix/Command/_perl index 4a917903c..d7e8f1b51 100644 --- a/Completion/Unix/Command/_perl +++ b/Completion/Unix/Command/_perl @@ -31,7 +31,7 @@ _perl () { "-u[dump core after parsing script]" \ "-U[allow unsafe operations]" \ "-v[print version, patchlevel and license]" \ - "-V-[print perl configuration information]:configuration keys:_perl_config_vars" \ + "-V-[print perl configuration information]:configuration key:_perl_config_vars" \ '( -W -X)-w[turn warnings on for compilation of your script (recommended)]' \ "(-w -X)-W[enable all warnings (ignores 'no warnings')]" \ "(-w -W )-X[disable all warnings (ignores 'use warnings')]" \ @@ -96,7 +96,7 @@ _perl_config_vars () { } _perl_unicode_flags () { - _values -s '' 'unicode bitmask or flags' \ + _values -s '' 'unicode bitmask or flag' \ '(S)I[ 1 STDIN is assumed to be in UTF-8]' \ '(S)O[ 2 STDOUT will be in UTF-8]' \ '(S)E[ 4 STDERR will be in UTF-8]' \ diff --git a/Completion/Unix/Command/_perldoc b/Completion/Unix/Command/_perldoc index 3e58d5a50..b724d74ee 100644 --- a/Completion/Unix/Command/_perldoc +++ b/Completion/Unix/Command/_perldoc @@ -3,7 +3,7 @@ local curcontext="$curcontext" state line expl args ret=1 typeset -A opt_args -args=( '*:Perl pod pages:->perl-pods' ) +args=( '*:Perl pod page:->perl-pods' ) if [[ $service = *PERLDOC* ]]; then compset -q @@ -46,7 +46,7 @@ case $state in perl-pods) if (( $+opt_args[-F] )); then - _wanted files expl 'Perl modules and .pods' \ + _wanted files expl 'Perl module or .pod' \ _files -g "*.(pod|pm)(-.)" && ret=0 else _alternative \ diff --git a/Completion/Unix/Command/_ps b/Completion/Unix/Command/_ps index 98dcd1cd0..9b54cbcc6 100644 --- a/Completion/Unix/Command/_ps +++ b/Completion/Unix/Command/_ps @@ -236,8 +236,8 @@ else [[ -z "$state" ]] && return ret fi -_values -s '' -S ' ' 'options' $bsd && ret=0 -_values -S ' ' 'options' $bsdarg && ret=0 +_values -s '' -S ' ' 'option' $bsd && ret=0 +_values -S ' ' 'option' $bsdarg && ret=0 if [[ -z $pids ]]; then _pids && ret=0 fi diff --git a/Completion/Unix/Command/_qemu b/Completion/Unix/Command/_qemu index 3c21c3e74..30fcd6757 100644 --- a/Completion/Unix/Command/_qemu +++ b/Completion/Unix/Command/_qemu @@ -6,7 +6,7 @@ _qemu_log_items () { [[ $hline[1] = Log ]] && continue opts=($opts "${hline[1]}[${hline[2,-1]}]") done - _values -s , 'log items' $opts + _values -s , 'log item' $opts } local _qemu_machines @@ -45,7 +45,7 @@ _arguments \ '-s[wait gdb connection to port 1234]' \ '-p[change gdb connection port]:port:_ports' \ '-S[do not start CPU at startup]' \ - '-d[output log in /tmp/qemu.log]:log items:_qemu_log_items' \ + '-d[output log in /tmp/qemu.log]:log item:_qemu_log_items' \ '-hdachs[force hard disk 0 geometry (usually qemu can guess it)]:hd0 geometry c,h,s:' \ '-vga[select video card type]:card type:(std cirrus vmware qxl xenfb none)' \ '-no-acpi[disable ACPI]' \ diff --git a/Completion/Unix/Command/_quilt b/Completion/Unix/Command/_quilt index 8167bce1e..8f39dadac 100644 --- a/Completion/Unix/Command/_quilt +++ b/Completion/Unix/Command/_quilt @@ -36,7 +36,7 @@ _quilt_unapplied() { _arguments $help \ '--trace[run the command in bash trace mode]' \ - '--quiltrc=[use the specified configuration file]:files:_files' \ + '--quiltrc=[use the specified configuration file]:file:_files' \ '--version[print the version number and exit]' \ ':quilt command:->cmd' \ '*:: :->subcmd' && return @@ -116,12 +116,12 @@ case $words[1] in add) _arguments -S $help \ '-P+[specify patch to add files to]:patch:_quilt_applied' \ - '*:files:_files' && return + '*:file:_files' && return ;; annotate) _arguments $help \ '-P[stop checking for changes at the specified rather than the topmost patch]:patch:_quilt_series' \ - ':files:_files' && return + ':file:_files' && return ;; applied) _arguments $help ':quilt series:_quilt_series' && return ;; delete) @@ -142,9 +142,9 @@ case $words[1] in '(-P -z)--snapshot[diff against snapshot]' \ '--diff=[use the specified utility for generating the diff]:diff utility:_command_names -e' \ '--sort[sort files by name]' \ - '*:files:_files' && return + '*:file:_files' && return ;; - edit) _arguments $help '*:files:_files' && return ;; + edit) _arguments $help '*:file:_files' && return ;; files) _arguments -s $help $verbose \ '-a[list all files in all applied patches]' \ @@ -187,14 +187,14 @@ case $words[1] in '-P+[patch filename to use inside quilt]:quilt select patch filename: ' \ '-f[overwrite/update existing patches]' \ '-d+[header resolution when overwriting in existing patch]:resolution:((a\:all\ headers n\:new\ headers o\:old\ headers))' \ - '*:files:_files' && return + '*:file:_files' && return ;; mail) _arguments $help \ '(-h -M)-m[introduction text to use]:introduction text' \ '(-h -m)-M[read introduction text from file]:file:_files' \ '--prefix=[use an alternate prefix in the bracketed part of the subjects generated]:quilt select prefix: ' \ - '--mbox=[store all messages in the specified file in mbox format]:files:_files' \ + '--mbox=[store all messages in the specified file in mbox format]:file:_files' \ '--send[send the messages directly]' \ '--sender=[specify envelope sender address to use]:sender:_email_addresses -c' \ '--from=[from header]:address:_email_addresses' \ @@ -202,13 +202,13 @@ case $words[1] in '*--to=[append a recipient to the To header]:recipient:_email_addresses' \ '*--cc=[append a recipient to the Cc header]:recipient:_email_addresses' \ '*--bcc=[append a recipient to the Bcc header]:recipient:_email_addresses' \ - '--signature=[append specified signature file to messages]:files:_files' \ + '--signature=[append specified signature file to messages]:file:_files' \ '--reply-to=[add reply address to message]:address:_email_addresses' \ '*:patch:_quilt_series' && return ;; new) _arguments $help $pstyle ':patch name' && return ;; next) _arguments $help ':patch:_quilt_series' && return ;; - patches) _arguments -S $help $verbose $color '*:files:_files' && return ;; + patches) _arguments -S $help $verbose $color '*:file:_files' && return ;; pop) _arguments -s $help $verbose \ '-a[remove all applied patches]' \ @@ -253,7 +253,7 @@ case $words[1] in revert) _arguments $help \ '-P[revert changes in the named patch]:patch:_quilt_series' \ - '*:files:_files' && return + '*:file:_files' && return ;; series) _arguments $help $verbose $color && return ;; setup) @@ -261,7 +261,7 @@ case $words[1] in '-d[specify path prefix for resulting source tree]:prefix:_files -W / -P /' \ '--sourcedir[specify location of package sources]:directory:_directories' \ '--fuzz=[set the maximum fuzz factor]:factor' \ - ':files:_files' && return + ':file:_files' && return ;; snapshot) _arguments $help '-d[only remove current snapshot]' && return ;; unapplied) _arguments $help ':patch:_quilt_series' && return ;; diff --git a/Completion/Unix/Command/_rclone b/Completion/Unix/Command/_rclone index 40f06e0ba..27b4dd926 100644 --- a/Completion/Unix/Command/_rclone +++ b/Completion/Unix/Command/_rclone @@ -79,7 +79,7 @@ _arguments -C \ '--dump-bodies[dump HTTP headers and bodies - may contain sensitive info]' \ '--dump-headers[dump HTTP headers - may contain sensitive info]' \ '--exclude[exclude files matching pattern]:stringArray' \ - '--exclude-from[read exclude patterns from file]:files:_files' \ + '--exclude-from[read exclude patterns from file]:file:_files' \ '--exclude-if-present[exclude directories if filename is present]:string' \ '--fast-list[use recursive list if available]' \ '--files-from[read list of source-file names from file]:file:_files' \ @@ -339,8 +339,8 @@ _arguments -C \ if [[ $state == 'files_or_remotes' ]]; then remotes=( $(_call_program rclone-remotes rclone listremotes) ) _alternative \ - "remote:rclone-remotes:compadd -a remotes" \ - "file:files:_files" && ret=0 + "rclone-remotes:remote:compadd -a remotes" \ + "files:file:_files" && ret=0 fi return ret diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync index e14c99cc6..b1a4f6046 100644 --- a/Completion/Unix/Command/_rsync +++ b/Completion/Unix/Command/_rsync @@ -71,14 +71,14 @@ _rsync_info() { local opts opts=( ${${(M)${(f)"$(_call_program values $words[1] --info=help)"}:#*Mention*}/ ##Me/[me} ) (( $#opts )) && opts=( '(ALL NONE HELP)'${^opts}\] ) - _values -s , 'info options' $opts ALL NONE HELP + _values -s , 'info option' $opts ALL NONE HELP } _rsync_debug() { local opts opts=( ${${(M)${(f)"$(_call_program values $words[1] --debug=help)"}:#*Debug*}/ ##De/[de} ) (( $#opts )) && opts=( '(ALL NONE HELP)'${^opts}\] ) - _values -s , 'debug options' $opts ALL NONE HELP + _values -s , 'debug option' $opts ALL NONE HELP } _rsync_files() { diff --git a/Completion/Unix/Command/_runit b/Completion/Unix/Command/_runit index 81ba26a44..5c22cc54e 100644 --- a/Completion/Unix/Command/_runit +++ b/Completion/Unix/Command/_runit @@ -19,7 +19,7 @@ _sv_commands() { 'kill':'send SIGKILL if service is running' 'exit':'send SIGTERM and SIGCONT if service is running. Do not restart service.' ) - _describe -t commands "sv commands" sv_ary -V sv_commands + _describe -t commands "sv command" sv_ary -V sv_commands } _sv_lsb() { @@ -41,7 +41,7 @@ _sv_lsb() { } _sv_additional() { - _describe -t additional-commands "sv additional commands" '("check:check status of service")' -V sv_addl_comm + _describe -t additional-commands "sv additional command" '("check:check status of service")' -V sv_addl_comm } local curcontext="$curcontext" state line @@ -68,6 +68,6 @@ case $state in ) sv_services=( ${sv_services#$svdir/} ) - _describe -t services "sv services" sv_services + _describe -t services "sv service" sv_services ;; esac diff --git a/Completion/Unix/Command/_scons b/Completion/Unix/Command/_scons index 2c620cc1a..77fe6dfb0 100644 --- a/Completion/Unix/Command/_scons +++ b/Completion/Unix/Command/_scons @@ -19,7 +19,7 @@ _arguments -s -S \ '(-)-'{h,-help}'[display defined usage information]' \ '(-)-'{H,-help-options}'[display usage information]' \ '(-i -ignore-errors)-'{i,-ignore-errors}'[ignore errors from build actions]' \ - \*{-I,--include-dir=}'[add directory to search Python modules]:directories:_directories' \ + \*{-I,--include-dir=}'[add directory to search Python modules]:directory:_directories' \ '(--implicit-deps-changed --implicit-deps-unchanged)--implicit-cache[cache scanned dependencies]' \ '(--implicit-cache --implicit-deps-changed)--implicit-deps-changed[rescan dependencies]' \ '(--implicit-cache --implicit-deps-unchanged)--implicit-deps-unchanged[ignore changes to scanned dependencies]' \ diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index c896f9316..20087174c 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -397,7 +397,7 @@ _ssh () { state=dynforward ;; (#i)kbdinteractivedevices=*) - _values -s , 'keyboard-interactive authentication methods' \ + _values -s , 'keyboard-interactive authentication method' \ 'bsdauth' 'pam' 'skey' && ret=0 ;; (#i)(kexalgorithms|gssapikexalgorithms)=*) diff --git a/Completion/Unix/Command/_tla b/Completion/Unix/Command/_tla index 1e4cdd8d9..33dfc005f 100644 --- a/Completion/Unix/Command/_tla +++ b/Completion/Unix/Command/_tla @@ -45,8 +45,8 @@ _tla_revisions () { _arch_namespace tla 4 "$argv[@]" } (( $+functions[_tla_local_revisions] )) || _tla_local_revisions () { local expl1 expl2 tree_version=`$TLA tree-version` - _description -V applied-patches expl1 "patches from this version" - _description -V other-patches expl2 "patches from other versions" + _description -V applied-patches expl1 "patch from this version" + _description -V other-patches expl2 "patch from other versions" compadd "$expl1[@]" `$TLA logs` compadd "$expl2[@]" `$TLA logs --full $($TLA log-versions | grep -v $tree_version)` # This is incredibly slow. @@ -90,7 +90,7 @@ _tla_limit () { #presently only does push-mirror style limits if [ $archive ]; then if [[ $PREFIX != *--* ]]; then - _description -V categories expl "categories in $archive" + _description -V categories expl "category in $archive" compadd -q -S -- "$expl[@]" `$TLA categories -A $archive` else _tla_namespace_branches 3 @@ -107,7 +107,7 @@ _tla_tree_or_rev () { _tla_libraries () { local libraries expl libraries=($(_call_program tla $TLA my-revision-library)) - _description -V libraries expl "revision libraries" + _description -V libraries expl "revision library" compadd "$expl[@]" -a libraries } @@ -128,7 +128,7 @@ _tla_log_versions () { else logs=($(_call_program tla $TLA logs)) fi - _description -V versions expl "log versions" + _description -V versions expl "log version" compadd "$expl[@]" -a logs } @@ -278,12 +278,12 @@ methods=( cmd_tagging_method=($cmd_id_tagging_method) local cmd_add cmd_add_id cmd_add_tag -cmd_add=('*:files to add:_files') +cmd_add=('*:file to add:_files') cmd_add_id=($cmd_add) cmd_add_tag=($cmd_add) local cmd_delete cmd_delete_id cmd_delete_tag -cmd_delete=('*:files to delete:_files') +cmd_delete=('*:file to delete:_files') cmd_delete_id=($cmd_delete) cmd_delete_tag=($cmd_delete) @@ -312,7 +312,7 @@ cmd_changeset=( ':ORIG:_files -/' ':MOD:_files -/' ':DEST:_files -/' - '*:files:_files' + '*:file:_files' ) cmd_mkpatch=("$cmd_changeset[@]") @@ -328,7 +328,7 @@ local cmd_make_archive cmd_make_archive=('::name:' ':location:_files -/') local cmd_archive_setup -cmd_archive_setup=('*:versions:_tla_branches --trailing-dashes') +cmd_archive_setup=('*:version:_tla_branches --trailing-dashes') local cmd_make_category cmd_make_category=(':category:_tla_archives -S /') @@ -344,7 +344,7 @@ cmd_import=('::version:_tla_versions') cmd_imprev=($cmd_import) local cmd_commit cmd_cmtrev -cmd_commit=('::version:_tla_versions' ':separator:(--)' '*:files:_files') +cmd_commit=('::version:_tla_versions' ':separator:(--)' '*:file:_files') cmd_cmtrev=($cmd_commit) local cmd_get cmd_getrev @@ -619,7 +619,7 @@ _tla_main () { local -U cmds help=(${(f)"$($TLA help)"}) cmds=(${${${${(M)help:#* :*}/ #: #/:}%% ##}## #}) - arguments=(':commands:(($cmds))') + arguments=(':command:(($cmds))') fi _arguments -S -A '-*' \ {"${hide_short}(: -)-V",'(: -)--version'}'[display version]' \ diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index f4e5619a0..284a325e5 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1114,7 +1114,7 @@ function __tmux-buffers() { fi buffers=( ${${(f)"$(command tmux 2> /dev/null list-buffers "${bopts[@]}")"}/:[ $'\t']##/:} ) - _describe -t buffers 'buffers' buffers + _describe -t buffers 'buffer' buffers } function __tmux-bound-keys() { @@ -1122,14 +1122,14 @@ function __tmux-bound-keys() { local -a keys keys=( ${${${${(f)"$(command tmux 2> /dev/null list-keys "$@")"}/:[ $'\t']##/:}/(#s)[ $'\t']##/}/(#s):/\\:} ) - _describe -t keys 'keys' keys + _describe -t keys 'key' keys } function __tmux-clients() { local expl local -a clients clients=( ${${(f)"$(command tmux 2> /dev/null list-clients)"}/:[ $'\t']##/:} ) - _describe -t clients 'clients' clients + _describe -t clients 'client' clients } function __tmux-environment-variables() { @@ -1165,7 +1165,7 @@ function __tmux-environment-variables() { descriptions+=( "${k//:/\\:}:$v" ) done # TODO: this if/else is because '_describe ${hint:+"-x"}' prints the "No matches" error in addition to the message. - local msg="${dash_g[1]:+"global "}environment variables${hint}" + local msg="${dash_g[1]:+"global "}environment variable${hint}" if _describe -t parameters $msg descriptions; then : elif [[ -n $hint ]]; then @@ -1621,9 +1621,9 @@ function __tmux-panes() { command tmux 2> /dev/null list-panes "${opts[@]}" | while IFS= read -r line; do panes+=( $(( num++ )):${line//:/} ) done - _describe -t panes 'panes' panes "$@" + _describe -t panes 'pane' panes "$@" if [[ ${IPREFIX} != *. ]]; then - _wanted windows expl 'windows' __tmux-windows -S. + _wanted windows expl 'window' __tmux-windows -S. fi } @@ -1648,14 +1648,14 @@ function __tmux-server-options() { function __tmux-sessions() { local -a sessions sessions=( ${${(f)"$(command tmux 2> /dev/null list-sessions)"}/:[ $'\t']##/:} ) - _describe -t sessions 'sessions' sessions "$@" + _describe -t sessions 'session' sessions "$@" } function __tmux-sessions-attached() { local -a sessions sessions=( ${${(f)"$(command tmux 2> /dev/null list-sessions)"}/:[ $'\t']##/:} ) sessions=( ${(M)sessions:#*"(attached)"} ) - _describe -t sessions 'attached sessions' sessions "$@" + _describe -t sessions 'attached session' sessions "$@" } # Complete attached-sessions and detached-sessions as separate tags. @@ -1671,8 +1671,8 @@ function __tmux-sessions-separately() { _tags detached-sessions attached-sessions # Placing detached before attached means the default behaviour of this # function better suits its only current caller, _tmux-attach-session(). - _requested detached-sessions && _describe -t detached-sessions 'detached sessions' detached_sessions "$@" && ret=0 - _requested attached-sessions && _describe -t attached-sessions 'attached sessions' attached_sessions "$@" && ret=0 + _requested detached-sessions && _describe -t detached-sessions 'detached session' detached_sessions "$@" && ret=0 + _requested attached-sessions && _describe -t attached-sessions 'attached session' attached_sessions "$@" && ret=0 return ret } @@ -1744,9 +1744,9 @@ function __tmux-windows() { opts=( ) fi wins=( ${${(M)${(f)"$(command tmux 2> /dev/null list-windows "${opts[@]}")"}:#<->*}/:[ $'\t']##/:} ) - _describe -t windows 'windows' wins "$@" + _describe -t windows 'window' wins "$@" if [[ ${IPREFIX} != *: ]]; then - _wanted sessions expl 'sessions' __tmux-sessions -S: + _wanted sessions expl 'session' __tmux-sessions -S: fi } @@ -1775,11 +1775,11 @@ _tmux() { if (( CURRENT == 1 )); then zstyle -s ":completion:${curcontext}:subcommands" mode mode || mode='both' if [[ ${mode} == 'commands' ]]; then - _describe -t subcommands 'tmux commands' _tmux_commands && ret=0 + _describe -t subcommands 'tmux command' _tmux_commands && ret=0 elif [[ ${mode} == 'aliases' ]]; then - _describe -t subcommands 'tmux aliases' _tmux_aliases && ret=0 + _describe -t subcommands 'tmux alias' _tmux_aliases && ret=0 else - _describe -t subcommands 'tmux commands and aliases' _tmux_commands -- _tmux_aliases && ret=0 + _describe -t subcommands 'tmux command or alias' _tmux_commands -- _tmux_aliases && ret=0 fi else tmuxcommand="${words[1]}" diff --git a/Completion/Unix/Command/_tput b/Completion/Unix/Command/_tput index a3b4e949c..abba3e8c0 100644 --- a/Completion/Unix/Command/_tput +++ b/Completion/Unix/Command/_tput @@ -14,5 +14,5 @@ esac _arguments : \ $args - set3 \ '(-S -V)-T+[terminal type]:terminal type:_terminals' \ - '1:terminal capabilities:( init reset longname ${(k)terminfo} )' \ + '1:terminal capability:( init reset longname ${(k)terminfo} )' \ '*:capability parameters:{ [[ $words[1] != (init|reset|longname) ]] && _message parameter }' diff --git a/Completion/Unix/Command/_unison b/Completion/Unix/Command/_unison index 5963d66c6..91fa57e5b 100644 --- a/Completion/Unix/Command/_unison +++ b/Completion/Unix/Command/_unison @@ -6,7 +6,7 @@ typeset -A opt_args _arguments \ '-auto[automatically accept default (nonconflicting) actions]' \ '-batch[batch mode\: ask no questions at all]' \ - '-doc[show documentation]:topics:(about people lists status copying ack install tutorial basics failures running ssh news all topics)' \ + '-doc[show documentation]:topic:(about people lists status copying ack install tutorial basics failures running ssh news all topics)' \ '-follow[add a pattern to the follow list]:pattern:' \ '-force[force changes from this replica to the other]:replica:' \ '-group[synchronize group attributes]' \ diff --git a/Completion/Unix/Command/_w3m b/Completion/Unix/Command/_w3m index 6e83a6781..8b45ad730 100644 --- a/Completion/Unix/Command/_w3m +++ b/Completion/Unix/Command/_w3m @@ -84,7 +84,7 @@ case "$state" in _alternative \ 'files:file:_files -g "*.x#html(-.)"' \ 'urls:URL:_urls' \ - 'bookmarks:bookmarks:compadd -a bookmarks' \ + 'bookmarks:bookmark:compadd -a bookmarks' \ 'history:history:compadd -a w3mhistory' && ret=0 ;; option) diff --git a/Completion/Unix/Command/_wget b/Completion/Unix/Command/_wget index 49c8e8b01..d061fcd06 100644 --- a/Completion/Unix/Command/_wget +++ b/Completion/Unix/Command/_wget @@ -137,7 +137,7 @@ _arguments -C -s \ '(--reject -R)'{--reject=,-R+}'[specify rejected extensions]:extensions' \ --{accept,reject}-regex=:regex '--regex-type=:regex type:(posix pcre)' \ '(--domains -D)'{--domains=,-D+}'[specify accepted domains]:domains:_domains' \ - '--exclude-domains=:rejected domains:_domains' \ + '--exclude-domains=:rejected domain:_sequence _domains' \ '--follow-ftp' \ '--follow-tags=:HTML tags:' \ '--ignore-tags=[specify ignored HTML tags]:HTML tags' \ diff --git a/Completion/Unix/Command/_xmlsoft b/Completion/Unix/Command/_xmlsoft index 487974fdb..6f7e3b7c9 100644 --- a/Completion/Unix/Command/_xmlsoft +++ b/Completion/Unix/Command/_xmlsoft @@ -45,7 +45,7 @@ case $service in '--encoding[the input document character encoding]:encoding:(${encoding[@]})' \ '*--param[pass a parameter,value pair]:name::value (xpath expression)' \ '*--stringparam[pass a parameter]:name::value' \ - '--path[provide a set of paths for resources]:paths:_files -/' \ + '--path[provide a set of paths for resources]:path:_dir_list' \ '--nonet[refuse to fetch DTDs or entities over network]' \ '--nowrite[refuse to write to any file or resource]' \ '--nomkdir[refuse to create directories]' \ @@ -70,7 +70,7 @@ case $service in '--noent[substitute entity references by their value]' \ '--noenc[ignore any encoding specified inside the document]' \ "(--output -o)--noout[don't output the result tree]" \ - '--path[provide a set of paths for resources]:paths:_files -/' \ + '--path[provide a set of paths for resources]:path:_dir_list' \ '--load-trace[print trace of all external entities loaded]' \ '--nonet[refuse to fetch DTDs or entities over network]' \ '--nocompact[do not generate compact text nodes]' \ diff --git a/Completion/Unix/Command/_xmms2 b/Completion/Unix/Command/_xmms2 index 525d5177c..ca2383b2f 100644 --- a/Completion/Unix/Command/_xmms2 +++ b/Completion/Unix/Command/_xmms2 @@ -43,7 +43,7 @@ _xmms2_command() { ) if (( CURRENT == 1 )); then - _describe -t command "xmms2 commands" xmms2_cmds + _describe -t command "xmms2 command" xmms2_cmds else local curcontext="$curcontext" fi @@ -63,7 +63,7 @@ _xmms2_command() { fi done - _values -s ' ' 'playlist items' ${(On)playlistitems} + _values -s ' ' 'playlist item' ${(On)playlistitems} } @@ -84,7 +84,7 @@ _xmms2_mlib() { ) if (( CURRENT == 2 )); then - _describe -t command "xmms2 mlib commands" mlib_cmds + _describe -t command "xmms2 mlib command" mlib_cmds else local curcontext="$curcontext" fi @@ -107,7 +107,7 @@ _xmms2_playlist() { remove:"Remove a playlist" ) if (( CURRENT == 2 )); then - _describe -t command "xmms2 playlist commands" playlist_cmds + _describe -t command "xmms2 playlist command" playlist_cmds else local curcontext="$curcontext" fi @@ -121,14 +121,14 @@ _xmms2_playlist() { _xmms2_playlist_load() { local list list=($(xmms2 playlist list)) - _describe -t command "xmms2 playlists" list + _describe -t command "xmms2 playlist" list } _xmms2_playlist_remove() { local list list=($(xmms2 playlist list)) - _describe -t command "xmms2 playlists" list + _describe -t command "xmms2 playlist" list } @@ -146,7 +146,7 @@ _xmms2_coll() { attr:"Get/set an attribute for a saved collection" ) if (( CURRENT == 2 )); then - _describe -t command "xmms2 collection commands" coll_cmds + _describe -t command "xmms2 collection command" coll_cmds else local curcontext="$curcontext" fi @@ -160,7 +160,7 @@ _xmms2_coll() { _xmms2_coll_helper() { local list list=($(xmms2 coll list)) - _describe -t command "xmms2 playlists" list + _describe -t command "xmms2 playlist" list } _xmms2_coll_rename() { diff --git a/Completion/Unix/Command/_yafc b/Completion/Unix/Command/_yafc index 1e0a601a1..946c0b4ce 100644 --- a/Completion/Unix/Command/_yafc +++ b/Completion/Unix/Command/_yafc @@ -32,7 +32,7 @@ _yafc_bookmarks() { if [[ -f $bkmfile ]]; then local -a bkms expl bkms=(${${${(M)"${(f)$(<$bkmfile)}":#machine*alias ##\'*\' #}##machine*alias ##\'}%%\' #}) #" vim syntax goes crazy - _wanted bookmarks expl 'bookmarks' compadd "$@" -a - bkms + _wanted bookmarks expl 'bookmark' compadd "$@" -a - bkms fi } diff --git a/Completion/Unix/Type/_email_addresses b/Completion/Unix/Type/_email_addresses index 8a5877a9c..d5f175a79 100644 --- a/Completion/Unix/Type/_email_addresses +++ b/Completion/Unix/Type/_email_addresses @@ -69,7 +69,7 @@ _email-ldap() { fi done compstate[insert]=menu - _wanted email-ldap expl 'matching names' \ + _wanted email-ldap expl 'matching name' \ compadd -U -i "$IPREFIX" -I "$ISUFFIX" "$@" -a - ali } diff --git a/Completion/Unix/Type/_urls b/Completion/Unix/Type/_urls index 5d4990442..f9cdd58cd 100644 --- a/Completion/Unix/Type/_urls +++ b/Completion/Unix/Type/_urls @@ -103,7 +103,7 @@ case "$scheme" in bookmark) if [[ -f "$urls/$scheme/${(Q)PREFIX}${(Q)SUFFIX}" && -s "$urls/$scheme/${(Q)PREFIX}${(Q)SUFFIX}" ]]; then - _wanted -C bookmark bookmarks expl bookmarks \ + _wanted -C bookmark bookmarks expl bookmark \ compadd "$@" -U - \ "$ipre$(<"$urls/$scheme/${(Q)PREFIX}${(Q)SUFFIX}")" && ret=0 else diff --git a/Completion/X/Command/_mozilla b/Completion/X/Command/_mozilla index 64f4d9450..0be25b8d3 100644 --- a/Completion/X/Command/_mozilla +++ b/Completion/X/Command/_mozilla @@ -95,7 +95,7 @@ if [[ "$state" = "remote" ]]; then ;; *) compset -S '(|\\)\(*' || suf="${${QIPREFIX:+(}:-\(}" - _wanted commands expl 'remote commands' \ + _wanted commands expl 'remote command' \ compadd -qS "$suf" -M 'm:{a-zA-Z}={A-Za-z}' -a \ remote_commands && ret=0 ;; diff --git a/Completion/X/Command/_mplayer b/Completion/X/Command/_mplayer index a913960fe..1f99a1789 100644 --- a/Completion/X/Command/_mplayer +++ b/Completion/X/Command/_mplayer @@ -131,13 +131,13 @@ case "$state" in ;; audio-drivers) vals=( help ${${${(f)"$(_call_program audio-drivers mplayer -ao help 2>/dev/null)"}[(r) *,-1]#?}/ /:} ) - _describe -t audio-drivers 'audio drivers' vals && ret=0 + _describe -t audio-drivers 'audio driver' vals && ret=0 ;; audio-codec-families) compset -P '*,' compset -S ',*' vals=( help ${${${(f)"$(_call_program audio-codec-families mplayer -afm help 2>/dev/null)"}[(r) [^:]#,-1]## ##}/ ##/:} ) - _describe -t audio-codec-families 'audio drivers' vals && ret=0 + _describe -t audio-codec-families 'audio driver' vals && ret=0 ;; audio-plugins) _values -s : 'audio output plugin' \ @@ -154,7 +154,7 @@ case "$state" in ;; video-drivers) vals=( help ${${${(f)"$(_call_program video-drivers mplayer -vo help 2>/dev/null)"}[(r) *,-1]#?}/ /:} ) - _describe -t video-drivers 'video drivers' vals && ret=0 + _describe -t video-drivers 'video driver' vals && ret=0 ;; video-output-plugins) vals=( help ${${${${(f)"$(_call_program video-output-plugins mplayer -vop help 2>/dev/null)"}[(r) *,-1]}/ /}/ #: /:} ) diff --git a/Completion/X/Command/_netscape b/Completion/X/Command/_netscape index e1d02ae90..78b2da649 100644 --- a/Completion/X/Command/_netscape +++ b/Completion/X/Command/_netscape @@ -52,7 +52,7 @@ if [[ "$state" = "remote" ]]; then ;; *) compset -S '(|\\)\(*' || suf="${${QIPREFIX:+(}:-\(}" - _wanted commands expl 'remote commands' \ + _wanted commands expl 'remote command' \ compadd -qS "$suf" -M 'm:{a-zA-Z}={A-Za-z}' -a \ remote_commands && ret=0 ;; diff --git a/Completion/X/Command/_pdftk b/Completion/X/Command/_pdftk index b8c43f754..1ac3223f7 100644 --- a/Completion/X/Command/_pdftk +++ b/Completion/X/Command/_pdftk @@ -24,7 +24,7 @@ case $words[CURRENT-1] in (allow) #_description permissions expl "permission" #compadd $expl \ - _values -s , permissions \ + _values -s , permission \ Printing DegradedPrinting ModifyContents Assembly CopyContents \ ScreenReaders ModifyAnnotations FillIn AllFeatures ;; @@ -34,12 +34,12 @@ case $words[CURRENT-1] in ;; (fill_form) - _description files expl 'FDF and XFDF files' + _description files expl 'FDF and XFDF file' _files "$@" $expl -g '(#i)*.(fdf|xfdf)' ;; ((multibackground|background|stamp|multistamp|output)) - _description files expl 'PDF files' + _description files expl 'PDF file' _files "$@" $expl -g '(#i)*.pdf' ;; @@ -53,11 +53,11 @@ case $words[CURRENT-1] in esac && return 0 if [[ -n $words[(r)(${(j:|:)operations})] ]]; then - _description options expl "options" + _description options expl "option" compadd $@ $expl $opts else _tags files operations _alternative \ - 'files:PDF files:_pdfwithhandle' \ - "operations:operations:($operations)" + 'files:PDF file:_pdfwithhandle' \ + "operations:operation:($operations)" fi diff --git a/Completion/X/Command/_vnc b/Completion/X/Command/_vnc index d60616f21..9263ab930 100644 --- a/Completion/X/Command/_vnc +++ b/Completion/X/Command/_vnc @@ -86,7 +86,7 @@ case $service in ;; *vncviewer) _xt_arguments -shared -viewonly -fullscreen -bgr233 -owncmap -truecolour \ - '-encodings:encodings:_values -s " " encoding copyrect hextile corre rre raw' \ + '-encodings: :_values -s " " encoding copyrect hextile corre rre raw' \ '-depth:depth' \ '-passwd:file:_files' \ '(1)-listen:display number' \ diff --git a/Completion/X/Command/_xauth b/Completion/X/Command/_xauth index 14dfc8400..22ebffecd 100644 --- a/Completion/X/Command/_xauth +++ b/Completion/X/Command/_xauth @@ -41,7 +41,7 @@ while [[ -n "$state" ]]; do group) _message -e ids 'group-id';; data) _message -e values 'hexdata';; *) - _wanted options expl 'xauth generate options' \ + _wanted options expl 'xauth generate option' \ compadd trusted untrusted timeout group data && ret=0 ;; esac diff --git a/Completion/X/Command/_xournal b/Completion/X/Command/_xournal index 066ef55f5..c36210c26 100644 --- a/Completion/X/Command/_xournal +++ b/Completion/X/Command/_xournal @@ -2,5 +2,5 @@ local expl -_description files expl 'PDF and Xournal files' +_description files expl 'PDF or Xournal file' _files "$@" "$expl[@]" -g '*.(#i){xoj,pdf}(-.)' diff --git a/Completion/Zsh/Command/_bindkey b/Completion/Zsh/Command/_bindkey index 81ae69974..df9c8f225 100644 --- a/Completion/Zsh/Command/_bindkey +++ b/Completion/Zsh/Command/_bindkey @@ -27,7 +27,7 @@ _arguments -C -s -S \ '(-l -L -d -D -A -N -m -p -r *)-s[bind each in-string to each out-string]:*:key string' \ '(-e -v -a -M -l -L -d -D -A -N -m -p)-R[interpret in-strings as ranges]' \ '(-l -L -d -A -N -m -p -r -s):in-string' \ - '(-l -L -d -A -N -m -p -r -s)*::widgets:_widgets' && ret=0 + '(-l -L -d -A -N -m -p -r -s)*::widget:_widgets' && ret=0 case $state in keymap) diff --git a/Completion/Zsh/Command/_disable b/Completion/Zsh/Command/_disable index 52b82a6e9..da3803039 100644 --- a/Completion/Zsh/Command/_disable +++ b/Completion/Zsh/Command/_disable @@ -7,10 +7,10 @@ sali_arr=(${(k)saliases}) func_arr=(${(k)functions}) _arguments -C -s -A "-*" -S \ - "(-f -r -s -p)-a[act on regular or global aliases]:*:regular or global aliases:compadd -k ali_arr" \ - "(-a -r -s -p)-f[act on functions]:*:functions:compadd -k func_arr" \ - "(-a -f -s -p)-r[act on reserved words]:*:reserved-words:compadd -k reswords" \ - "(-a -f -r -p)-s[act on suffix aliases]:*:suffix aliases:compadd -k sali_arr" \ - "(-a -f -r -s)-p[act on pattern characters]:*:pattern characters:compadd -k patchars" \ + "(-f -r -s -p)-a[act on regular or global aliases]:*:regular or global alias:compadd -k ali_arr" \ + "(-a -r -s -p)-f[act on functions]:*:function:compadd -k func_arr" \ + "(-a -f -s -p)-r[act on reserved words]:*:reserved-word:compadd -k reswords" \ + "(-a -f -r -p)-s[act on suffix aliases]:*:suffix alias:compadd -k sali_arr" \ + "(-a -f -r -s)-p[act on pattern characters]:*:pattern character:compadd -k patchars" \ '-m[treat arguments as patterns]' \ "*:builtin command:(${(k)builtins})" diff --git a/Completion/Zsh/Command/_enable b/Completion/Zsh/Command/_enable index 9410651b7..b62619d89 100644 --- a/Completion/Zsh/Command/_enable +++ b/Completion/Zsh/Command/_enable @@ -7,10 +7,10 @@ sali_arr=(${(k)dis_saliases}) func_arr=(${(k)dis_functions}) _arguments -C -s -A "-*" -S \ - "(-f -r -s -p)-a[act on regular or global aliases]:*:aliases:compadd -k ali_arr" \ - "(-a -r -s -p)-f[act on functions]:*:functions:compadd -k func_arr" \ - "(-a -f -s -p)-r[act on reserved words]:*:reserved-words:compadd -k dis_reswords" \ - "(-a -f -r -p)-s[act on suffix aliases]:*:suffix aliases:compadd -k sali_arr" \ - "(-a -f -r -s)-p[act on pattern characters]:*:pattern characters:compadd -k dis_patchars" \ + "(-f -r -s -p)-a[act on regular or global aliases]:*:alias:compadd -k ali_arr" \ + "(-a -r -s -p)-f[act on functions]:*:function:compadd -k func_arr" \ + "(-a -f -s -p)-r[act on reserved words]:*:reserved-word:compadd -k dis_reswords" \ + "(-a -f -r -p)-s[act on suffix aliases]:*:suffix alias:compadd -k sali_arr" \ + "(-a -f -r -s)-p[act on pattern characters]:*:pattern character:compadd -k dis_patchars" \ '-m[treat arguments as patterns]' \ "*:builtin command:(${(k)dis_builtins})" diff --git a/Completion/Zsh/Command/_sched b/Completion/Zsh/Command/_sched index e8ff5ab87..888708684 100644 --- a/Completion/Zsh/Command/_sched +++ b/Completion/Zsh/Command/_sched @@ -10,7 +10,7 @@ if [[ CURRENT -eq 2 ]]; then else disp=() fi - [[ -z $lines ]] || _wanted jobs expl 'scheduled jobs' \ + [[ -z $lines ]] || _wanted jobs expl 'scheduled job' \ compadd "$disp[@]" - {1..$#lines} return else diff --git a/Completion/Zsh/Command/_typeset b/Completion/Zsh/Command/_typeset index ae33ae539..aecacb112 100644 --- a/Completion/Zsh/Command/_typeset +++ b/Completion/Zsh/Command/_typeset @@ -127,7 +127,7 @@ if [[ "$state" = vars_eq ]]; then [[ $PREFIX != [_.]* ]]; then args=(${args:#_*}) fi - _wanted functions expl 'shell functions' compadd -a args + _wanted functions expl 'shell function' compadd -a args else _functions fi diff --git a/Completion/Zsh/Command/_zmodload b/Completion/Zsh/Command/_zmodload index 3416d50c6..f3e38c0f6 100644 --- a/Completion/Zsh/Command/_zmodload +++ b/Completion/Zsh/Command/_zmodload @@ -23,7 +23,7 @@ _arguments -n -C -S -s \ '(-e -u)-L[output in the form of calls to zmodload]' \ '(-b -c -d -I -f -F -P -l -m -A -R)-p[autoload module for parameters]' \ '(-u -b -c -d -p -f -A -R)-P[array param for features]:array name:_parameters' \ - '(-)*:params:->params' && ret=0 + '(-)*:param:->params' && ret=0 [[ $state = params ]] || return ret @@ -66,7 +66,7 @@ else while _tags; do _requested builtins expl 'builtin command' \ compadd "$@" -k builtins && ret=0 - _requested loadedmodules expl 'loaded modules' \ + _requested loadedmodules expl 'loaded module' \ compadd -k 'modules[(R)loaded]' && ret=0 _requested files expl 'module file' \ _files -W module_path -g '*.(dll|s[ol]|bundle)(:r)' && ret=0 diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle index 9d06076e4..0c81c2f2e 100644 --- a/Completion/Zsh/Command/_zstyle +++ b/Completion/Zsh/Command/_zstyle @@ -491,7 +491,7 @@ while (( $#state )); do elif compset -P '*:'; then _message -e tags tag else - _message -e patterns 'glob patterns' + _message -e patterns 'glob pattern' fi ;; diff --git a/Completion/Zsh/Context/_subscript b/Completion/Zsh/Context/_subscript index 0d9632864..25cedd193 100644 --- a/Completion/Zsh/Context/_subscript +++ b/Completion/Zsh/Context/_subscript @@ -80,7 +80,7 @@ elif compset -P '\('; then );; esac - _values -s '' 'subscript flags' $flags + _values -s '' 'subscript flag' $flags elif [[ ${(Pt)${compstate[parameter]}} = assoc* ]]; then local suf MATCH MBEGIN MEND local -a keys diff --git a/Completion/Zsh/Context/_zcalc_line b/Completion/Zsh/Context/_zcalc_line index 50fb8c17c..ab8e42df9 100644 --- a/Completion/Zsh/Context/_zcalc_line +++ b/Completion/Zsh/Context/_zcalc_line @@ -16,7 +16,7 @@ _zcalc_line_escapes() { "function:define math function (also \:func or \:f)" ) cmds=("\:"${^cmds}) - _describe -t command-escapes "command escapes" cmds -Q + _describe -t command-escapes "command escape" cmds -Q } _zcalc_line() { diff --git a/Completion/Zsh/Function/_add-zsh-hook b/Completion/Zsh/Function/_add-zsh-hook index 4d8a96dab..5b1ff0e42 100644 --- a/Completion/Zsh/Function/_add-zsh-hook +++ b/Completion/Zsh/Function/_add-zsh-hook @@ -3,7 +3,7 @@ _add-zsh-hook_hooks() { local expl if (( $+opt_args[-d] )); then - _wanted functions expl "installed hooks" compadd -a - "$line[1]_functions" && return 0 + _wanted functions expl "installed hook" compadd -a - "$line[1]_functions" && return 0 else _functions && return 0 fi diff --git a/Completion/openSUSE/Command/_hwinfo b/Completion/openSUSE/Command/_hwinfo index aac0a05ad..7dff82805 100644 --- a/Completion/openSUSE/Command/_hwinfo +++ b/Completion/openSUSE/Command/_hwinfo @@ -5,7 +5,7 @@ _arguments \ '--version[show libhd version]' \ '--short[just a short listing]' \ '--log[write info to logfile]:logfile:_files' \ - '--debug[set debuglevel]:debuglevels:(1 2 3 4 5 6 7 8 9)' \ + '--debug[set debuglevel]:debug level:(1 2 3 4 5 6 7 8 9)' \ '--dump-db[dump hardware data base, 0: external, 1: internal]:dumpdb:(0 1)' \ '--bios' \ '--block' \ diff --git a/Completion/openSUSE/Command/_zypper b/Completion/openSUSE/Command/_zypper index 25a32c3f1..3f3402bd9 100644 --- a/Completion/openSUSE/Command/_zypper +++ b/Completion/openSUSE/Command/_zypper @@ -65,17 +65,17 @@ _zypper() { _all_repos() { local -a repos repos=( $(zypper -q lr | tail -n +3 | cut -d'|' -f 2) ) - _describe -t repos 'Available repositories' repos && return + _describe -t repos 'available repository' repos && return } _enabled_repos() { repos=( $(zypper -x lr | grep 'enabled="1"' | cut -d\" -f 2) ) - _describe -t repos 'Available repositories' repos && return + _describe -t repos 'available repository' repos && return } _disabled_repos() { repos=( $(zypper -x lr | grep 'enabled="0"' | cut -d\" -f 2) ) - _describe -t repos 'Available repositories' repos && return + _describe -t repos 'available repository' repos && return } _zypper_cmd_do() { @@ -107,7 +107,7 @@ _zypper_cmd_do() { case ${words[CURRENT - 1]} in --from) repos=( $(zypper -x lr | grep 'enabled="1"' | cut -d\" -f 2) ) - _describe -t repos 'Available repositories' repos && return + _describe -t repos 'available repository' repos && return ;; (--enable|-e) case $cmd in @@ -128,7 +128,7 @@ _zypper_cmd_do() { case $cmd in (if|info|se|search|in|install) types=( pattern srcpackage package patch ) - _describe -t types 'Package types' types && return + _describe -t types 'package type' types && return ;; esac ;; @@ -143,7 +143,7 @@ _zypper_cmd_do() { ;; (in|install) local expl - _description files expl 'RPM files' + _description files expl 'RPM file' _files "$expl[@]" -g '*.(#i)rpm(.)' ;; esac -- cgit v1.2.3 From efec6bbdb55199430dec0a003e5dc8d293de4cff Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Fri, 9 Jul 2021 00:32:37 +0200 Subject: 49151: remove commas erroneously included in _arguments exclusion lists --- ChangeLog | 6 ++++++ Completion/Debian/Command/_dak | 12 ++++++------ Completion/Debian/Command/_dpkg | 2 +- Completion/Debian/Command/_madison | 2 +- Completion/Unix/Command/_aap | 2 +- Completion/Unix/Command/_samba | 2 +- Completion/Unix/Command/_setfacl | 10 +++++----- Completion/Zsh/Function/_zargs | 20 ++++++++++---------- 8 files changed, 31 insertions(+), 25 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 489fbbd3d..27cc5ce98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2021-07-08 Oliver Kiddle <opk@zsh.org> + * 49151: Completion/Debian/Command/_madison, + Completion/Debian/Command/_dak, Completion/Debian/Command/_dpkg, + Completion/Unix/Command/_aap, Completion/Unix/Command/_samba, + Completion/Unix/Command/_setfacl, Completion/Zsh/Function/_zargs: + remove commas erroneously included in _arguments exclusion lists + * 49150: Completion/...: consistently use singular form for headings on completion match groups diff --git a/Completion/Debian/Command/_dak b/Completion/Debian/Command/_dak index 086196c4a..8ecfd84b3 100644 --- a/Completion/Debian/Command/_dak +++ b/Completion/Debian/Command/_dak @@ -27,7 +27,7 @@ case $cmd in '(-G --greaterthan)'{-G,--greaterthan} '(-r --regex)'{-r,--regex} '(-s --suite)'{-s,--suite=}':suite:_values -s , "suite list" oldstable stable testing unstable experimental' - '(-S, --source-and-binary)'{-S,--source-and-binary} + '(-S --source-and-binary)'{-S,--source-and-binary} '*:package:_deb_packages avail' ) ;; @@ -75,7 +75,7 @@ case $cmd in '(-p --partial)'{-p,--partial}'[do not affect override files]' '(-R --rdep-check)'{-R,--rdep-check}'[check reverse dependencies]' '(-s --suite)'{-s,--suite=}':suite:_values -s , "suite list" oldstable stable testing unstable experimental' - '(-S, --source-only)'{-S,--source-only}'[remove source only]' + '(-S --source-only)'{-S,--source-only}'[remove source only]' '*:package:_deb_packages avail' ) ;; @@ -155,10 +155,10 @@ case $cmd in '(-c --component)'{-c,--component=}':component:(main contrib non-free)' '(-s --suite)'{-s,--suite=}':suite:(oldstable stable testing unstable experimental)' '(-t --type)'{-t,--type=}':type:(deb dsc udeb)' - '(-a, --add)'{-a,--add}'[add overrides]' - '(-S, --set)'{-S,--set}'[set overrides]' - '(-l, --list)'{-l,--list}'[list overrides]' - '(-q, --quiet)'{-q,--quiet}'[be less verbose]' + '(-a --add)'{-a,--add}'[add overrides]' + '(-S --set)'{-S,--set}'[set overrides]' + '(-l --list)'{-l,--list}'[list overrides]' + '(-q --quiet)'{-q,--quiet}'[be less verbose]' ) ;; diff --git a/Completion/Debian/Command/_dpkg b/Completion/Debian/Command/_dpkg index 3477e6116..48ea2db97 100644 --- a/Completion/Debian/Command/_dpkg +++ b/Completion/Debian/Command/_dpkg @@ -86,7 +86,7 @@ _dpkg_deb_and_query_only_options=( _dpkg_query_actions=( '(--status -s)'{--status,-s}'[display package status]:*:packages:->status' '(--print-avail -p)'{--print-avail,-p}'[display available details]:packages:_deb_packages avail' - '(--listfiles, -L)'{--listfiles,-L}'[list owned files]:*:packages:->listfiles' + '(--listfiles -L)'{--listfiles,-L}'[list owned files]:*:packages:->listfiles' '(--list -l)'{--list,-l}'[list packages]:*:packages:->list' '(--search -S)'{--search,-S}'[search for file owner]:*:pattern:->search' '--admindir=[data directory]:directory:_files -/' diff --git a/Completion/Debian/Command/_madison b/Completion/Debian/Command/_madison index 445b79a45..dfdf1b438 100644 --- a/Completion/Debian/Command/_madison +++ b/Completion/Debian/Command/_madison @@ -9,6 +9,6 @@ _arguments \ '(-h --help)'{-h,--help} \ '(-r --regex)'{-r,--regex} \ '(-s --suite)'{-s,--suite=}':suite:_values -s , "suite list" oldstable stable testing unstable' \ - '(-S, --source-and-binary)'{-S,--source-and-binary} \ + '(-S --source-and-binary)'{-S,--source-and-binary} \ '*:package:_deb_packages avail' diff --git a/Completion/Unix/Command/_aap b/Completion/Unix/Command/_aap index 089a993c3..38e50f1fc 100644 --- a/Completion/Unix/Command/_aap +++ b/Completion/Unix/Command/_aap @@ -20,7 +20,7 @@ _arguments -C -s -S \ \*{-c,--command=}'[execute a command after reading the recipe]:aap command:' \ '(-k --continue)'{-k,--continue}'[continue building after an error]' \ '(-S --stop)'{-S,--stop}'[stop building at first error (default)]' \ - '(-N,--nofetch-recipe -R --fetch-recipe)'{-R,--fetch-recipe}'[fetch recipe file and child recipes]' \ + '(-N --nofetch-recipe -R --fetch-recipe)'{-R,--fetch-recipe}'[fetch recipe file and child recipes]' \ '(-R --fetch-recipe -N --nofetch-recipe)'{-N,--nofetch-recipe}'[do not fetch recipes for "fetch" target]' \ '(-a --nocache)'{-a,--nocache}"[always download files, don't use the cache]" \ '(-l --local)'{-l,--local}'[do not recurse into subdirectories]' \ diff --git a/Completion/Unix/Command/_samba b/Completion/Unix/Command/_samba index 775543794..6c7a64e18 100644 --- a/Completion/Unix/Command/_samba +++ b/Completion/Unix/Command/_samba @@ -96,7 +96,7 @@ case $service in smbstatus) _arguments -s -S $args \ {-b,--brief}'[brief output]' \ - '(-v --verbose)'(-v,--verbose)'[be verbose]' \ + '(-v --verbose)'{-v,--verbose}'[be verbose]' \ '(-d --debuglevel)'{-d+,--debuglevel=}'[specify debug level]:debug level:(0 1 2 3 4 5 6 7 8 9 10)' \ '(-u --user)'{-u+,--user=}'[specify user to restrict information to]:user:_users' \ '(-B --byterange)'{-B,--byterange}'[include byte range locks]' \ diff --git a/Completion/Unix/Command/_setfacl b/Completion/Unix/Command/_setfacl index 5c573a581..14be49d95 100644 --- a/Completion/Unix/Command/_setfacl +++ b/Completion/Unix/Command/_setfacl @@ -3,11 +3,11 @@ if _pick_variant cygwin=cygwin unix --version; then # cygwin 1.5.25 _arguments -s -S \ - '(-d, --delete)'{-d,--delete}'[delete one or more specified ACL entries]:ACL entry:' \ - '(-f, --file)'{-f,--file}'[set ACL entries for FILE to ACL entries read from a ACL_FILE]:ACL file:_files' \ - '(-m, --modify)'{-m,--modify}'[modify one or more specified ACL entries]:ACL entry:' \ - '(-r, --replace)'{-r,--replace}'[replace mask entry with maximum permissions needed for the file group class]' \ - '(-s, --substitute)'{-s,--substitute}'[substitute specified ACL entries for the \[ACL of FILE\]]:ACL entry:' \ + '(-d --delete)'{-d,--delete}'[delete one or more specified ACL entries]:ACL entry' \ + '(-f --file)'{-f,--file}'[set ACL entries for FILE to ACL entries read from a ACL_FILE]:ACL file:_files' \ + '(-m --modify)'{-m,--modify}'[modify one or more specified ACL entries]:ACL entry' \ + '(-r --replace)'{-r,--replace}'[replace mask entry with maximum permissions needed for the file group class]' \ + '(-s --substitute)'{-s,--substitute}'[substitute specified ACL entries for the \[ACL of FILE\]]:ACL entry' \ '(- *)'{-h,--help}'[output usage information and exit]' \ '(- *)'{-v,--version}'[output version information and exit]' \ '*: :_files' diff --git a/Completion/Zsh/Function/_zargs b/Completion/Zsh/Function/_zargs index f974ab646..94a35e3a5 100644 --- a/Completion/Zsh/Function/_zargs +++ b/Completion/Zsh/Function/_zargs @@ -18,17 +18,17 @@ case $numeofs in #zargs arguments arguments=( '(--eof -e)'{--eof=,-e+}'[change the end-of-input-args string from "--" to eof-str]' - '(--exit, -x)'{--exit,-x}'[exit if the size (see --max-chars) is exceeded]' + '(--exit -x)'{--exit,-x}'[exit if the size (see --max-chars) is exceeded]' '--help[print summary and exit]' - '(--interactive, -p)'{--interactive,-p}'[prompt before executing each command line]' - '(--max-args, -n)'{--max-args=,-n+}'[use at most max-args arguments per command line]' - '(--max-chars, -s)'{--max-chars=,-s+}'[use at most max-chars characters per command line]' - '(--max-lines, -l)'{--max-lines=,-l+}'[use at most max-lines of the input-args per command line]' - '(--max-procs, -P)'{--max-procs=,-P+}'[run up to max-procs command lines in the background at once]' - '(--no-run-if-empty, -r)'{--no-run-if-empty,-r}'[do nothing if there are no input arguments before the eof-str]' - '(--null, -0)'{--null,-0}'[split each input-arg at null bytes, for xargs compatibility]' - '(--replace, -i)'{--replace=,-i}'[substitute replace-str in the initial-args by each initial-arg]' - '(--verbose, -t)'{--verbose,-t}'[print each command line to stderr before executing it]' + '(--interactive -p)'{--interactive,-p}'[prompt before executing each command line]' + '(--max-args -n)'{--max-args=,-n+}'[use at most max-args arguments per command line]' + '(--max-chars -s)'{--max-chars=,-s+}'[use at most max-chars characters per command line]' + '(--max-lines -l)'{--max-lines=,-l+}'[use at most max-lines of the input-args per command line]' + '(--max-procs -P)'{--max-procs=,-P+}'[run up to max-procs command lines in the background at once]' + '(--no-run-if-empty -r)'{--no-run-if-empty,-r}'[do nothing if there are no input arguments before the eof-str]' + '(--null -0)'{--null,-0}'[split each input-arg at null bytes, for xargs compatibility]' + '(--replace -i)'{--replace=,-i}'[substitute replace-str in the initial-args by each initial-arg]' + '(--verbose -t)'{--verbose,-t}'[print each command line to stderr before executing it]' '--version[print the version number of zargs and exit]' ) _arguments -S -s $arguments[@] && ret=0 -- cgit v1.2.3 From 35f9585cd1342a1d962a47be858c7aea60c8f886 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Sat, 10 Jul 2021 23:35:33 +0200 Subject: 49156: make wider use of the convention of square brackets for defaults --- ChangeLog | 17 +++++++++++++++++ Completion/Cygwin/Command/_cygserver | 8 ++++---- Completion/Debian/Command/_git-buildpackage | 6 +++--- Completion/Linux/Command/_alsa-utils | 2 +- Completion/Linux/Command/_ipset | 19 ++++++------------- Completion/Solaris/Command/_dtrace | 2 +- Completion/Solaris/Command/_prstat | 6 +++--- Completion/Unix/Command/_adb | 4 ++-- Completion/Unix/Command/_ant | 2 +- Completion/Unix/Command/_django | 4 ++-- Completion/Unix/Command/_dtruss | 2 +- Completion/Unix/Command/_gcc | 9 ++++----- Completion/Unix/Command/_gnupod | 4 ++-- Completion/Unix/Command/_initctl | 2 +- Completion/Unix/Command/_mysqldiff | 2 +- Completion/Unix/Command/_pandoc | 22 +++++++++++----------- Completion/Unix/Command/_pbm | 2 +- Completion/Unix/Command/_perforce | 2 +- Completion/Unix/Command/_qemu | 4 ++-- Completion/Unix/Command/_ruby | 2 +- Completion/Unix/Command/_tidy | 2 +- Completion/Unix/Command/_w3m | 2 +- Completion/X/Command/_vnc | 4 ++-- Completion/X/Command/_xdvi | 2 +- 24 files changed, 70 insertions(+), 61 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 27cc5ce98..1421c357d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2021-07-10 Oliver Kiddle <opk@zsh.org> + + * 49156: Completion/Cygwin/Command/_cygserver, + Completion/Debian/Command/_git-buildpackage, + Completion/Linux/Command/_alsa-utils, Completion/Unix/Command/_adb, + Completion/Linux/Command/_ipset, Completion/Unix/Command/_django, + Completion/Solaris/Command/_dtrace, Completion/Unix/Command/_ant, + Completion/Solaris/Command/_prstat, Completion/Unix/Command/_gcc, + Completion/Unix/Command/_dtruss, Completion/Unix/Command/_gnupod, + Completion/Unix/Command/_initctl, Completion/Unix/Command/_pandoc, + Completion/Unix/Command/_mysqldiff, Completion/Unix/Command/_pbm, + Completion/Unix/Command/_perforce, Completion/Unix/Command/_qemu, + Completion/Unix/Command/_ruby, Completion/Unix/Command/_tidy, + Completion/Unix/Command/_w3m, Completion/X/Command/_vnc, + Completion/X/Command/_xdvi: make wider use of the convention of + square brackets for defaults + 2021-07-08 Oliver Kiddle <opk@zsh.org> * 49151: Completion/Debian/Command/_madison, diff --git a/Completion/Cygwin/Command/_cygserver b/Completion/Cygwin/Command/_cygserver index 1c2744c8f..392bf5cbd 100644 --- a/Completion/Cygwin/Command/_cygserver +++ b/Completion/Cygwin/Command/_cygserver @@ -3,14 +3,14 @@ # cygwin 1.5.25 _arguments -s -S \ - '(--config-file -f)'{-f,--config-file}'[use specified file as config file (default /etc/cygserver.conf)]:config file:_files -g "*.conf(-.)"' \ - '(--cleanup-threads -c)'{-c,--cleanup-threads}'[number of cleanup threads to use (default 2)]:number of threads:' \ + '(--config-file -f)'{-f,--config-file}'[use specified config file]:config file [/etc/cygserver.conf]:_files -g "*.conf(-.)"' \ + '(--cleanup-threads -c)'{-c,--cleanup-threads}'[number of cleanup threads to use]:number of threads [2]' \ '(--process-cache -p)'{-p,--process-cache}'[size of process cache]:cache size:' \ - '(--request-threads -r)'{-r,--request-threads}'[number of request threads to use (default 10)]:number of threads:' \ + '(--request-threads -r)'{-r,--request-threads}'[number of request threads to use]:number of threads [10]' \ '(--debug -d)'{-d,--debug}'[log debug messages to stderr]' \ '(--stderr -e --no-stderr -E)'{-e,--stderr}'[log to stderr (default if stderr is a tty)]' \ '(--stderr -e --no-stderr -E)'{-E,--no-stderr}"[don't log to stderr (see -y, -Y options)]" \ - '(--log-level -l)'{-l,--log-level}'[verbosity of logging (1..7) (default 6)]:verbosity level:({1..7})' \ + '(--log-level -l)'{-l,--log-level}'[specify log verbosity]:verbosity level [6]:({1..7})' \ '(--syslog -y --no-syslog -Y)'{-y,--syslog}'[log to syslog (default if stderr is no tty)]' \ '(--syslog -y --no-syslog -Y)'{-Y,--no-syslog}"[don't log to syslog (see -e, -E options)]" \ '(--no-sharedmem -m)'{-m,--no-sharedmem}"[don't start XSI Shared Memory support]" \ diff --git a/Completion/Debian/Command/_git-buildpackage b/Completion/Debian/Command/_git-buildpackage index c38edc1cc..81bf7dac9 100644 --- a/Completion/Debian/Command/_git-buildpackage +++ b/Completion/Debian/Command/_git-buildpackage @@ -13,14 +13,14 @@ _arguments \ '--git-sign-tags[sign tags]' \ '--git-no-sign-tags[negates --git-sign-tags]' \ '--git-keyid=-[GPG keyid to sign tags with]:GPG key:' \ - '--git-debian-tag=-[format string for debian tags]:default is debian/%(version)s:' \ - '--git-upstream-tag=-[format string for upstream tags]:default is upstream/%(version)s:' \ + '--git-debian-tag=-[format string for debian tags]:format string [debian/%%(version)s]' \ + '--git-upstream-tag=-[format string for upstream tags]:format string [upstream/%%(version)s]' \ '--git-pristine-tar[use pristine-tar to create .orig.tar.gz]' \ '--git-no-pristine-tar[negates --git-pristine-tar]' \ '--git-force-create[force creation of orig.tar.gz]' \ '--git-no-create-orig[do not create orig.tar.gz]' \ '--git-tarball-dir=-[location to look for external tarballs]:tarball directory:_files -/' \ - '--git-compression=-[compression type]:compression:(auto gzip bzip2 lzma xz)' \ + '--git-compression=-[compression type]:compression type [auto]:(auto gzip bzip2 lzma xz)' \ '--git-compression-level=-[set compression level]:level:(1 2 3 4 5 6 7 8 9)' \ '--git-upstream-branch=-[upstream branch]::' \ '--git-debian-branch=-[branch the Debian package is being developed on]::' \ diff --git a/Completion/Linux/Command/_alsa-utils b/Completion/Linux/Command/_alsa-utils index 91bb0b86c..dd5c26866 100644 --- a/Completion/Linux/Command/_alsa-utils +++ b/Completion/Linux/Command/_alsa-utils @@ -38,7 +38,7 @@ opts=( --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-coef='[test coefficient for ring buffer position]:coefficient [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]' diff --git a/Completion/Linux/Command/_ipset b/Completion/Linux/Command/_ipset index 061d16799..a40480904 100644 --- a/Completion/Linux/Command/_ipset +++ b/Completion/Linux/Command/_ipset @@ -4,7 +4,7 @@ local offset=0 local -a args from_to hash cmds listopts addopts _set_types () { - _values -S \ "Set type" \ + _values -S \ "set type" \ 'bitmap\:ip[uses a memory range to store IPv4 host (default) or IPv4 subnet addresses up to 65536 elements]'\ 'bitmap\:ip,mac[uses a memory range to store an IPv4 host/subnet and mac address pair up to 65536 elements]'\ 'bitmap\:port[uses a memory range to store port numbers independent of L4 protocol at up to 65536 elements]'\ @@ -37,18 +37,11 @@ from_to=('(--network)--from[from IP or network (with --netmask)]:IP' '(--from --to)--network[network]:IP/mask' ) -_addressfamily () { - vals=( inet - inet6 - ) - _describe -t addressfamily "Address Family" vals -} - -hash=( '--hashsize[the initial hash size aligned to a power of 2(default 1024)]:hashsize' - '--maxelem[the maximum number of elements in the set (default 65536)]:maxelements' - '--family[the protocol family of addresses to be stored in the set (default inet)]:addressfamily:_addressfamily' +hash=( '--hashsize[the initial hash size aligned to a power of 2]:hashsize [1024]' + '--maxelem[the maximum number of elements in the set]:max elements [65536]' + '--family[the protocol family of addresses to be stored in the set]:address family [inet]:(inet inet6)' '--timeout[adds timeout support to the set with your specified value as default, (0 = forever)]:entrytimeout' - '--probes[max number of tries to resolve clashing, altering this is discouraged (default 8)]:probes' + '--probes[max number of tries to resolve clashing, altering this is discouraged]:tries [8]' '--resize[ratio of increasing hash size after unsuccessful <probes> of double-hashing, altering discouraged]:percent' ) @@ -100,7 +93,7 @@ case $words[offset+2]; in args=( $hash ) ;; list\:set) - args=( '--size[size of the new setlist (default 8)]:size' ) + args=( '--size[size of the new setlist]:size [8]' ) ;; esac ;; diff --git a/Completion/Solaris/Command/_dtrace b/Completion/Solaris/Command/_dtrace index 6a6636af3..06e0dc4f6 100644 --- a/Completion/Solaris/Command/_dtrace +++ b/Completion/Solaris/Command/_dtrace @@ -12,7 +12,7 @@ case $OSTYPE in '-X+[specify ISO C conformance settings for preprocessor]:ISO C conformance:((a\:"ISO plus K&R extensions (default)" c\:"Strictly conformant ISO C" s\:"K&R C only" t\:"ISO plus K&R extensions"))' ) xopts=( - 'errexit[exit on error with specified status code (default 1)]::status' + 'errexit[exit on error with specified status code]::status [1]' 'noresolve[do not perform user address symbol resolution]' 'uresolve[specify resolution of user addresses]:how:(no symbol basename absolute)' ) diff --git a/Completion/Solaris/Command/_prstat b/Completion/Solaris/Command/_prstat index 1eb38845c..12be9c5a4 100644 --- a/Completion/Solaris/Command/_prstat +++ b/Completion/Solaris/Command/_prstat @@ -9,7 +9,7 @@ _prstat() ) sort_key=( - "cpu"\:"process CPU usage (default)" + "cpu"\:"process CPU usage" "pri"\:"process priority" "rss"\:"resident set size" "size"\:"size of process image" @@ -32,8 +32,8 @@ _prstat() '-p[only processes whose process ID is in the list]:PID list' \ '-P[only processes or lwps which have most recently executed on a CPU in the list]:CPU list' \ '-R[Put prstat in the real time scheduling class]' \ - '-s[Sort key (descending)]:key:(($sort_key))' \ - '-S[Sort key (ascending)]:key:(($sort_key))' \ + '-s[sort key (descending)]:sort key [cpu]:(($sort_key))' \ + '-S[sort key (ascending)]:sort key [cpu]:(($sort_key))' \ '-t[total usage summary for each user]' \ '-T[information about processes and tasks]' \ '-u[only processes whose effective user ID is in the list]:UID:_users' \ diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb index 21cd68761..1375813bb 100644 --- a/Completion/Unix/Command/_adb +++ b/Completion/Unix/Command/_adb @@ -446,8 +446,8 @@ _adb_dispatch_logcat() { _arguments \ '(-c -g)-s[set default filter to silent]' \ '(-c -g)-f[log output to file (defaults to stdout)]:logfile:_files' \ - '(-c -g -d)-r[rotate log every kbytes (default 16, requires -f)]:logsize:_guard "[0-9]#" "numeric value"' \ - '(-c -g -d)-n[max number of rotated logs (default 4)]:number :_guard "[0-9]#" "numeric value"' \ + '(-c -g -d)-r[rotate log at specified size, requires -f]:log size (kbytes) [16]' \ + '(-c -g -d)-n[specify max number of rotated logs]:number [4]' \ '(-c -g -d)-v[log format]:format: _values "format" brief process tag thread raw time threadtime long' \ '(-d -t -g)-c[clear log]' \ '(-c -g)-d[dump log]' \ diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant index 080ce6857..7401c7449 100644 --- a/Completion/Unix/Command/_ant +++ b/Completion/Unix/Command/_ant @@ -56,7 +56,7 @@ _arguments -C \ '-propertyfile[load all properties from specified file with -D properties taking precedence]:property file:_files -g "*.properties(-.)"' \ '-inputhandler[specify class which will handle input requests]:class:->class' \ '(-s -find -f -file -buildfile)'{-s,-find}'[search for specified build file towards the root of filesystem]:build file:(build.xml)' \ - '-nice[specify a niceness value for the main thread]:niceness value (default 5):({1..10})' \ + '-nice[specify a niceness value for the main thread]:niceness value [5]:({1..10})' \ '-nouserlib[run ant without using the jar files from ${user.home}/.ant/lib]' \ '-noclasspath[run ant without using CLASSPATH]' \ '-autoproxy[Java1.5+: use the OS proxy settings]' \ diff --git a/Completion/Unix/Command/_django b/Completion/Unix/Command/_django index 9eaa2284a..1d5cf7311 100644 --- a/Completion/Unix/Command/_django +++ b/Completion/Unix/Command/_django @@ -146,9 +146,9 @@ case $state in args+=( $locale $verbosity - {-d,--domain=}'[domain of the message files (default: "django")]:domain' + {-d,--domain=}'[domain of the message files]:domain [django]:(django djangojs)' {-a,--all}'[re-examine all code and templates]' - {-e,--extensions=}'[file extension(s) to examine (default: ".html")]:extension' + {-e,--extensions=}'[file extension(s) to examine]:extension [html]' ) ;; diff --git a/Completion/Unix/Command/_dtruss b/Completion/Unix/Command/_dtruss index bd1ae8bc5..b56e713d2 100644 --- a/Completion/Unix/Command/_dtruss +++ b/Completion/Unix/Command/_dtruss @@ -2,7 +2,7 @@ _arguments -s : \ '-a[print all details]' \ - '-b+[specify dynamic variable buffer size]:buffer size (default 4m)' \ + '-b+[specify dynamic variable buffer size]:buffer size [4m]' \ '-c[print system call counts]' \ '-d[print relative timestamps]' \ '-e[print elapsed times]' \ diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index 22d3083de..b6f1da2c6 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -1643,7 +1643,7 @@ args+=( '+e-[control how virtual function definitions are used]:virtual function definitions in classes:((0\:only\ interface 1\:generate\ code))' {-e,--entry}'[specify program entry point is entry]:entry' {-E,--preprocess}'[preprocess only; do not compile, assemble or link]' - '-fabi-version=-[use version <n> of the C++ ABI (default: 2)]:ABI version:(1 2 3 4 5 6)' + '-fabi-version=-[use specified C++ ABI version]:ABI version [0]:(0 1 2 3 4 5 6 7 8 9 10 11 12 13)' '-fada-spec-parent=[dump Ada specs as child units of given parent]' '-faggressive-loop-optimizations[aggressively optimize loops using language constraints]' '-falign-functions[align the start of functions]' @@ -1737,11 +1737,11 @@ args+=( '-feliminate-unused-debug-types[perform unused type elimination in debug info]' '-femit-class-debug-always[do not suppress C++ class debug information]' '-femit-struct-debug-baseonly[aggressive reduced debug info for structs]' - '-femit-struct-debug-detailed=[detailed reduced debug info for structs]:spec list' + '-femit-struct-debug-detailed=-[detailed reduced debug info for structs]:spec list [all]' '-femit-struct-debug-reduced[conservative reduced debug info for structs]' '-fexceptions[enable exception handling]' '-fexcess-precision=-[specify handling of excess floating-point precision]:precision handling:(fast standard)' - '-fexec-charset=[convert all strings and character constants to character set]:character set' + '-fexec-charset=-[convert all strings and character constants to character set]:character set [UTF-8]' '-fexpensive-optimizations[perform a number of minor, expensive optimizations]' '-fextended-identifiers[permit universal character names in identifiers]' '-ffast-math[sets -fno-math-errno, -funsafe-math-optimizations, -ffinite-math-only, -fno-rounding-math, -fno-signaling-nans and -fcx-limited-range]' @@ -1750,8 +1750,7 @@ args+=( '-ffixed--[mark <register> as being unavailable to the compiler]:register' '-ffloat-store[don'\''t allocate floats and doubles in extended- precision registers]' '-fforward-propagate[perform a forward propagation pass on RTL]' - '-ffp-contract=-[perform floating- point expression contraction (default: fast)]:style:(on off fast)' - '-ffp-contract=[perform floating-point expression contraction]:style:(off on fast)' + '-ffp-contract=-[perform floating-point expression contraction]:style [fast]:(on off fast)' '-ffp-int-builtin-inexact[allow built-in functions ceil, floor, round, trunc to raise "inexact" exceptions]' '-ffreestanding[do not assume that standard C libraries and main exist]' '-ffunction-cse[allow function addresses to be held in registers]' diff --git a/Completion/Unix/Command/_gnupod b/Completion/Unix/Command/_gnupod index f53ae6c59..22ccabb9d 100644 --- a/Completion/Unix/Command/_gnupod +++ b/Completion/Unix/Command/_gnupod @@ -30,8 +30,8 @@ case "$service" in '(-b --set-bookmarkable)'{-b,--set-bookmarkable}'[set this song as bookmarkable (= Remember position)]' --set-shuffleskip'[exclude this file in shuffle-mode]' --set-compilation'[mark songs as being part of a compilation]' - --min-vol-adj='[minimum volume adjustment allowed by ID3v2.4 RVA2 tag (range -100 to 100, default 0)]' - --max-vol-adj='[maximum volume adjustment allowed by ID3v2.4 RVA2 tag (range -100 to 100, default 0)]' + --min-vol-adj='[minimum volume adjustment allowed by ID3v2.4 RVA2 tag]:adjustment (-100..100) [0]' + --max-vol-adj='[maximum volume adjustment allowed by ID3v2.4 RVA2 tag]:adjustment (-100..100) [0]' --artwork='[use FILE as album cover]:artwork:_files' '*:file to add:_files' ) diff --git a/Completion/Unix/Command/_initctl b/Completion/Unix/Command/_initctl index b404c0c16..b60bdbc5b 100644 --- a/Completion/Unix/Command/_initctl +++ b/Completion/Unix/Command/_initctl @@ -157,7 +157,7 @@ _initctl() '--system[talk via DBUS system bus instead of socket]' '(-q --quiet)'{-q,--quiet}'[reduce output to errors only]' '(-v --verbose)'{-v,--verbose}'[increase output to include informational messages]' - '--dest=[D-Bus name for init, defaults to com.ubuntu.Upstart]' + '--dest=[specify D-Bus name for init]:D-Bus name [com.ubuntu.Upstart]' '--help[display help and exit]' '--version[output version information and exit]' ) diff --git a/Completion/Unix/Command/_mysqldiff b/Completion/Unix/Command/_mysqldiff index 52b96ef21..2515834e0 100644 --- a/Completion/Unix/Command/_mysqldiff +++ b/Completion/Unix/Command/_mysqldiff @@ -6,7 +6,7 @@ _mysqldiff () { {-p{,1,2},--password{,1,2}=}':server password: ' \ {-u{,1,2},--user{,1,2}=}':server username:_mysql_users' \ {-s{,1,2},--socket{,1,2}=}':server socket:_directories' \ - {-d,--debug=}':debugging level (default 1):(1 2 3 4 5 6 7 8)' \ + {-d,--debug=}':debugging level [1]:(1 2 3 4 5 6 7 8)' \ {-i,--tolerant}':ignore DEFAULT and formatting changes: ' \ {-k,--keep-old-tables}":don\'t output DROP TABLE commands: " \ {-n,--no-old-defs}"[don't output old defs as comments]" \ diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index bdd261322..98e5abc70 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -134,11 +134,11 @@ _pandoc_top_level_division(){ _pandoc_email_obfusication(){ local -a policies policies=( - 'none:(default) leaves mailto: links as they are' + 'none:leave mailto: links as they are' 'javascript:obfuscates them using JavaScript' 'references:obfuscates them by printing their letters as decimal or hexadecimal character references' ) - _describe 'obfusication' policies + _describe 'obfuscation policy [none]' policies } # choose wrapping policy @@ -146,11 +146,11 @@ _pandoc_email_obfusication(){ _pandoc_wrap() { local -a policies policies=( - 'auto:(default) wrap lines to the column width specified by --columns (default 72)' + 'auto:wrap lines to the column width specified by --columns (default 72)' "none:don't wrap lines at all" 'preserve:attempt to preserve the wrapping from the source document' ) - _describe 'policy' policies + _describe 'policy [auto]' policies } # choose eol policy @@ -170,11 +170,11 @@ _pandoc_eol() { _pandoc_track_changes() { local -a policies policies=( - 'accept:(default) inserts all insertions, and ignores all deletions' + 'accept:insert all insertions, and ignore all deletions' 'reject:inserts all deletions and ignores insertions' 'all:puts in insertions, deletions, and comments, wrapped in spans with insertion, deletion, comment-start, and comment-end classes, respectively' ) - _describe 'policy' policies + _describe 'policy [accept]' policies } # The real thing @@ -185,7 +185,7 @@ _arguments -s \ '--data-dir=[specify the user data directory to search for pandoc data files]:data directory:_files -/' \ {-d+,--defauls=}'[read default from YAMAL file]: :_pandoc_defaults_file' \ '--shift-heading-level-by=[shift heading levels by specified number]:positive or negative integer: ' \ - '!--base-header-level=[(deprecated) specify the base level for headers]:number (default 1):(1 2 3 4 5)' \ + '!--base-header-level=:number [1]:(1 2 3 4 5)' \ '!--strip-empty-paragraphs[deprecated. Use the +empty_paragraphs extension instead]' \ '--indented-code-classes=[classes to use for indented code blocks]:class:{_message "Classes separated with ,"}' \ '--default-image-extension=[specify a default extension to use when image paths/URLs have no extension]:extension: ' \ @@ -195,7 +195,7 @@ _arguments -s \ {\*-M+,\*--metadata=}'[set the metadata field KEY to the value VALUE]:key\:value: ' \ '*--metadata_file=[read metadata from file]:YAML or JSON file:_files' \ {-p,--preserve-tabs}'[preserve tabs instead of converting them to spaces]' \ - '--tab-stop=[specify the number of spaces per tab (default is 4)]:number:{_message -r "choose a number equals to or greater then 1"}' \ + '--tab-stop=[specify the number of spaces per tab]:spaces [4]' \ '--track-changes=[specifies what to do with insertions, deletions, and comments produced by the MS Word "Track Changes" feature]: :_pandoc_track_changes' \ '--extract-media=[extract media in source document to specified directory]:directory:_files -/' \ '--abbreviations=[specifies a custom abbreviations file]:file:_files ' \ @@ -207,7 +207,7 @@ _arguments -s \ '--eol=[manually specify line endings (crlf|lf|native)]: :_pandoc_eol' \ '--dpi=[specify the dpi (dots per inch) value for conversion from pixels to inch/centimeters and vice versa]:number: ' \ '--wrap=[determine how text is wrapped in the output (the source code, not the rendered version)]: :_pandoc_wrap ' \ - '--columns=[specify length of lines in characters (default 72)]:number: ' \ + '--columns=[specify length of lines in characters]:length [72]' \ {--toc,--table-of-contents}'[include an automatically generated table of contents]' \ '--toc-depth=[specify the number of section levels to include in the table of contents]:number:{_message -r "choose a number equals to or greater then 1"}' \ '--strip-comments[strip out HTML comments in the Markdown or Textile source]' \ @@ -226,11 +226,11 @@ _arguments -s \ '--ascii[use only ASCII characters in output, supported only for HTML and DocBook output]' \ '--reference-links[use reference-style links, rather than inline links]' \ '--reference-location=[specify where footnotes (and references, if reference-links is set) are placed (block|section|document)]: :_pandoc_reference_location' \ - '--markdown-headings[specify style for level1 and 2 headings in markdown output]:style (default atx):(setext atx)' \ + '--markdown-headings[specify style for level1 and 2 headings in markdown output]:style [atx]:(setext atx)' \ '!--atx-headers[use ATX-style headers in Markdown and AsciiDoc output]' \ '--top-level-division=[treat top-level headers as the given division type in LaTeX, ConTeXt, DocBook, and TEI output]: :_pandoc_top_level_division' \ {-N,--number-sections}'[number section headings in LaTeX, ConTeXt, HTML, or EPUB output]' \ - '--number-offset=[offset for section headings in HTML output (ignored in other output formats)]:number[number,...] (default 0): ' \ + '--number-offset=[offset for section headings in HTML output (ignored in other output formats)]:number[number,...] [0]' \ '--listings[use the listings package for LaTeX code blocks]' \ {-i,--incremental}'[make list items in slide shows display incrementally (one by one)]' \ '--slide-level=[specifies that headers with the specified level create slides (for beamer, s5, slidy, slideous, dzslides)]:slide level:(1 2 3 4 5 6)' \ diff --git a/Completion/Unix/Command/_pbm b/Completion/Unix/Command/_pbm index 62004f79e..8b5576c5f 100644 --- a/Completion/Unix/Command/_pbm +++ b/Completion/Unix/Command/_pbm @@ -740,7 +740,7 @@ ppmtomitsu) _arguments \ '-sharpness:sharpness:(1 2 3 4)' \ '-enlarge:enlargement factor:(1 2 3)' \ - '-media:output media (default\: 1184x1350):((A\:1216x1350 A4\:1184x1452 AS\:1216x1650 A4S\:1184x1754))' \ + '-media:output media [1184x1350]:((A\:1216x1350 A4\:1184x1452 AS\:1216x1650 A4S\:1184x1754))' \ '-copy:number of copies:(1 2 3 4 5 6 7 8 9)' \ -{dpi300,tiny} ':file:_pbm' ;; diff --git a/Completion/Unix/Command/_perforce b/Completion/Unix/Command/_perforce index 4e69dee78..cb6cdb79f 100644 --- a/Completion/Unix/Command/_perforce +++ b/Completion/Unix/Command/_perforce @@ -2551,7 +2551,7 @@ _perforce_cmd_logstat() { (( $+functions[_perforce_cmd_logtail] )) || _perforce_cmd_logtail() { _arguments -s : \ - '-b[specify block size, default 8192]:block size: ' \ + '-b[specify block size]:block size [8192]' \ '-s[specify start offset]:offset: ' \ '-m[specify max blocks]:max blocks: ' } diff --git a/Completion/Unix/Command/_qemu b/Completion/Unix/Command/_qemu index 30fcd6757..7bc02c30c 100644 --- a/Completion/Unix/Command/_qemu +++ b/Completion/Unix/Command/_qemu @@ -19,8 +19,8 @@ _arguments \ '-boot[specify which image to boot from]:boot device:((a\:floppy\ image\ a c\:hard\ disk d\:cdrom))' \ '-snapshot[write to temporary files instead of disk image files]' \ '-no-fd-bootchk[disable boot sig checking for floppies in Bochs BIOS]' \ - '-m[virtual RAM size (default=128)]:megs:' \ - '-smp[set the number of CPUs (default=1)]:number of CPUs:' \ + '-m[specify virtual RAM size]:size (MB) [128]' \ + '-smp[set the number of CPUs]:number of CPUs [1]' \ '-nographic[disable graphical output]' \ '-vnc[listen on VNC display]:display:' \ '-k[use keyboard layout]:keyboard layout language:(ar de-ch es fo fr-ca hu ja mk no pt-br sv da en-gb et fr fr-ch is lt nl pl ru th de en-us fi fr-be hr it lv nl-be pt sl tr)' \ diff --git a/Completion/Unix/Command/_ruby b/Completion/Unix/Command/_ruby index 3ed25a3f0..a57bffcda 100644 --- a/Completion/Unix/Command/_ruby +++ b/Completion/Unix/Command/_ruby @@ -21,7 +21,7 @@ common=( ) opts=( - '-0-[specify record separator]:input record separator in octal [default \0]' + '-0-[specify record separator]:input record separator in octal [\0]' '-a[autosplit mode with -n or -p (splits $_ into $F)]' '-c[check syntax only]' '-C+[cd to directory before executing your script]:directory:_files -/' diff --git a/Completion/Unix/Command/_tidy b/Completion/Unix/Command/_tidy index 3998ccdb3..35ceb7e51 100644 --- a/Completion/Unix/Command/_tidy +++ b/Completion/Unix/Command/_tidy @@ -12,7 +12,7 @@ opts=( ${(M)opts:#*:*} ) _arguments -s -A "-*" --$^opts \ '(-indent -i)'{-indent,-i}'[indent element content]' \ - '-wrap[wrap text at the specified <column> (default is 68)]:column:' \ + '-wrap[wrap text at the specified column]:column [68]' \ '(-upper -u)'{-upper,-u}'[force tags to upper case (default is lower case)]' \ '(-clean -c)'{-clean,-c}'[replace FONT, NOBR and CENTER tags by CSS]' \ '(-bare -b)'{-bare,-b}'[strip out smart quotes and em dashes, etc.]' \ diff --git a/Completion/Unix/Command/_w3m b/Completion/Unix/Command/_w3m index 8b45ad730..eff9901ca 100644 --- a/Completion/Unix/Command/_w3m +++ b/Completion/Unix/Command/_w3m @@ -8,7 +8,7 @@ typeset -A opt_args _arguments -C \ '-t[set tab width]:tab width:' \ '-r[ignore backspace effect]' \ - '-l[specify number of preserved lines]:number of lines (default 10000):' \ + '-l[specify number of preserved lines]:number of lines [10000]' \ '-I[document charset]:charset:->charset' \ '-O[display/output charset]:charset:->charset' \ '( -s -j)-e[EUC-JP]' \ diff --git a/Completion/X/Command/_vnc b/Completion/X/Command/_vnc index 9263ab930..7d818cfe7 100644 --- a/Completion/X/Command/_vnc +++ b/Completion/X/Command/_vnc @@ -65,10 +65,10 @@ case $service in '-rfbauth[use authentication on RFB protocol]:passwd-file:_files' \ '-httpd[serve files via HTTP from here]:dir:_files -/' \ '-httpport[port for HTTP]:port:' \ - '-deferupdate[time in ms to defer updates (default 40)]:time (ms):' \ + '-deferupdate[specify time to defer updates by]:time (ms) [40]' \ '-economictranslate[less memory-hungry translation]' \ '-lazytight[disable "gradient" filter in tight encoding]' \ - '-desktop[VNC desktop name (default x11)]:name:' \ + '-desktop[specify VNC desktop name]:name [x11]' \ '-alwaysshared[always treat new clients as shared]' \ '-nevershared[never treat new clients as shared]' \ "-dontdisconnect[don't disconnect existing clients for new non-shared connections]" \ diff --git a/Completion/X/Command/_xdvi b/Completion/X/Command/_xdvi index d55c99485..c33e67bcc 100644 --- a/Completion/X/Command/_xdvi +++ b/Completion/X/Command/_xdvi @@ -9,7 +9,7 @@ _xt_arguments \ '-cr:cursor color:_x_color' \ '-debug:debugging bitmask:((1\:bitmaps 2\:dvi\ translation 4\:pk\ reading 8\:batch\ operation 16\:events 32\:file\ opening 64\:PostScript\ communication 128\:Kpathsea\ statistics 256\:Kpathsea\ hash\ table\ lookups 512\:Kpathsea\ path\ definitions 1024\:Kpathsea\ path\ expansion 2048\:Kpathsea\ searches))' \ '-density:font shrink density' \ - '-gamma:anti-aliasing factor (default 1.0)' \ + '-gamma:anti-aliasing factor [1.0]' \ -grid{1,2,3}':grid color:_x_color' \ '-gspalette:Ghostscript palette:(Color Greyscale Monochrome)' \ '-hl:page highlight color:_x_color' \ -- cgit v1.2.3 From e9203d04aa8cd0e77ddafd8153368bf10a909d44 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Sat, 10 Jul 2021 23:50:50 +0200 Subject: 49157: fix uses of literal % characters in completion descriptions --- ChangeLog | 5 +++++ Completion/Linux/Command/_valgrind | 8 ++++---- Completion/Unix/Command/_baz | 2 +- Completion/Unix/Command/_opustools | 4 ++-- Completion/Unix/Command/_tla | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 1421c357d..62814354c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2021-07-10 Oliver Kiddle <opk@zsh.org> + * 49157: Completion/Linux/Command/_valgrind, + Completion/Unix/Command/_baz, Completion/Unix/Command/_opustools, + Completion/Unix/Command/_tla: fix uses of literal % characters in + completion descriptions + * 49156: Completion/Cygwin/Command/_cygserver, Completion/Debian/Command/_git-buildpackage, Completion/Linux/Command/_alsa-utils, Completion/Unix/Command/_adb, diff --git a/Completion/Linux/Command/_valgrind b/Completion/Linux/Command/_valgrind index 4a710e7f7..23a8cd734 100644 --- a/Completion/Linux/Command/_valgrind +++ b/Completion/Linux/Command/_valgrind @@ -20,7 +20,7 @@ common_own_malloc=( '--alignment=-[set minimum alignment of heap allocations]:number [16]' '--redzone-size=-[set minimum size of redzones added before/after heap blocks]:size (bytes) [16]' '--xtree-memory=-[profile heap memory in an xtree [none]:(none allocs full)' - '--xtree-memory-file=-[specify xtree memory report file]:file [xtmemory.kcg.%p]:_files' + '--xtree-memory-file=-[specify xtree memory report file]:file [xtmemory.kcg.%%p]:_files' ) common_read_varinfo=( @@ -67,7 +67,7 @@ args_addrcheck=( '(--show-leak-kinds)--show-reachable=-[show reachable blocks in leak check]:enable:(yes no)' '(--show-leak-kinds)--show-possibly-lost=-:enable:(yes no)' '--xtree-leak=-[output leak result in xtree format]:enable [no]:(yes no)' - '--xtree-leak-file=-[specify xtree leak report file]:file [xtleak.kcg.%p]:_files' + '--xtree-leak-file=-[specify xtree leak report file]:file [xtleak.kcg.%%p]:_files' '--undef-value-errors=-[check for undefined value errors]:enable [yes]:(yes no)' '--track-origins=-[show origins of undefined values]:enable [no]:(yes no)' $common_partial @@ -123,7 +123,7 @@ args_cachegrind=( '--LL=-[set LL cache manually]:size,assoc,line_size' '--cache-sim=-[collect cache stats]:enable [yes]:(yes no)' '--branch-sim=-[collect branch prediction stats]:enable [no]:(yes no)' - '--cachegrind-out-file=-[specify output file name]:file name [cachegrind.out.%p]:_files' + '--cachegrind-out-file=-[specify output file name]:file name [cachegrind.out.%%p]:_files' ) args_helgrind=( @@ -169,7 +169,7 @@ args_massif=( ))" '--detailed-freq=-[every Nth snapshot should be detailed]:snapshot interval [10]' '--max-snapshots=-[specofy maximum number of snapshots recorded]:maximum [100]' - '--massif-out-file=-[specify output file name]:filename [massif.out.%p]:_files' + '--massif-out-file=-[specify output file name]:filename [massif.out.%%p]:_files' ) args_exp_bbv=( diff --git a/Completion/Unix/Command/_baz b/Completion/Unix/Command/_baz index 4dfcdf882..0acdc4639 100644 --- a/Completion/Unix/Command/_baz +++ b/Completion/Unix/Command/_baz @@ -64,7 +64,7 @@ _baz_config () { if [[ -d "$root/configs" ]]; then configdir=("$root/configs") - _description files expl '%Bconfig file%b' + _description files expl 'config file' _files -W configdir "$expl[@]" && ret=0 else _message -e messages "No configs/ directory in tree whose root is $root" diff --git a/Completion/Unix/Command/_opustools b/Completion/Unix/Command/_opustools index c860a170f..1fd97798a 100644 --- a/Completion/Unix/Command/_opustools +++ b/Completion/Unix/Command/_opustools @@ -14,7 +14,7 @@ case $service in '--cvbr[use constrained variable bitrate encoding]' \ '--downmix-mono[downmix to mono]' \ '--downmix-stereo[downmix to stereo (if >2 channels)]' \ - '--expect-loss[set expected packet loss]:expected packet loss (%) (0-100) [0]' \ + '--expect-loss[set expected packet loss]:expected packet loss (%%) (0-100) [0]' \ '--framesize[set maximum frame size]:maximum frame size (milliseconds) [20]:(2.5 5 10 20 40 60)' \ '--hard-cbr[use hard constant bitrate encoding]' \ '--max-delay[set maximum container delay]:maximum container delay (milliseconds) (0-1000) [1000]' \ @@ -57,7 +57,7 @@ case $service in '--no-dither[do not dither 16-bit output]' \ '--float[output 32-bit floating-point samples]' \ '--force-wav[force RIFF wav header on output]' \ - '--packet-loss[simulate random packet loss]:packet loss probability (%) (0-100)' \ + '--packet-loss[simulate random packet loss]:packet loss probability (%%) (0-100)' \ '--save-range[save check values for every frame to a file]:output for check values:_files' ;; opusinfo) diff --git a/Completion/Unix/Command/_tla b/Completion/Unix/Command/_tla index 33dfc005f..ec7e76d44 100644 --- a/Completion/Unix/Command/_tla +++ b/Completion/Unix/Command/_tla @@ -73,7 +73,7 @@ _tla_config () { if [[ -d "$root/configs" ]]; then configdir=("$root/configs") - _description files expl '%Bconfig file%b' + _description files expl 'config file' _files -W configdir "$expl[@]" && ret=0 else _message -e messages "No configs/ directory in tree whose root is $root" -- cgit v1.2.3 From 6e10067ffd3d2ede3e0a59c36e03d00cee5d9ad1 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Sun, 11 Jul 2021 00:32:34 +0200 Subject: 49158: remove superfluous function definitions --- ChangeLog | 10 +++ Completion/Debian/Command/_dscverify | 38 +++++------ Completion/Solaris/Command/_dhcpinfo | 58 ++++++++-------- Completion/Solaris/Command/_inetadm | 22 +++--- Completion/Solaris/Command/_prstat | 79 ++++++++++----------- Completion/Solaris/Command/_svcadm | 129 +++++++++++++++++------------------ Completion/Solaris/Command/_svcprop | 42 +++++------- Completion/Solaris/Command/_zlogin | 30 ++++---- Completion/Unix/Command/_pkginfo | 36 +++++----- Completion/Unix/Command/_pkgrm | 32 ++++----- 10 files changed, 223 insertions(+), 253 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 62814354c..2b4d4bcc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2021-07-10 Oliver Kiddle <opk@zsh.org> + * 49158: Completion/Debian/Command/_dscverify, + Completion/Solaris/Command/_dhcpinfo, + Completion/Solaris/Command/_inetadm, + Completion/Solaris/Command/_prstat, + Completion/Solaris/Command/_svcadm, + Completion/Solaris/Command/_svcprop, + Completion/Solaris/Command/_zlogin, + Completion/Unix/Command/_pkginfo, Completion/Unix/Command/_pkgrm: + remove superfluous function definitions + * 49157: Completion/Linux/Command/_valgrind, Completion/Unix/Command/_baz, Completion/Unix/Command/_opustools, Completion/Unix/Command/_tla: fix uses of literal % characters in diff --git a/Completion/Debian/Command/_dscverify b/Completion/Debian/Command/_dscverify index 4d383c6c4..84b00e4e7 100644 --- a/Completion/Debian/Command/_dscverify +++ b/Completion/Debian/Command/_dscverify @@ -4,27 +4,23 @@ # This is dscverify, from the Debian devscripts package, version 2.20.2 # ... -_dscverify() { - local all_opts=( - '--help[show the help message and exit]' - '--version[show the version + copyright and exit]' - '--no-default-keyrings[do not check against the default keyrings]' - '*--keyring[add keyring to the list of keyrings used]:keyring:_files -g "*.(kbx|gpg)(-.)"' - '(--nosigcheck --no-sig-check -u)'{--nosigcheck,--no-sig-check,-u}'[do not verify the GPG signature]' - '--verbose[do not suppress GPG output]' - '*:dsc file:_files -g "*.(changes|dsc|buildinfo)(-.)"' - ) +local all_opts=( + '--help[show the help message and exit]' + '--version[show the version + copyright and exit]' + '--no-default-keyrings[do not check against the default keyrings]' + '*--keyring[add keyring to the list of keyrings used]:keyring:_files -g "*.(kbx|gpg)(-.)"' + '(--nosigcheck --no-sig-check -u)'{--nosigcheck,--no-sig-check,-u}"[don't verify the GPG signature]" + "--verbose[don't suppress GPG output]" + '*:dsc file:_files -g "*.(changes|dsc|buildinfo)(-.)"' +) - local first_only=( - '(--no-conf --noconf)'{--no-conf,--noconf}'[do not read the devscripts config file]' - ) +local first_only=( + '(--no-conf --noconf)'{--no-conf,--noconf}"[don't read the devscripts config file]" +) - if (( CURRENT == 2 )); then - all_opts+=($first_only) - fi +if (( CURRENT == 2 )); then + all_opts+=( $first_only ) +fi - _arguments \ - "$all_opts[@]" -} - -_dscverify "$@" +_arguments \ + "$all_opts[@]" diff --git a/Completion/Solaris/Command/_dhcpinfo b/Completion/Solaris/Command/_dhcpinfo index 079b6e6f6..1dac684af 100644 --- a/Completion/Solaris/Command/_dhcpinfo +++ b/Completion/Solaris/Command/_dhcpinfo @@ -1,36 +1,32 @@ #compdef dhcpinfo -_dhcpinfo() { - local -a mnemonics_v4 mnemonics_v6 +local -a mnemonics_v4 mnemonics_v6 - mnemonics_v4=( - Subnet UTCoffst Router Timeserv IEN116ns DNSserv Logserv - Cookie Lprserv Impress Resource Hostname Bootsize Dumpfile - DNSdmain Swapserv Rootpath ExtendP IpFwdF NLrouteF PFilter - MaxIpSiz IpTTL PathTO PathTbl MTU SameMtuF Broadcst - MaskDscF MaskSupF RDiscvyF RSolictS StaticRt TrailerF - ArpTimeO EthEncap TcpTTL TcpKaInt TcpKaGbF NISdmain - NISservs NTPservs NetBNms NetBDsts NetBNdT NetBScop - XFontSrv XDispMgr LeaseTim Message T1Time T2Time NW_dmain - NWIPOpts NIS+dom NIS+serv TFTPsrvN OptBootF MblIPAgt - OptBootF MblIPAgt SMTPserv POP3serv NNTPserv WWWservs - Fingersv IRCservs STservs STDAservs UserClas SLP_DA SLP_SS - AgentOpt FQDN PXEarch BootFile BootPath BootSrvA BootSrvN - EchoVC LeaseNeg - ) +mnemonics_v4=( + Subnet UTCoffst Router Timeserv IEN116ns DNSserv Logserv + Cookie Lprserv Impress Resource Hostname Bootsize Dumpfile + DNSdmain Swapserv Rootpath ExtendP IpFwdF NLrouteF PFilter + MaxIpSiz IpTTL PathTO PathTbl MTU SameMtuF Broadcst + MaskDscF MaskSupF RDiscvyF RSolictS StaticRt TrailerF + ArpTimeO EthEncap TcpTTL TcpKaInt TcpKaGbF NISdmain + NISservs NTPservs NetBNms NetBDsts NetBNdT NetBScop + XFontSrv XDispMgr LeaseTim Message T1Time T2Time NW_dmain + NWIPOpts NIS+dom NIS+serv TFTPsrvN OptBootF MblIPAgt + OptBootF MblIPAgt SMTPserv POP3serv NNTPserv WWWservs + Fingersv IRCservs STservs STDAservs UserClas SLP_DA SLP_SS + AgentOpt FQDN PXEarch BootFile BootPath BootSrvA BootSrvN + EchoVC LeaseNeg +) - mnemonics_v6=( - ClientID ServerID Preference Unicast UserClass VendorClass - SIPNames SIPAddresses DNSAddresses DNSSearch NISServers - NIS+Servers NISDomain NIS+Domain SNTPServers InfoRefresh - BCMCDomain BCMCAddresses - ) +mnemonics_v6=( + ClientID ServerID Preference Unicast UserClass VendorClass + SIPNames SIPAddresses DNSAddresses DNSSearch NISServers + NIS+Servers NISDomain NIS+Domain SNTPServers InfoRefresh + BCMCDomain BCMCAddresses +) - _arguments -A \ - '-c[]' \ - '-i[interface]:interface:' \ - '-n[maximum number of lines]:limit:' \ - ':DHCP Parameter:_values "DHCP Parameter" $mnemonics_v4' \ -} - -_dhcpinfo "$@" +_arguments -A "-*" \ + '-c[]' \ + '-i[interface]:interface' \ + '-n[maximum number of lines]:limit' \ + ':DHCP parameter:_values "DHCP parameter" $mnemonics_v4' diff --git a/Completion/Solaris/Command/_inetadm b/Completion/Solaris/Command/_inetadm index 0c8b14a4e..527cc5a71 100644 --- a/Completion/Solaris/Command/_inetadm +++ b/Completion/Solaris/Command/_inetadm @@ -1,16 +1,10 @@ #compdef inetadm -_inetadm() { - _arguments -s \ - '-?[help]' \ - '-l[list service instance properties]:FMRI:_svcs_fmri -i' \ - '-e[enable specified instance]:FMRI:_svcs_fmri -i' \ - '-d[disable specified instance]:FMRI:_svcs_fmri -i' \ - '-p[list inet service properties]' \ - '-m[modify service instance properties]:FMRI:_svcs_fmri -i' \ - '-M[modify inet service properties]' -} - -_inetadm "$@" - -# vi:tw=0 +_arguments -s \ + '-?[help]' \ + '-l[list service instance properties]:FMRI:_svcs_fmri -i' \ + '-e[enable specified instance]:FMRI:_svcs_fmri -i' \ + '-d[disable specified instance]:FMRI:_svcs_fmri -i' \ + '-p[list inet service properties]' \ + '-m[modify service instance properties]:FMRI:_svcs_fmri -i' \ + '-M[modify inet service properties]' diff --git a/Completion/Solaris/Command/_prstat b/Completion/Solaris/Command/_prstat index 12be9c5a4..a95919127 100644 --- a/Completion/Solaris/Command/_prstat +++ b/Completion/Solaris/Command/_prstat @@ -1,46 +1,41 @@ #compdef prstat -_prstat() -{ - local d_opt sort_key - d_opt=( - "u"\:"seconds past the epoch" - "d"\:"standard date format" - ) +local d_opt sort_key +d_opt=( + "u"\:"seconds past the epoch" + "d"\:"standard date format" +) - sort_key=( - "cpu"\:"process CPU usage" - "pri"\:"process priority" - "rss"\:"resident set size" - "size"\:"size of process image" - "time"\:"process execution time" - ) +sort_key=( + "cpu"\:"process CPU usage" + "pri"\:"process priority" + "rss"\:"resident set size" + "size"\:"size of process image" + "time"\:"process execution time" +) - _arguments -A "-*" \ - '-a[information about processes and users]' \ - '-c[new reports below previous reports instead of overprinting them]' \ - '-C[processes or lwps that are bound to processor sets in the list]:processor set list:' \ - '-d[specify the representation of time]:time representation:(($d_opt))' \ - '-h[only processes or lwps whose home lgroup is in the list]:lgroup list:' \ - '-H[information about home lgroup]' \ - '-j[only processes or lwps whose project ID is in the given list]:project list:' \ - '-J[information about processes and projects]' \ - '-k[only processes or lwps whose task ID is in tasklist]:task list'\ - '-L[statistics for each light-weight process (LWP)]' \ - '-m[microstate process accounting information]' \ - '-n[restrict number of output lines]:ntop,[nbottom]' \ - '-p[only processes whose process ID is in the list]:PID list' \ - '-P[only processes or lwps which have most recently executed on a CPU in the list]:CPU list' \ - '-R[Put prstat in the real time scheduling class]' \ - '-s[sort key (descending)]:sort key [cpu]:(($sort_key))' \ - '-S[sort key (ascending)]:sort key [cpu]:(($sort_key))' \ - '-t[total usage summary for each user]' \ - '-T[information about processes and tasks]' \ - '-u[only processes whose effective user ID is in the list]:UID:_users' \ - '-U[only processes whose real user ID is in the list]:UID:_users' \ - '-v[verbose process usage]' \ - '-z[only processes or LWPs whose zone ID is in the list]:zone ID:' \ - '-Z[information about processes and zones]' -} - -_prstat "$@" +_arguments -A "-*" \ + '-a[information about processes and users]' \ + '-c[new reports below previous reports instead of overprinting them]' \ + '-C[processes or lwps that are bound to processor sets in the list]:processor set list' \ + '-d[specify the representation of time]:time representation:(($d_opt))' \ + '-h[only processes or lwps whose home lgroup is in the list]:lgroup list' \ + '-H[information about home lgroup]' \ + '-j[only processes or lwps whose project ID is in the given list]:project list' \ + '-J[information about processes and projects]' \ + '-k[only processes or lwps whose task ID is in tasklist]:task list'\ + '-L[statistics for each light-weight process (LWP)]' \ + '-m[microstate process accounting information]' \ + '-n[restrict number of output lines]:ntop,[nbottom]' \ + '-p[only processes whose process ID is in the list]:PID list' \ + '-P[only processes or lwps which have most recently executed on a CPU in the list]:CPU list' \ + '-R[put prstat in the real time scheduling class]' \ + '-s[sort key (descending)]:sort key [cpu]:(($sort_key))' \ + '-S[sort key (ascending)]:sort key [cpu]:(($sort_key))' \ + '-t[total usage summary for each user]' \ + '-T[information about processes and tasks]' \ + '-u[only processes whose effective user ID is in the list]:UID:_users' \ + '-U[only processes whose real user ID is in the list]:UID:_users' \ + '-v[verbose process usage]' \ + '-z[only processes or LWPs whose zone ID is in the list]:zone ID' \ + '-Z[information about processes and zones]' diff --git a/Completion/Solaris/Command/_svcadm b/Completion/Solaris/Command/_svcadm index c9826f2eb..22780d03f 100644 --- a/Completion/Solaris/Command/_svcadm +++ b/Completion/Solaris/Command/_svcadm @@ -1,78 +1,75 @@ #compdef svcadm -_svcadm() { - local curcontext="$curcontext" state line expl subcmds - typeset -A opt_args +local curcontext="$curcontext" state line expl subcmds +typeset -A opt_args - subcmds=( enable disable restart refresh mark delegate clear milestone ) +subcmds=( enable disable restart refresh mark delegate clear milestone ) - if [[ $service == "svcadm" ]]; then - _arguments -C -A "-*" \ - '-v[Print actions verbosely]' \ - '*::command:->subcmd' && return 0 +if [[ $service == "svcadm" ]]; then + _arguments -C -A "-*" \ + '-v[print actions verbosely]' \ + '*::command:->subcmd' && return 0 - if (( CURRENT == 1 )); then - _wanted commands expl 'svcadm subcommand' compadd -a subcmds - return - fi - service="$words[1]" - curcontext="${curcontext%:*}=$service:" - fi + if (( CURRENT == 1 )); then + _wanted commands expl 'svcadm subcommand' compadd -a subcmds + return + fi + service="$words[1]" + curcontext="${curcontext%:*}-$service:" +fi - case $service in - (enable) - _arguments -A "-*" \ - '-r[Recursively enable dependencies]' \ - '-s[Wait for service to come online]' \ - '-T[Timeout for -s]:seconds:' \ - '-t[State change is temporary]' \ - '*:instance FMRI:_svcs_fmri -i' - ;; +case $service in + (enable) + _arguments -A "-*" \ + '-r[recursively enable dependencies]' \ + '-s[wait for service to come online]' \ + '-T[timeout for -s]:timeout (seconds)' \ + '-t[state change is temporary]' \ + '*:instance FMRI:_svcs_fmri -i' + ;; - (disable) - _arguments -A "-*" \ - '-s[Wait for service to become disabled]' \ - '-T[Timeout for -s]:seconds:' \ - '-t[State change is temporary]' \ - '*:instance FMRI:_svcs_fmri -i' - ;; + (disable) + _arguments -A "-*" \ + '-s[wait for service to become disabled]' \ + '-T[timeout for -s]:timeout (seconds)' \ + '-t[state change is temporary]' \ + '*:instance FMRI:_svcs_fmri -i' + ;; - (mark) - _arguments -A "-*" \ - '-I[Change state immediately]' \ - "-s[Wait for service to reach the new state]" \ - '-T[Timeout for -s]:seconds:' \ - '-t[State change is temporary]' \ - ':state:(degraded maintenance)' \ - ':instance FMRI:_svcs_fmri -i' - ;; + (mark) + _arguments -A "-*" \ + '-I[change state immediately]' \ + "-s[wait for service to reach the new state]" \ + '-T[timeout for -s]:timeout (seconds)' \ + '-t[state change is temporary]' \ + ':state:(degraded maintenance)' \ + ':instance FMRI:_svcs_fmri -i' + ;; - (restart|refresh|clear) - _arguments \ - "-s[Wait for service to $service]" \ - '-T[Timeout for -s]:seconds:' \ - '*:instance FMRI:_svcs_fmri -i' - ;; + (restart|refresh|clear) + _arguments \ + "-s[wait for service to $service]" \ + '-T[timeout for -s]:timeout (seconds)' \ + '*:instance FMRI:_svcs_fmri -i' + ;; - (delegate) - _arguments -A "-*" \ - '-s[Wait for instances to come online]' \ - '-T[Timeout for -s]:seconds:' \ - ':restarter FMRI:_svcs_fmri -r' \ - '*:FMRI:_svcs_fmri -i' - ;; + (delegate) + _arguments -A "-*" \ + '-s[wait for instances to come online]' \ + '-T[timeout for -s]:timeout (seconds)' \ + ':restarter FMRI:_svcs_fmri -r' \ + '*:FMRI:_svcs_fmri -i' + ;; - (milestone) - _arguments -A "-*" \ - '-d[Make milestone the default]' \ - '-s[Wait for the transition to the new milestone]' \ - '-T[Timeout for -s]:seconds:' \ - '*:milestone FMRI:_svcs_fmri -m' - ;; + (milestone) + _arguments -A "-*" \ + '-d[make milestone the default]' \ + '-s[wait for the transition to the new milestone]' \ + '-T[timeout for -s]:timeout (seconds)' \ + '*:milestone FMRI:_svcs_fmri -m' + ;; - (*) - _message "unknown svcadm subcommand: $service" - esac -} - -_svcadm "$@" + (*) + _message "unknown svcadm subcommand: $service" + ;; +esac diff --git a/Completion/Solaris/Command/_svcprop b/Completion/Solaris/Command/_svcprop index 4a5436caf..19c65d3cf 100644 --- a/Completion/Solaris/Command/_svcprop +++ b/Completion/Solaris/Command/_svcprop @@ -1,26 +1,20 @@ #compdef svcprop -_svcprop() { - _arguments -s \ - '-f[designate properties by their FMRI]' \ - '-q[quiet]' \ - '-t[use multi-property output format]' \ - '-v[verbose]' \ - - set1 \ - '-w[waits for the selected property or property group to change]' \ - '-p[prints values of named property or property group]' \ - ':FMRI:_svcs_fmri -i' \ - - set2 \ - '-a[display all properties]' \ - '-g[group type filter]:group type:' \ - '*-l[properties from a layer]:layer:(admin site-profile system-profile manifest)' \ - '(-c -s)-C[retrieve properties without composition]' \ - '(-C -s)-c[retrieve properties with composition]' \ - '(-c -C)-s[retrieve properties from snapshot]:snapshot:' \ - '*-p[prints values of named property or property group]' \ - '*:FMRI:_svcs_fmri -i' -} - -_svcprop "$@" - -# vi:tw=0 +_arguments -s \ + '-f[designate properties by their FMRI]' \ + '-q[quiet]' \ + '-t[use multi-property output format]' \ + '-v[verbose]' \ + - set1 \ + '-w[wait for the selected property or property group to change]' \ + '-p[print values of named property or property group]' \ + ':FMRI:_svcs_fmri -i' \ + - set2 \ + '-a[display all properties]' \ + '-g[group type filter]:group type' \ + '*-l[properties from a layer]:layer:(admin site-profile system-profile manifest)' \ + '(-c -s)-C[retrieve properties without composition]' \ + '(-C -s)-c[retrieve properties with composition]' \ + '(-c -C)-s[retrieve properties from snapshot]:snapshot' \ + '*-p[print values of named property or property group]' \ + '*:FMRI:_svcs_fmri -i' diff --git a/Completion/Solaris/Command/_zlogin b/Completion/Solaris/Command/_zlogin index 74cbafe82..142114302 100644 --- a/Completion/Solaris/Command/_zlogin +++ b/Completion/Solaris/Command/_zlogin @@ -1,20 +1,16 @@ #compdef zlogin # Synced with the Nevada build 162 man page -_zlogin() { - local -a _comp_priv_prefix - _arguments -s \ - '-E[Disable escape character]' \ - '-e[Specify escape character]:character:' \ - '-l[Specify username]:username:_users' \ - ':zonename:_zones' \ - - set1 \ - '-C[Connect to zone console]' \ - '-d[Disconnect on zone halt]' \ - - set2 \ - '-S["Safe" login mode]' \ - '(-):command name: _command_names -e' \ - '*::utility: _normal' -} - -_zlogin "$@" +local -a _comp_priv_prefix +_arguments -s \ + '-E[disable escape character]' \ + '-e[specify escape character]:character' \ + '-l[specify username]:username:_users' \ + ':zonename:_zones' \ + - set1 \ + '-C[connect to zone console]' \ + '-d[disconnect on zone halt]' \ + - set2 \ + '-S["safe" login mode]' \ + '(-):command name: _command_names -e' \ + '*::utility: _normal' diff --git a/Completion/Unix/Command/_pkginfo b/Completion/Unix/Command/_pkginfo index 6c71082ef..eca9e057e 100644 --- a/Completion/Unix/Command/_pkginfo +++ b/Completion/Unix/Command/_pkginfo @@ -1,22 +1,18 @@ #compdef pkginfo -_pkginfo() { - _arguments -s \ - '(-q -r -x)-l[long listing]' \ - '(-l -r -x)-q[quiet mode]' \ - '(-l -q -x)-r[relocation base]' \ - '(-l -q -r)-x[extracted listing]' \ - '-c[category]:category: ' \ - '-a[architecture]:architecture: ' \ - '-v[version]:version: ' \ - - set1 \ - '(-p)-i[select completely installed packages]' \ - '(-i)-p[select partially installed packages]' \ - '-R[root path]:root path:_files -/' \ - '*:package instance:_pkg_instance --_opts installed:set1--R' \ - - set2 \ - '-d[device]:device file:_files' \ - '*:package instance:_pkg_instance --_opts uninstalled:set2--d' -} - -_pkginfo "$@" +_arguments -s \ + '(-q -r -x)-l[long listing]' \ + '(-l -r -x)-q[quiet mode]' \ + '(-l -q -x)-r[relocation base]' \ + '(-l -q -r)-x[extracted listing]' \ + '-c[category]:category' \ + '-a[architecture]:architecture' \ + '-v[version]:version' \ + - set1 \ + '(-p)-i[select completely installed packages]' \ + '(-i)-p[select partially installed packages]' \ + '-R[root path]:root path:_files -/' \ + '*:package instance:_pkg_instance --_opts installed:set1--R' \ + - set2 \ + '-d[device]:device file:_files' \ + '*:package instance:_pkg_instance --_opts uninstalled:set2--d' diff --git a/Completion/Unix/Command/_pkgrm b/Completion/Unix/Command/_pkgrm index 25a950221..1191a2d1f 100644 --- a/Completion/Unix/Command/_pkgrm +++ b/Completion/Unix/Command/_pkgrm @@ -1,20 +1,16 @@ #compdef pkgrm -_pkgrm() { - _arguments -s \ - '-Y[select packages by category]:category: ' \ - - set1 \ - '-n[non-interactive mode]' \ - '-v[trace all scripts]' \ - '-a[admin file]:admin file:_files' \ - "-A[force removal of all files]" \ - "-M[don't use vfstab file]" \ - '-R[root path]:root path:_files -/' \ - '-V[alternate vfstab file]:vfstab file:_files' \ - '*:package instance:_pkg_instance --_opts installed:set1--R' \ - - set2 \ - '-s[spool package]:spool directory:_files -/' \ - '*:package instance:_pkg_instance --_opts spooled:set2--s' -} - -_pkgrm "$@" +_arguments -s \ + '-Y[select packages by category]:category' \ + - set1 \ + '-n[non-interactive mode]' \ + '-v[trace all scripts]' \ + '-a[admin file]:admin file:_files' \ + "-A[force removal of all files]" \ + "-M[don't use vfstab file]" \ + '-R[root path]:root path:_files -/' \ + '-V[alternate vfstab file]:vfstab file:_files' \ + '*:package instance:_pkg_instance --_opts installed:set1--R' \ + - set2 \ + '-s[spool package]:spool directory:_files -/' \ + '*:package instance:_pkg_instance --_opts spooled:set2--s' -- cgit v1.2.3 From 71ff799b3cb78998c0c73b3f40068830dcb1441d Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Mon, 16 Aug 2021 02:44:22 +0300 Subject: 49160: fix quoting for xmllint --pretty completion --- ChangeLog | 5 +++++ Completion/Unix/Command/_xmlsoft | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 7c16bbf29..da95fd927 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-08-16 Oliver Kiddle <opk@zsh.org> + + * 49160: Completion/Unix/Command/_xmlsoft: fix quoting for + xmllint --pretty completion + 2021-08-14 Daniel Shahaf <d.s@daniel.shahaf.name> * users/26734: Doc/Zsh/builtins.yo: docs: read: Notate the diff --git a/Completion/Unix/Command/_xmlsoft b/Completion/Unix/Command/_xmlsoft index 6f7e3b7c9..9f1206988 100644 --- a/Completion/Unix/Command/_xmlsoft +++ b/Completion/Unix/Command/_xmlsoft @@ -98,7 +98,7 @@ case $service in '--format[reformat/reindent the input]' \ '--encode[output in the given encoding]:encoding:(${encoding[@]})' \ '--dropdtd[remove the DOCTYPE of the input docs]' \ - "--pretty[pretty-print in a particular style]:style:((0\:don't\ pretty\ print 1\:reformat 2\:add\ whitespace))" \ + "--pretty[pretty-print in a particular style]:style:((0\:don\'t\ pretty\ print 1\:reformat 2\:add\ whitespace))" \ '--c14n[save in W3C canonical format]' \ '--c14n11[save in W3C canonical format v1.1 (with comments)]' \ '--exc-c14n[save in W3C exclusive canonical format]' \ -- cgit v1.2.3 From 78961f8870e9b665076cb28bf1bc71d0f9641dca Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Mon, 16 Aug 2021 02:44:49 +0300 Subject: 49268: use an empty string search to find matches for info --index-search= completion Also include info output to the right of " -- " for further info node completion matches and fix quoting of a blank argument to _call_program. --- ChangeLog | 3 +++ Completion/Unix/Command/_texinfo | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index da95fd927..09bfe7839 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-08-16 Oliver Kiddle <opk@zsh.org> + * 49268: Completion/Unix/Command/_texinfo: use an empty string search + to find matches for info --index-search= completion + * 49160: Completion/Unix/Command/_xmlsoft: fix quoting for xmllint --pretty completion diff --git a/Completion/Unix/Command/_texinfo b/Completion/Unix/Command/_texinfo index b356ddbe7..7dfa32e45 100644 --- a/Completion/Unix/Command/_texinfo +++ b/Completion/Unix/Command/_texinfo @@ -36,14 +36,14 @@ local -A opt_args infodirs case $service in info) cmd=${words[1]} - _arguments -C -s \ + _arguments -C -s -S \ '(-a --all)'{-a,--all}'[use all matching manuals]' \ '(: -)'{-k+,--apropos=}'[look up string in indices]:search string: ' \ \*{-d+,--directory=}'[add directory to infopath]:info dir:_files -/' \ '--dribble=[record keystrokes]:file with keystrokes:_files' \ '(-f --file 1)'{-f+,--file=}'[specify Info manual to visit]:info manual:->infofiles' \ '(: - -h --help)'{-h,--help}'[display usage]' \ - '(-o --output -O)--index-search=[go directly to node if found]:search string: ' \ + '(-o --output -O)--index-search=[search for matching index entry]:search string:->index-entries' \ '(--index-search -o --output -O)'{-o+,--output=}'[dump selected nodes to filename]:filename:_files -g "*(-.)"' \ '--init-file=[specify initialisation file]:file:_files' \ '(-n --node)'{-n+,--node=}'[specify nodes in first visited Info file]:node:->nodes' \ @@ -301,6 +301,13 @@ if [[ -n $state ]]; then tags+=( info-nodes ) fi items=( ${${${(M)${(f)"$(_call_program menu-items info -o- $file)"}:#(#s)\* *::*}%%::*}#??} ) + elif [[ $state = index-entries ]]; then + if [[ -n $file ]]; then + tags=( index-entries ) + items=( ${${${(M)${(f)"$(_call_program index-entries info -o- --all --index-search= $file)"}:#(#s)\* *:*}%%:*}#??} ) + else + _message -e index-entries $state_descr + fi fi _tags $tags @@ -308,6 +315,7 @@ if [[ -n $state ]]; then while _tags; do _requested info-files expl 'info file' compadd $suf -M 'm:{a-zA-Z}={A-Za-z}' -a files && ret=0 _requested menu-items expl 'menu item' compadd -M 'm:{a-zA-Z}={A-Za-z}' -a items && ret=0 + _requested -x index-entries expl 'index entry' compadd -M 'm:{a-zA-Z}={A-Za-z}' -a items && ret=0 _requested info-nodes expl 'node' compadd -M 'm:{a-zA-Z}={A-Za-z}' ${nodes#*:} && ret=0 (( ret )) || break -- cgit v1.2.3 From cd89e1937daa9dcfa6b372ec56018904c0f34581 Mon Sep 17 00:00:00 2001 From: DCsunset <DCsunset@users.noreply.github.com> Date: Wed, 18 Aug 2021 13:37:12 -0400 Subject: github #78: Fix completions in _pandoc --- ChangeLog | 5 +++++ Completion/Unix/Command/_pandoc | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 09bfe7839..3d1a97e41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-08-24 dana <dana@dana.is> + + * github #78: DCsunset: Completion/Unix/Command/_pandoc: Fix + completions in _pandoc + 2021-08-16 Oliver Kiddle <opk@zsh.org> * 49268: Completion/Unix/Command/_texinfo: use an empty string search diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index 98e5abc70..e694606c0 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -183,7 +183,7 @@ _arguments -s \ {-t+,-w+,--to=,--write=}'[specify output format]: :_pandoc_format -T output' \ {-o+,--output=}'[write output to FILE instead of stdout]:file:_files' \ '--data-dir=[specify the user data directory to search for pandoc data files]:data directory:_files -/' \ - {-d+,--defauls=}'[read default from YAMAL file]: :_pandoc_defaults_file' \ + {-d+,--defaults=}'[read default from YAML file]: :_pandoc_defaults_file' \ '--shift-heading-level-by=[shift heading levels by specified number]:positive or negative integer: ' \ '!--base-header-level=:number [1]:(1 2 3 4 5)' \ '!--strip-empty-paragraphs[deprecated. Use the +empty_paragraphs extension instead]' \ @@ -193,7 +193,7 @@ _arguments -s \ {\*-F+,\*--filter=}'[specify an executable to be used as a filter transforming the pandoc AST after the input is parsed and before the output is written]: :_pandoc_filter' \ {\*-L+,\*--lua-filter=}"[transform the document by using pandoc's built-in lua filtering system]: :_pandoc_lua_filter" \ {\*-M+,\*--metadata=}'[set the metadata field KEY to the value VALUE]:key\:value: ' \ - '*--metadata_file=[read metadata from file]:YAML or JSON file:_files' \ + '*--metadata-file=[read metadata from file]:YAML or JSON file:_files' \ {-p,--preserve-tabs}'[preserve tabs instead of converting them to spaces]' \ '--tab-stop=[specify the number of spaces per tab]:spaces [4]' \ '--track-changes=[specifies what to do with insertions, deletions, and comments produced by the MS Word "Track Changes" feature]: :_pandoc_track_changes' \ @@ -264,7 +264,7 @@ _arguments -s \ '--verbose[give verbose debugging output]' \ '--quiet[suppress warning messages]' \ '--fail-if-warnings[exit with error status if there are any warnings]' \ - '--log=[write log messages in machine-readable JSON format to FILE]:file:_file' \ + '--log=[write log messages in machine-readable JSON format to FILE]:file:_files' \ '(- :)--bash-completion[generate a bash completion script]' \ '(- :)--list-input-formats[list supported input formats, one per line]' \ '(- :)--list-output-formats[list supported output formats, one per line]' \ -- cgit v1.2.3 From 5ef55de65ef6f9cac6297bc8c5f87c1a109cc7e1 Mon Sep 17 00:00:00 2001 From: Štěpán Němec <stepnem@gmail.com> Date: Tue, 27 Jul 2021 00:10:50 +0200 Subject: 49234: add missing options in python completion --- ChangeLog | 5 +++++ Completion/Unix/Command/_python | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index f558bd47c..88537d383 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-08-27 Oliver Kiddle <opk@zsh.org> + + * Štěpán Němec: 49234: Completion/Unix/Command/_python: + add missing options in python completion + 2021-08-26 Peter Stephenson <p.w.stephenson@ntlworld.com> * 49307 with documentation updated: Src/exec, diff --git a/Completion/Unix/Command/_python b/Completion/Unix/Command/_python index f10106f9b..e5bac18bb 100644 --- a/Completion/Unix/Command/_python +++ b/Completion/Unix/Command/_python @@ -1,7 +1,7 @@ #compdef -P python[0-9.]# # Python 2.7 -# Python 3.4 +# Python 3.9 local curcontext="$curcontext" state state_descr line typeset -A opt_args @@ -11,7 +11,9 @@ if _pick_variant python3=Python\ 3 python2 --version; then args=( '(-bb)-b[issue warnings about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str]' '(-b)-bb[issue errors about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str]' + '--check-hash-based-pycs[configure how Python evaluates up-to-dateness of hash-based .pyc files]:mode:(always default never)' "-I[isolate Python from the user's environment]" + '-q[do not print version and copyright messages]' '-X[set implementation-specific option]:option' ) else @@ -37,7 +39,8 @@ _arguments -C -s -S "$args[@]" \ "-s[don't add user site directory to sys.path]" \ "-S[don't imply 'import site' on initialization]" \ '-u[unbuffered binary stdout and stderr]' \ - '-v[verbose (trace import statements)]' \ + '(-vv)-v[trace module initialization and cleanup]' \ + '(-v)-vv[in addition to -v, trace all files checked when searching for a module]' \ '(1 * -)-V[display version information]' \ '-W+[warning control]:warning filter (action\:message\:category\:module\:lineno):(default always ignore module once error)' \ '-x[skip first line of source, allowing use of non-Unix forms of #!cmd]' \ -- cgit v1.2.3 From 76de0b05dad2d097979e61749efd0e784644cc47 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Sun, 29 Aug 2021 16:55:25 +0200 Subject: 49315: list units in brackets at the end of group descriptions --- ChangeLog | 11 +++++++++++ Completion/Debian/Command/_dak | 2 +- Completion/Linux/Command/_tpb | 2 +- Completion/Mandriva/Command/_urpmi | 2 +- Completion/Unix/Command/_cpio | 10 +++++----- Completion/Unix/Command/_dropbox | 4 ++-- Completion/Unix/Command/_growisofs | 2 +- Completion/Unix/Command/_mysql_utils | 4 ++-- Completion/Unix/Command/_perforce | 10 +++++----- Completion/Unix/Command/_transmission | 18 ++++++------------ Completion/X/Command/_urxvt | 4 ++-- 11 files changed, 37 insertions(+), 32 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 027408981..04ca8e172 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2021-08-29 Oliver Kiddle <opk@zsh.org> + + * 49315: Completion/Unix/Command/_transmission, + Completion/Debian/Command/_dak, Completion/Linux/Command/_tpb, + Completion/Mandriva/Command/_urpmi, Completion/Unix/Command/_cpio, + Completion/Unix/Command/_dropbox, Completion/X/Command/_urxvt, + Completion/Unix/Command/_growisofs, + Completion/Unix/Command/_perforce, + Completion/Unix/Command/_mysql_utils: + list units in brackets at the end of group descriptions + 2021-08-28 Peter Stephenson <p.w.stephenson@ntlworld.com> * Peter A. Castro: users/26982 (subset as most of this already diff --git a/Completion/Debian/Command/_dak b/Completion/Debian/Command/_dak index 8ecfd84b3..9976c7371 100644 --- a/Completion/Debian/Command/_dak +++ b/Completion/Debian/Command/_dak @@ -207,7 +207,7 @@ case $cmd in (poolize) args+=( - '(-l --limit)'{-l,--limit=}'[only migrate amount of packages]:amount in kb:' + '(-l --limit)'{-l,--limit=}'[only migrate amount of packages]:amount (kb)' '(-n --no-action)'{-n,--no-action}'[do not do anything]' '(-v --verbose)'{-v,--verbose}'[explain what is being done]' ) diff --git a/Completion/Linux/Command/_tpb b/Completion/Linux/Command/_tpb index c4c4c2bbd..2bdee0942 100644 --- a/Completion/Linux/Command/_tpb +++ b/Completion/Linux/Command/_tpb @@ -9,7 +9,7 @@ _arguments \ '(-x --xevents)'{-x,--xevents=}':state:(on off)' \ '(-m --mixer)'{-m,--mixer=}':state:(on off)' \ '(-o --osd)'{-o,--osd=}':state:(on off)' \ - '(-p --poll)'{-p,--poll=}':delay in microseconds:' \ + '(-p --poll)'{-p,--poll=}':delay (microseconds)' \ '(-t --thinkpad)'{-t,--thinkpad=}':command to execute:_command_names' \ '(-H --home)'{-H,--home=}':command to execute:_command_names' \ '(-S --search)'{-S,--search=}':command to execute:_command_names' \ diff --git a/Completion/Mandriva/Command/_urpmi b/Completion/Mandriva/Command/_urpmi index 9ab9e45b7..be6350129 100644 --- a/Completion/Mandriva/Command/_urpmi +++ b/Completion/Mandriva/Command/_urpmi @@ -73,7 +73,7 @@ _urpmi() { opts_net=( "($help --wget)--curl[use curl to retrieve distant files]" - "($help)--limit-rate[limit the download speed (b/s)]:download speed in b/s: " + "($help)--limit-rate[limit the download speed]:download speed (b/s)" "($help)--proxy:proxy host:_hosts" "($help)--proxy-user:proxy user:_users" "($help --curl)--wget[use wget to retrieve distant files]" diff --git a/Completion/Unix/Command/_cpio b/Completion/Unix/Command/_cpio index 699b1d8f2..20f8c712d 100644 --- a/Completion/Unix/Command/_cpio +++ b/Completion/Unix/Command/_cpio @@ -25,15 +25,15 @@ else '--message=:message at end of volume:' '--null' '--reset-access-time' '--verbose' '--dot' '--append' - '--block-size=:block size in 512 byte units:' + '--block-size=:block size (512 byte units)' '--dereference' - '--io-size=:block size in bytes' + '--io-size=:block size (bytes)' '--quiet' '--force-local' '--help' '--version') fi args+=( '-A[append files to archive]' '-B[block size 5120 bytes with special file]' - '-C[set block size per record]:block size in bytes:(8192)' + '-C[set block size per record]:block size (bytes)' '-F[set archive file to use]:archive file:->afile' '(-H)-c[read/write header in ASCII]' "(-c)-H[set format type for archive header]:$fmts" @@ -49,7 +49,7 @@ else '--preserve-modification-time' '--numeric' '--rename' '--list' '--swap-bytes' '--swap-halfwords' '--dot' '--unconditional' '--verbose' - '--block-size=:block size in 512 byte units:' + '--block-size=:block size (512 byte units)' '--swap-halfwords' '--io-size=:block size in bytes:' '--pattern-file=:file with list of patterns:_files' @@ -63,7 +63,7 @@ else '-b[reverse bytes in word]' '-B[block size 5120 bytes with special file]' '-d[create directories as needed]' - '-C[set block size per record]:block size in bytes:(8192)' + '-C[set block size per record]:block size (bytes)' '-E[read filenames from file]:file name for list of files:_files' '-f[only copy files not matching patterns]' '-F[set archive file to use]:archive file:->afile' diff --git a/Completion/Unix/Command/_dropbox b/Completion/Unix/Command/_dropbox index 115f9eb45..45c77ae09 100644 --- a/Completion/Unix/Command/_dropbox +++ b/Completion/Unix/Command/_dropbox @@ -55,8 +55,8 @@ else (throttle) _arguments \ - '2:download limit in KB/s:(unlimited)' \ - '3:upload limit in KB/s:(unlimited)' + '2:download limit (KB/s):(unlimited)' \ + '3:upload limit (KB/s):(unlimited)' ;; (*) diff --git a/Completion/Unix/Command/_growisofs b/Completion/Unix/Command/_growisofs index 8f4da4030..206d2c2c7 100644 --- a/Completion/Unix/Command/_growisofs +++ b/Completion/Unix/Command/_growisofs @@ -270,7 +270,7 @@ else '-sort[sort files on the image based on weights defined in the given file]:sort-weighting file:_files' \ '-sparc-label[set the sun disk-label-name used for the -sparc-boot option]:label' \ '-split-output[split the output image into several files ~1GiB in size]' \ - '-stream-media-size[enable streaming operation and set media size to given number of sectors]:media size in sectors' \ + '-stream-media-size[enable streaming operation and set media size to given number of sectors]:media size (sectors)' \ '-stream-file-name[reserved for future use]:name' \ '-sunx86-boot[specify a comma-separated list of file-system images needed to make a bootable Solaris-x86-CD]:list' \ '-sunx86-label[specify the SVr4 disk-label-name for the SVr4 disk-label created with the -sunx86-boot option]:label' \ diff --git a/Completion/Unix/Command/_mysql_utils b/Completion/Unix/Command/_mysql_utils index a7b285f1c..9f70687b0 100644 --- a/Completion/Unix/Command/_mysql_utils +++ b/Completion/Unix/Command/_mysql_utils @@ -220,8 +220,8 @@ _mysql_utils() { ) _mysql_variables_opts=( - '--max_allowed_packet[maximum allowed packet size]:packet size in bytes' - '--net_buffer_length[network buffer length]:buffer length in bytes' + '--max_allowed_packet[maximum allowed packet size]:packet size (bytes)' + '--net_buffer_length[network buffer length]:buffer length (bytes)' '--connect_timeout:timeout' '--select_limit:limit' '--max_join_size:size' diff --git a/Completion/Unix/Command/_perforce b/Completion/Unix/Command/_perforce index cb6cdb79f..a52ac1d06 100644 --- a/Completion/Unix/Command/_perforce +++ b/Completion/Unix/Command/_perforce @@ -2668,12 +2668,12 @@ _perforce_cmd_passwd() { _perforce_cmd_ping() { _arguments -s : \ '-c[specify count of messages]:count of messages: ' \ - '-t[specify total time of test]:time in seconds: ' \ + '-t[specify total time of test]:time (seconds)' \ '-i[specify iterations for test]:number of iterations: ' \ '-f[transmit continuously without waiting for responses]' \ - '-p[specify pause between tests]:pause in seconds: ' \ - '-s[specify send size]:send size in octets: ' \ - '-r[specify receive size]:receive size in octets: ' + '-p[specify pause between tests]:pause (seconds)' \ + '-s[specify send size]:send size (octets)' \ + '-r[specify receive size]:receive size (octets)' } @@ -2942,7 +2942,7 @@ _perforce_cmd_status() { _perforce_cmd_sizes() { _arguments -s : \ '-a[list all revisions in range]' \ - '-b[specify blocksize]:blocksize in bytes: ' \ + '-b[specify blocksize]:blocksize (bytes)' \ '(-H)-h[print sizes in human-readable form (GiB)]' \ '(-h)-H[print sizes in human-readable form (GB)]' \ '-m[limit max files]:max files: ' \ diff --git a/Completion/Unix/Command/_transmission b/Completion/Unix/Command/_transmission index 8951eacb0..c060cbae3 100644 --- a/Completion/Unix/Command/_transmission +++ b/Completion/Unix/Command/_transmission @@ -13,10 +13,10 @@ local general_options=( ) # `general_actions`: *actions* that can be specified when a specific set of torrents is either specified or either not local general_actions=( - '(- :)'{-gsr,--global-seedratio}'[all torrents, unless overridden by a per-torrent setting, should seed until a specific ratio]:ratio:{_message "ratio in kB/sec"}' + '(- :)'{-gsr,--global-seedratio}'[all torrents, unless overridden by a per-torrent setting, should seed until a specific ratio]:ratio (kB/s)' '(- :)'{-GSR,--no-global-seedratio}'[all torrents, unless overridden by a per-torrent setting, should seed regardless of ratio]' '(- :)'{-pr,--peers}'[set the maximum number of peers]:number: ' - '(- :)'{-d+,--downlimit=}'[limit the maximum download speed to limit kB/s]:limit:{_message "limit in kB/sec"}' + '(- :)'{-d+,--downlimit=}'[limit the maximum download speed to limit kB/s]:limit (kB/s)' '(- :)'{-D,--no-downlimit}'[disable download speed limits]' ) # `global_only_actions`: *actions* that can be specified only when no specific torrent is specified @@ -27,8 +27,8 @@ local global_only_actions=( '(- :)'{-asu,--alt-speed-uplimit}'[limit the alternate upload speed to limit kilobytes per second]' '(- :)'{-asc,--alt-speed-scheduler}'[use the scheduled on/off times]' '(- :)'{-asc,--not-alt-speed-scheduler}'[don'"'"'t use the scheduled on/off times]' - '(- :)--alt-speed-time-begin[time to start using the alt speed limits]:hhmm:_transmission-remote_time' - '(- :)--alt-speed-time-end[time to stop using the alt speed limits]:hhmm:_transmission-remote_time' + '(- :)--alt-speed-time-begin[time to start using the alt speed limits]:time (HHMM)' + '(- :)--alt-speed-time-end[time to stop using the alt speed limits]:time (HHMM)' '(- :)--alt-speed-days[set the number of days on which to enable the speed scheduler]:days:_transmission-remote_days' '(- :)--torrent-done-script[specify a file to run each time a torrent finishes]:script:_files' '(- :)--no-torrent-done-script[don'"'"'t run any script when a torrent finishes]' @@ -51,7 +51,7 @@ local global_only_actions=( '(- :)'{-M,--no-portmap}'[disable portmapping]' '(- :)'{-o,--dht}'[enable distributed hash table]' '(- :)'{-O,--no-dht}'[disable distributed hash table]' - '(- :)'{-u,--uplimit}'[limit the maximum upload speed to limit kB/s]:limit:{_message "limit in kB/sec"}' + '(- :)'{-u,--uplimit}'[limit the maximum upload speed to limit kB/s]:limit (kB/s)' '(- :)'{-U,--no-uplimit}'[disable upload speed limits]' '(- :)--utp[enable uTP for peer connections]' '(- :)--no-utp[disable uTP for peer connections]' @@ -89,7 +89,7 @@ local torrent_action_only_actions=( {-rad,--remove-and-delete}'[remove the current torrent(s) and delete the downloaded data]' '--reannounce[reannounce the current torrent(s)]' '--move[move the current torrents'"'"' data from their current locations to the specified directory]:{_files -/}' - {-sr+,--seedratio=}'[let the current torrent(s) seed until a specific ratio]:ratio:{_message "ratio in kB/sec"}' + {-sr+,--seedratio=}'[let the current torrent(s) seed until a specific ratio]:ratio' {-SR,--no-seedratio}'[let the current torrent(s) use the global seedratio settings]' {-hl,--honor-session}'[make the current torrent(s) honor the session limits]' {-HL,--no-honor-session}'[make the current torrent(s) not honor the session limits]' @@ -104,12 +104,6 @@ local torrent_action_only_actions=( # helper functions -# complete argument specified after global only action: `--alt-speed-time-begin` -# completes time in HHMM format -(( $+functions[_transmission-remote_time] )) || -_transmission-remote_time(){ - _message "time in format HHMS" -} # complete argument specified after global only action: `--alt-speed-days` # completes days in a list such as "2,4-6". (( $+functions[_transmission-remote_days] )) || diff --git a/Completion/X/Command/_urxvt b/Completion/X/Command/_urxvt index 661897c3a..2d7c09579 100644 --- a/Completion/X/Command/_urxvt +++ b/Completion/X/Command/_urxvt @@ -43,8 +43,8 @@ _x_arguments \ '-sl:save lines' \ '-embed:window id to embed terminal in:_x_window' \ '-pty-fd:file descriptor of pty to use' \ - '-w:external border in pixels' \ - '-b:internal border in pixels' \ + {-bw,-w}':external border (pixels)' \ + '-b:internal border (pixels)' \ '-lsp:number of extra pixels between rows' \ '-letsp:letter spacing adjustment' \ '-mod:meta modifier:_x_modifier' \ -- cgit v1.2.3 From f529d54f43bdf277be157b5638d89f81cb93a2ee Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Sun, 29 Aug 2021 17:00:05 +0200 Subject: 49316: add (-.) glob qualifier to globs where only files are applicable --- ChangeLog | 5 +++++ Completion/Unix/Command/_bittorrent | 2 +- Completion/Unix/Command/_go | 2 +- Completion/Unix/Command/_pandoc | 20 ++++++++++---------- Completion/Unix/Command/_transmission | 2 +- Completion/X/Command/_pdftk | 6 ++---- 6 files changed, 20 insertions(+), 17 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 04ca8e172..1bd7f511a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2021-08-29 Oliver Kiddle <opk@zsh.org> + * 49316: Completion/Unix/Command/_transmission, + Completion/Unix/Command/_bittorrent, Completion/Unix/Command/_go, + Completion/Unix/Command/_pandoc, Completion/X/Command/_pdftk: + add (-.) glob qualifier to globs where only files are applicable + * 49315: Completion/Unix/Command/_transmission, Completion/Debian/Command/_dak, Completion/Linux/Command/_tpb, Completion/Mandriva/Command/_urpmi, Completion/Unix/Command/_cpio, diff --git a/Completion/Unix/Command/_bittorrent b/Completion/Unix/Command/_bittorrent index 1f305a1c0..1fbab35ef 100644 --- a/Completion/Unix/Command/_bittorrent +++ b/Completion/Unix/Command/_bittorrent @@ -69,7 +69,7 @@ case $service in '--piece_size_pow2+[specify power of 2 to set the piece size to]:power:' \ "--comment+[specify human-readable comment to put in .torrent]:comment:"\ "--target+[specify target file for the torrent]:file:_files"\ - ':file:_files -g "*"' + ':file:_files' return ;; diff --git a/Completion/Unix/Command/_go b/Completion/Unix/Command/_go index 30a2bf88f..0b4b16dfa 100644 --- a/Completion/Unix/Command/_go +++ b/Completion/Unix/Command/_go @@ -15,4 +15,4 @@ case $service in ;; esac -_wanted files expl "input file" _files -g "$pat" +_wanted files expl "input file" _files -g "$pat(-.)" diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index e694606c0..464859655 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -67,7 +67,7 @@ _pandoc_template(){ local format=${${(v)opt_args[(i)(-t|--to|-w|--write)]}%%(+|-)*} [[ -z $format ]] && format=${(v)opt_args[(i)(-o|--output)]:e} local pat="'*'" # or '*.*' ? - [[ -n $format ]] && pat="'*.$format'" + [[ -n $format ]] && pat="'*.$format(-.)'" local template_dir=$(_pandoc_default_dir)/templates _alternative \ "local-templates:local template:_files -g $pat" \ @@ -80,7 +80,7 @@ _pandoc_template(){ _pandoc_highlight_style(){ _alternative \ 'styles:style:( $(pandoc --list-highlight-styles) )' \ - 'style-files:style file:_files -g "*.theme"' + 'style-files:style file:_files -g "*.theme(-.)"' } # filter file in $PWD, data-dir/filters/ or $PATH @@ -98,8 +98,8 @@ _pandoc_filter(){ _pandoc_lua_filter(){ local filters_dir=$(_pandoc_default_dir)/filters _alternative \ - 'local-filters:local filter:_files -g "*.lua"' \ - 'data-dir-filters:filter in data-dir:_files -W filters_dir -g "*.lua"' + 'local-filters:local filter:_files -g "*.lua(-.)"' \ + 'data-dir-filters:filter in data-dir:_files -W filters_dir -g "*.lua(-.)"' } # default file in $PWD or data-dir/defaults/ @@ -107,8 +107,8 @@ _pandoc_lua_filter(){ _pandoc_defaults_file() { local defaults_dir=$(_pandoc_default_dir)/defaults _alternative \ - 'local-defaults:default file:_files -g "*.yaml"' \ - 'data-dir-defaults:default in data-dir:_files -W defaults_dir -g "*.yaml"' + 'local-defaults:default file:_files -g "*.yaml(-.)"' \ + 'data-dir-defaults:default in data-dir:_files -W defaults_dir -g "*.yaml(-.)"' } # choose reference location @@ -214,7 +214,7 @@ _arguments -s \ '--no-highlight[disables syntax highlighting for code blocks and inlines]' \ '--highlight-style=[specifies the coloring style to be used in highlighted source code]:style|file:_pandoc_highlight_style' \ '(- :)--print-highlight-style=[prints a JSON version of a highlighting style]: :_pandoc_highlight_style' \ - '--syntax-definition=[load a KDE XML syntax definition file]:file:{_files -g "*.xml"}' \ + '--syntax-definition=[load a KDE XML syntax definition file]:file:_files -g "*.xml(-.)"' \ {\*-H+,\*--include-in-header=}'[include contents of FILE, verbatim, at the end of the header, implies --standalone]:file:_files' \ {\*-B+,\*--include-before-body=}'[include contents of FILE, verbatim, at the beginning of the document body, implies --standalone]:file:_files' \ {\*-A+,\*--include-end-body=}'[include contents of FILE, verbatim, at the end of the document body, implies --standalone]:file:_files' \ @@ -242,14 +242,14 @@ _arguments -s \ '--reference-doc=[use the specified file as a style reference in producing a docx or ODT file]:file: ' \ '--epub-subdirectory=[specify the subdirectory in the OCF container that is to hold the EPUB-specific contents]:directory:_files -/' \ '--epub-cover-image=[use the specified image as the EPUB cover]:file:_files' \ - '--epub-metadata=[look in the specified XML file for metadata for the EPUB]:file:{_files -g "*.xml"}' \ + '--epub-metadata=[look in the specified XML file for metadata for the EPUB]:file:_files -g "*.xml(-.)"' \ '*--epub-embed-font=[embed the specified font in the EPUB]:file:_files ' \ '--epub-chapter-level=[specify the header level at which to split the EPUB into separate "chapter" files]:number:(1 2 3 4 5 6)' \ '--ipynb-output=[specify how to tread ipynb output cells]:method:(all none best)' \ '--pdf-engine=[use the specified engine when producing PDF output]:program:_pandoc_pdf_engine' \ '*--pdf-engine-opt=[use the given string as a command-line argument to the pdf-engine]:string:_pandoc_pdf_engine_opts' \ - '*--bibliography=[set the bibliography field in the document'"'"'s metadata to FILE]:file:{_files -g "*.(bib|bibtex|copac|json|yaml|enl|xml|wos|medline|mods|ris)"}' \ - '--csl=[set the csl field in the document'"'"'s metadata to FILE]:file:{_files -g "*.csl"}' \ + "*--bibliography=[set the bibliography field in the document's metadata to specified file]:file:_files -g '*.(bib|bibtex|copac|json|yaml|enl|xml|wos|medline|mods|ris)(-.)'" \ + "--csl=[set the csl field in the document's metadata to specified file]:file:_files -g '*.csl(-.)'" \ '--citation-abbreviations=[set the citation-abbreviations field in the document'"'"'s metadata to FILE]:file:_files' \ '--natbib[use natbib for citations in LaTeX output]' \ '--biblatex[use biblatex for citations in LaTeX output]' \ diff --git a/Completion/Unix/Command/_transmission b/Completion/Unix/Command/_transmission index c060cbae3..9b7309fe2 100644 --- a/Completion/Unix/Command/_transmission +++ b/Completion/Unix/Command/_transmission @@ -114,7 +114,7 @@ _transmission-remote_days(){ (( $+functions[_transmission-remote_add] )) || _transmission-remote_add(){ _alternative \ - 'args:torrent:_files -g ".torrent"' \ + 'args:torrent:_files -g ".torrent(-.)"' \ 'args:url:_urls' } # complete torrents diff --git a/Completion/X/Command/_pdftk b/Completion/X/Command/_pdftk index 1ac3223f7..b26deb15f 100644 --- a/Completion/X/Command/_pdftk +++ b/Completion/X/Command/_pdftk @@ -34,13 +34,11 @@ case $words[CURRENT-1] in ;; (fill_form) - _description files expl 'FDF and XFDF file' - _files "$@" $expl -g '(#i)*.(fdf|xfdf)' + _wanted files expl 'FDF or XFDF file' _files -g '(#i)*.(fdf|xfdf)(-.)' ;; ((multibackground|background|stamp|multistamp|output)) - _description files expl 'PDF file' - _files "$@" $expl -g '(#i)*.pdf' + _pdf ;; (update_info) -- cgit v1.2.3 From 12676c0f9fd670556a81625f23205d832a95fb17 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Sun, 29 Aug 2021 17:05:39 +0200 Subject: 49317: cleanup inappropriate use of {...} specs with _arguments or _alternative --- ChangeLog | 5 ++++ Completion/Unix/Command/_gcore | 2 +- Completion/Unix/Command/_luarocks | 48 +++++++++++++++++------------------ Completion/Unix/Command/_pandoc | 4 +-- Completion/Unix/Command/_transmission | 6 ++--- 5 files changed, 35 insertions(+), 30 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 1bd7f511a..b4da80748 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2021-08-29 Oliver Kiddle <opk@zsh.org> + * 49317: Completion/Unix/Command/_transmission, + Completion/Unix/Command/_gcore, Completion/Unix/Command/_pandoc, + Completion/Unix/Command/_luarocks: cleanup inappropriate use + of {...} specs with _arguments or _alternative + * 49316: Completion/Unix/Command/_transmission, Completion/Unix/Command/_bittorrent, Completion/Unix/Command/_go, Completion/Unix/Command/_pandoc, Completion/X/Command/_pdftk: diff --git a/Completion/Unix/Command/_gcore b/Completion/Unix/Command/_gcore index 913ef25ca..a31a81267 100644 --- a/Completion/Unix/Command/_gcore +++ b/Completion/Unix/Command/_gcore @@ -55,7 +55,7 @@ case $OSTYPE in '-v[report progress on the dump as it proceeds]' \ '-b+[specify maximum size of core file]:size (MiB): ' \ '(-c)-o+[write core file to specified file]:file:_files' \ - '(-o)-c+[specify format of core file name]:format:{_message "%%N\:program name, %%U\:uid, %%P\:pid, %%T\:time stamp"}' \ + '(-o)-c+[specify format of core file name]:format (%%N\:program name, %%U\:uid, %%P\:pid, %%T\:time stamp)' \ '1:pid:_pids' ;; *) diff --git a/Completion/Unix/Command/_luarocks b/Completion/Unix/Command/_luarocks index 0915765dc..42169c22a 100644 --- a/Completion/Unix/Command/_luarocks +++ b/Completion/Unix/Command/_luarocks @@ -34,8 +34,8 @@ local option_deps_modes='--deps-mode=[specify how to handle dependencies]:mode:_ local rockspec_options=( '--license=[specify a license string]:license (e.g. "MIT/X11" or "GNU GPL v3")' - '--summary=[a short one-line description summary]:summary:{_message -e "short summary of the rock"}' - '--detailed=[a longer description string]:detailed_text:{_message -e "detailed description of the rock"}' + '--summary=[a short one-line description summary]:summary' + '--detailed=[a longer description string]:detailed description' '--homepage=[project homepage]:URL:_urls' '--lua-versions=[specify supported Lua versions]:lua version:_sequence compadd - 5.{1,2,3,4}' '--rockspec-format=[rockspec format version, such as "1.0" or "1.1"]:VER: ' @@ -321,7 +321,7 @@ __luarocks_rock(){ continue ;; (rockpack) - alts+=(':rock file:{_files -g "*.src.rock(-.)"}') + alts+=( ':rock file:_files -g "*.src.rock(-.)"' ) shift 1 continue ;; @@ -332,7 +332,7 @@ __luarocks_rock(){ ;; (installed) tree="$2" - alts+=(":local rock:{__luarocks_installed_rocks ${tree}}") + alts+=(":local rock: __luarocks_installed_rocks ${tree}") if [[ -z "${tree}" ]]; then shift else @@ -364,7 +364,7 @@ __luarocks_git_tags(){ local make_command_options=( '--pack-binary-rock[produce a .rock file with the contents of compilation inside the current directory instead of installing it]' '--keep[do not remove previously installed versions of the rock after building a new one]' - '--branch=[override the `source.branch` field in the loaded rockspec]:NAME:{_message "branch name"}' + '--branch=[override the `source.branch` field in the loaded rockspec]:branch name' ) local build_command_options=( "${make_command_options[@]}" @@ -375,8 +375,8 @@ local build_command_options=( _luarocks_build(){ _arguments -A "-*" \ "${build_command_options[@]}" \ - '1: :{__luarocks_rock "rockspec" "external"}' \ - '2:: :{__luarocks_rock_version "external_or_local"}' + '1: : __luarocks_rock "rockspec" "external"' \ + '2:: : __luarocks_rock_version "external_or_local"' } # arguments: # - must: option @@ -402,7 +402,7 @@ local doc_command_options=( _luarocks_doc(){ _arguments \ "${doc_command_options[@]}" \ - "1: :{__luarocks_rock installed ${opt_args[--tree]}}" + "1: : __luarocks_rock installed ${opt_args[--tree]}" } # arguments: # - must: external only rockspec @@ -416,14 +416,14 @@ local download_command_options=( _luarocks_download(){ _arguments -A "-*" \ "${download_command_options[@]}" \ - '1: :{__luarocks_rock "external"}' \ - '2:: :{__luarocks_rock_version "external_or_local"}' + '1: : __luarocks_rock "external"' \ + '2:: : __luarocks_rock_version "external_or_local"' } # arguments: # must: luarocks sub command (( $+functions[_luarocks_help] )) || _luarocks_help(){ - _arguments '1: :__luarocks_command' + _arguments '1: : __luarocks_command' } (( $+functions[_luarocks_init] )) || @@ -446,7 +446,7 @@ _luarocks_install(){ # - must: rockspec file (first and last) (( $+functions[_luarocks_lint] )) || _luarocks_lint(){ - _arguments '1:: :{__luarocks_rock "rockspec"}' + _arguments '1:: : __luarocks_rock "rockspec"' } # arguments: # NOTE: receives only options @@ -463,7 +463,7 @@ _luarocks_list(){ # NOTE: it's options were already described above. (( $+functions[_luarocks_make] )) || _luarocks_make(){ - _arguments '1:: :{__luarocks_rock "rockspec"}' + _arguments '1:: : __luarocks_rock "rockspec"' } # arguments: # - optional: .rockspec file / external rock @@ -476,8 +476,8 @@ local new_version_command_options=( _luarocks_new_version(){ _arguments -A "-*" \ "${new_version_command_options[@]}" \ - '1:: :{__luarocks_rock "external" "rockspec"}' \ - '2:: :{__luarocks_rock_version "external_or_local"}' \ + '1:: : __luarocks_rock "external" "rockspec"' \ + '2:: : __luarocks_rock_version "external_or_local"' \ '3:: :_urls' } # arguments: @@ -524,8 +524,8 @@ local remove_command_options=( _luarocks_remove(){ _arguments -A "-*" \ "${remove_command_options[@]}" \ - "1: :{__luarocks_rock installed ${opt_args[--tree]}}" \ - "2:: :{__luarocks_rock_version installed ${opt_args[--tree]}}" + "1: : __luarocks_rock installed ${opt_args[--tree]}" \ + "2:: : __luarocks_rock_version installed ${opt_args[--tree]}" } # arguments: # - must: string as a search query @@ -558,8 +558,8 @@ local show_command_options=( _luarocks_show(){ _arguments \ "${show_command_options[@]}" \ - "1: :{__luarocks_rock installed "${opt_args[--tree]}"}" \ - "2:: :{__luarocks_rock_version installed ${opt_args[--tree]}}" + "1: : __luarocks_rock installed "${opt_args[--tree]}"" \ + "2:: : __luarocks_rock_version installed ${opt_args[--tree]}" } (( $+functions[_luarocks_test] )) || @@ -567,7 +567,7 @@ _luarocks_test(){ _arguments $option_deps_modes \ '--test-type=[specify the test suite type manually]:test suite type' \ '--reset[regenerate files if they already exist]' \ - '1:rockspec:__luarocks_rock' \ + '1: : __luarocks_rock' \ '*:arg' } @@ -581,7 +581,7 @@ local unpack_command_options=( _luarocks_unpack(){ _arguments \ "${unpack_command_options[@]}" \ - '1: :{__luarocks_rock "rockpack" "external"}' + '1: : __luarocks_rock "rockpack" "external"' } # arguments: # - must: rockspec file @@ -595,7 +595,7 @@ local upload_command_options=( _luarocks_upload(){ _arguments \ "${upload_command_options[@]}" \ - '1: :{__luarocks_rock "rockspec"}' + '1: : __luarocks_rock "rockspec"' } (( $+functions[_luarocks_which] )) || @@ -609,8 +609,8 @@ _luarocks_write_rockspec(){ "${rockspec_options[@]}" \ '--output=[write the rockspec with the given file]:file:_files' \ '--tag=[specify tag to use. Will attempt to extract version number from it]:tag:__git_tag' \ - '1:: :{_message "new rock name"}' \ - '2:: :{__luarocks_rock_version "new_rock"}' \ + '1::new rock name' \ + '2:: : __luarocks_rock_version "new_rock"' \ '3:: :_urls' } diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index 464859655..b0fff80d6 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -187,7 +187,7 @@ _arguments -s \ '--shift-heading-level-by=[shift heading levels by specified number]:positive or negative integer: ' \ '!--base-header-level=:number [1]:(1 2 3 4 5)' \ '!--strip-empty-paragraphs[deprecated. Use the +empty_paragraphs extension instead]' \ - '--indented-code-classes=[classes to use for indented code blocks]:class:{_message "Classes separated with ,"}' \ + '--indented-code-classes=[classes to use for indented code blocks]:class list (comma-separated)' \ '--default-image-extension=[specify a default extension to use when image paths/URLs have no extension]:extension: ' \ '--file-scope[parse each file individually before combining for multifile documents]' \ {\*-F+,\*--filter=}'[specify an executable to be used as a filter transforming the pandoc AST after the input is parsed and before the output is written]: :_pandoc_filter' \ @@ -209,7 +209,7 @@ _arguments -s \ '--wrap=[determine how text is wrapped in the output (the source code, not the rendered version)]: :_pandoc_wrap ' \ '--columns=[specify length of lines in characters]:length [72]' \ {--toc,--table-of-contents}'[include an automatically generated table of contents]' \ - '--toc-depth=[specify the number of section levels to include in the table of contents]:number:{_message -r "choose a number equals to or greater then 1"}' \ + '--toc-depth=[specify the number of section levels to include in the table of contents]:number' \ '--strip-comments[strip out HTML comments in the Markdown or Textile source]' \ '--no-highlight[disables syntax highlighting for code blocks and inlines]' \ '--highlight-style=[specifies the coloring style to be used in highlighted source code]:style|file:_pandoc_highlight_style' \ diff --git a/Completion/Unix/Command/_transmission b/Completion/Unix/Command/_transmission index 9b7309fe2..a640f3dd7 100644 --- a/Completion/Unix/Command/_transmission +++ b/Completion/Unix/Command/_transmission @@ -65,9 +65,9 @@ local global_only_actions=( ) # `torrent_add_options`: *options* that can be used only when *adding* a torrent local torrent_add_options=( - '(-C --no-incomplete-dir)'{-c+,--incomplete-dir=}'[when adding new torrents, store their contents in directory until the torrent is done]:dir:{_files -/}' + '(-C --no-incomplete-dir)'{-c+,--incomplete-dir=}'[when adding new torrents, store their contents in directory until the torrent is done]:directory:_directories' '(-c --incomplete-dir)'{-C,--no-incomplete-dir}'[don'"'"'t store incomplete torrents in a different directory]' - {-w+,--download-dir=}'[when used in conjunction with --add, set the new torrent'"'"'s download folder]:dir:{_files -/}' + {-w+,--download-dir=}"[when used in conjunction with --add, set the new torrent's download directory]:directory:_directories" ) # `torrent_action_only_actions`: *actions* that can be specified only when explicitly selecting a specific set of torrents local torrent_action_only_actions=( @@ -88,7 +88,7 @@ local torrent_action_only_actions=( {-r,--remove}'[remove the current torrent(s) without deleting the downloaded data]' {-rad,--remove-and-delete}'[remove the current torrent(s) and delete the downloaded data]' '--reannounce[reannounce the current torrent(s)]' - '--move[move the current torrents'"'"' data from their current locations to the specified directory]:{_files -/}' + "--move[move the current torrents' data from their current locations to the specified directory]:directory:_directories" {-sr+,--seedratio=}'[let the current torrent(s) seed until a specific ratio]:ratio' {-SR,--no-seedratio}'[let the current torrent(s) use the global seedratio settings]' {-hl,--honor-session}'[make the current torrent(s) honor the session limits]' -- cgit v1.2.3 From a9386df5581487e5e34ecb3ce422bacf62d10c3d Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Sun, 29 Aug 2021 17:08:34 +0200 Subject: 49319: completion options update --- ChangeLog | 2 + Completion/Linux/Command/_btrfs | 52 ++++++------ Completion/Linux/Command/_cpupower | 3 +- Completion/Linux/Command/_cryptsetup | 13 ++- Completion/Linux/Command/_dkms | 11 ++- Completion/Linux/Command/_ethtool | 60 +++++++++++--- Completion/Linux/Command/_findmnt | 9 ++- Completion/Linux/Command/_networkmanager | 9 ++- Completion/Linux/Command/_pidof | 2 + Completion/Linux/Command/_sysstat | 7 +- Completion/Linux/Command/_valgrind | 1 + Completion/Linux/Command/_wipefs | 1 + Completion/Redhat/Command/_rpm | 1 + Completion/Unix/Command/_abcde | 45 +++++------ Completion/Unix/Command/_ansible | 39 +++++---- Completion/Unix/Command/_attr | 1 + Completion/Unix/Command/_dict | 2 + Completion/Unix/Command/_dig | 10 ++- Completion/Unix/Command/_entr | 1 + Completion/Unix/Command/_gem | 5 +- Completion/Unix/Command/_getfacl | 1 + Completion/Unix/Command/_gnutls | 11 ++- Completion/Unix/Command/_gprof | 4 +- Completion/Unix/Command/_gzip | 8 +- Completion/Unix/Command/_iostat | 3 + Completion/Unix/Command/_java | 66 +++++++++++----- Completion/Unix/Command/_less | 39 ++++++++- Completion/Unix/Command/_mtr | 2 +- Completion/Unix/Command/_nm | 3 +- Completion/Unix/Command/_objdump | 7 +- Completion/Unix/Command/_patchutils | 1 + Completion/Unix/Command/_pgrep | 5 +- Completion/Unix/Command/_rar | 4 + Completion/Unix/Command/_readelf | 9 ++- Completion/Unix/Command/_ri | 23 +++--- Completion/Unix/Command/_ruby | 10 +-- Completion/Unix/Command/_script | 21 +++-- Completion/Unix/Command/_sqlite | 3 +- Completion/Unix/Command/_strip | 1 + Completion/Unix/Command/_sudo | 3 + Completion/Unix/Command/_tiff | 3 + Completion/Unix/Command/_tmux | 131 ++++++++++++++++++++++++------- Completion/Unix/Command/_vim | 8 +- Completion/Unix/Command/_w3m | 20 ++--- Completion/Unix/Command/_wget | 4 +- Completion/Unix/Command/_wiggle | 6 +- Completion/Unix/Command/_xmlsoft | 1 + Completion/Unix/Command/_xxd | 1 + Completion/X/Command/_xrandr | 1 + Completion/X/Command/_xterm | 2 +- 50 files changed, 466 insertions(+), 209 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index b4da80748..ae43c1979 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2021-08-29 Oliver Kiddle <opk@zsh.org> + * 49319: Completion/...: completion options update + * 49317: Completion/Unix/Command/_transmission, Completion/Unix/Command/_gcore, Completion/Unix/Command/_pandoc, Completion/Unix/Command/_luarocks: cleanup inappropriate use diff --git a/Completion/Linux/Command/_btrfs b/Completion/Linux/Command/_btrfs index d560928ae..bb0f724e6 100644 --- a/Completion/Linux/Command/_btrfs +++ b/Completion/Linux/Command/_btrfs @@ -17,11 +17,14 @@ cmds_7=( get set list ) cmds_8=( enable disable rescan help ) cmds_9=( assign remove create destroy show limit help ) cmds_10=( start status cancel help ) -cmds_11=( chunk-recover fix-device-size super-recover zero-log ) +cmds_11=( chunk-recover fix-device-size super-recover zero-log create-control-device ) _arguments -C -A "-*" "$args[@]" \ '(- *)--help[print help information]' \ '(- *)--version[print version information]' \ + '(-v --verbose -q --quiet --help --version)'{-v,--verbose}'[verbose output of operation]' \ + '(-v --verbose -q --quiet --help --version)'{-q,--quiet}'[suppress all messages except errors]' \ + '(--help --version)--format=[specify output format]:format:(text json)' \ '(--version)1: :->groups' \ '2: :->cmds' \ '*:: :->args' && ret=0 @@ -60,6 +63,11 @@ while (( $#state )); do fi args=( '(-)--help[print help information]' ) case ${cont} in + (balance|replace):start|device:(add|delete|remove)|filesystem:resize) + args+=( + "--enqueue[wait if there's another exclusive operation running, otherwise continue]" + ) + ;| subvolume:create) args+=( '*-i[add the newly created subvolume to a qgroup]:qgroup' @@ -67,11 +75,10 @@ while (( $#state )); do ) ;; subvolume:delete) - args+=( + args+=( '!-v' '!--verbose' '(-c --commit-after -C --commit-each)'{-c,--commit-after}'[wait for transaction commit at the end of the operation]' '(-c --commit-after -C --commit-each)'{-C,--commit-each}'[wait for transaction commit after deleting each subvolume]' '(-i --subvolid)'{-i+,--subvolid=}'[specify id of subvolume to be removed]:subvolume id' - '(-v --verbose)'{-v,--verbose}'[verbose output of operations]' '1:subvolume:_files -/' ) ;; @@ -113,7 +120,7 @@ while (( $#state )); do ;| 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|subvolume):(df|du|show|usage)) + (device|filesystem|qgroup|subvolume):(df|du|show|usage)|scrub:status) args+=( '--iec[use 1024 as a base]' '--si[use 1000 as a base]' @@ -130,7 +137,7 @@ while (( $#state )); do '(-t --tbytes)'{-t,--tbytes}'[show sizes in TiB, or TB with --si]' ) ;| - (filesystem|qgroup):(du|show)) + (filesystem|qgroup|scrub):(du|show|status)) args+=( '--raw[output raw numbers in bytes]' '--human-readable[output human friendly numbers, base 1024]' @@ -142,8 +149,7 @@ while (( $#state )); do ;| filesystem:resize) args+=( '1:size:_guard "(|+|-)[0-9]#[GKM]"' '2:path:->mounts' );; filesystem:defragment) - args+=( - '-v[verbose]' + args+=( '!-v' '-r[defragment files recursively]' '-c+[compress files while defragmenting]::compression algorithm:(zlib lzo zstd)' '-r[defragment files recursively]' @@ -193,10 +199,9 @@ while (( $#state )); do ;; device:ready) args+=( '1:device: _files -g "*(-%)"' );; scrub:(start|resume)) - args+=( + args+=( '!-q' "-B[don't background and print statistics at end]" '-d[print separate statistics for each device]' - '-q[omit error message and statistics]' '-r[read only mode]' '-R[raw print mode]' '-c[set ioprio class]:class:(( 0\:none 1\:realtime 2\:best-effort 3\:idle))' @@ -216,18 +221,17 @@ while (( $#state )); do ) ;; balance:start) - args+=( + args+=( '!-v' '!--verbose' '(-m -s)-d+[act on data chunks]:filter:->filters' '(-d -s)-m+[act on metadata chunks]:filter:->filters' '(-d -m)-s+[act on system chunks (only under -f)]:filters:->filters' - '(-v --verbose)'{-v,--verbose}'[verbose mode]' '-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 -/' ) ;; - balance:status) args+=( '(-v --verbose)'{-v,--verbose}'[verbose mode]' '1:path:_files -/' );; + balance:status) args+=( '!-v' '!--verbose' '1:path:_files -/' );; balance:(pause|cancel|resume)) args+=( '1:path:_files -/' );; property:set) args+=( '3:value' );& property:get) args+=( '2:property:(ro label compression)' );& @@ -304,6 +308,8 @@ while (( $#state )); do '!(--dfs)--bfs' '--dfs[depth-first traversal of the trees]' '--hide-names[hide filenames/subvolume/xattrs and other name references]' + '--csum-headers[print node checksums stored in headers (metadata)]' + '--csum-items[print checksums stored in checksum items (data)]' ) ;; inspect*:dump-super) @@ -315,11 +321,10 @@ while (( $#state )); do '--bytenr[specify alternate superblock offset]:offset' ) ;; - inspect*:inode*) args+=( '-v[verbose mode]' '1:inode:_files' '2:path:_files -/' );; - inspect*:subvol*) args+=( '-v[verbose mode]' '1:subvolid:_guard "[0-9]#" subvolume id' '2:path:_files -/' );; + inspect*:inode*) args+=( '!-v' '1:inode:_files' '2:path:_files -/' );; + inspect*:subvol*) args+=( '!-v' '1:subvolid:_guard "[0-9]#" subvolume id' '2:path:_files -/' );; inspect*:logical*) - args+=( - '-v[verbose mode]' + args+=( '!-v' '-P[skip the path resolving and print the inodes instead]' '-o[ignore offsets when matching references]' '-s[specify buffer size]:buffer size [4096]' @@ -331,9 +336,8 @@ while (( $#state )); do inspect*:rootid) args+=( '1:path:_files -/' );; inspect*:tree*) args+=( '-b[print raw numbers in bytes]' );; rescue:(chunk|super)-recover) - args+=( + args+=( '!-v' '-y[assume yes to every question]' - '-v[verbose mode]' '1:device:_files' ) [[ ${${(P)group}[cmd]} == chunk-recover ]] && args+=('(-)-h[display help]') @@ -361,12 +365,11 @@ while (( $#state )); do ) ;; restore) - args+=( + args+=( '!-v' '!--verbose' '(-s --snapshots)'{-s,--snapshots}'[get snapshots]' '(-x --xattr)'{-x,--xattr}'[restore extended attributes]' '(-m --metadata)'{-m,--metadata}'[restore owner, mode and times]' '(-S --symlink)'{-S,--symlink}'[restore symbolic links]' - '(-v --verbose)'{-v,--verbose}'[be verbose and output what is restored]' '(-i --ignore-errors)'{-i,--ignore-errors}'[ignore errors]' '(-o --overwrite)'{-o,--overwrite}'[overwrite directories and files]' '-t[specify tree location]:tree root' @@ -383,23 +386,20 @@ while (( $#state )); do ) ;; send|receive) - args+=( '(-q --quiet)'{-q,--quiet}'[suppress all messages except errors]' ) + args+=( '!-q' '!--quiet' ) ;| send) - args+=( - '*-v[verbose mode]' + args+=( '!-v' '-e[if sending multiple subvolumes at once, use the new format]' '-p[send incremental stream]:parent:_files -/' '*-c[use snapshot as clone source]:clone:_files -/' '-f[specify output file]:file:_files' '--no-data[send in NO_FILE_DATA mode]' - '(-v --verbose)'{-v,--verbose}'[enable verbose output]' '1:subvolume:_files -/' ) ;; receive) - args+=( - '*-v[verbose mode]' + args+=( '!-v' '-f[input file]:file: _files' '-e[terminate after <end cmd>]' '(-C --chroot)'{-C,--chroot}'[confine the process to destination path using chroot(1)]' diff --git a/Completion/Linux/Command/_cpupower b/Completion/Linux/Command/_cpupower index ae1f1d3d1..6763bdd12 100644 --- a/Completion/Linux/Command/_cpupower +++ b/Completion/Linux/Command/_cpupower @@ -20,11 +20,12 @@ cmds=( 'info:show global power parameters' 'set:set global power parameters' 'monitor:report frequency and idle statistics' + 'powercap-info:show powercapping related kernel and hardware configurations' 'help:print usage information' ) case $state in cmds) - _describe command cmds && ret=0 + _describe command cmds -M 'r:|-=* r:|=*' && ret=0 ;; args) curcontext="${curcontext%:*}-$words[1]" diff --git a/Completion/Linux/Command/_cryptsetup b/Completion/Linux/Command/_cryptsetup index 45159d0be..f7149a76f 100644 --- a/Completion/Linux/Command/_cryptsetup +++ b/Completion/Linux/Command/_cryptsetup @@ -21,6 +21,7 @@ _arguments -s \ '--new-keyfile-offset=[specify number of bytes to skip in newly added keyfile]:offset (bytes)' \ '(-S --key-slot)'{-S+,--key-slot=}'[select key slot]:key slot' \ '(-b --size)'{-b+,--size=}'[force device size]:sectors' \ + '--device-size=[use only specified device size (ignore rest of device)]:size (bytes)' \ '(-o --offset)'{-o+,--offset=}'[set start offset]:sectors' \ '(-p --skip)'{-p+,--skip=}'[data to skip at beginning]:sectors' \ '(-r --readonly)'{-r,--readonly}'[create a read-only mapping]' \ @@ -44,10 +45,12 @@ _arguments -s \ '--veracrypt[scan also for VeraCrypt compatible device]' \ '--veracrypt-pim=[specify personal iteration multiplier for VeraCrypt compatible device]:multiplier' \ '--veracrypt-query-pim[query personal iteration multiplier for VeraCrypt compatible device]' \ - '(-M --type)'{-M+,--type=}'[specify type of device metadata]:type:(luks plain loopaes tcrypt)' \ + '(-M --type)'{-M+,--type=}'[specify type of device metadata]:type:(luks luks1 luks2 plain loopaes tcrypt bitlk)' \ '--force-password[disable password quality check (if enabled)]' \ '--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]' \ + '--perf-no_read_workqueue[bypass dm-crypt workqueue and process read requests synchronously]' \ + '--perf-no_write_workqueue[bypass dm-crypt workqueue and process write requests synchronously]' \ '--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)' \ @@ -60,14 +63,16 @@ _arguments -s \ '(-I --integrity)'{-I+,--integrity=}'[specify data integrity algorithm (LUKS2 only)]:algorithm' \ '--integrity-no-journal[disable journal for integrity device]' \ "--integrity-no-wipe[don't wipe device after format]" \ + '--integrity-legacy-padding[use inefficient legacy padding (old kernels)]' \ "--token-only[don't ask for passphrase if activation by token fails]" \ '--token-id=[specify token number]:number [any]' \ '--key-description=[specify key description]:description' \ '--sector-size=[specify encryption sector size]:size [512 bytes]' \ + '--iv-large-sectors[use IV counted in sector size (not in 512 bytes)]' \ '--persistent[set activation flags persistent for device]' \ '--label=[set label for the LUKS2 device]:label' \ '--subsystem=[set subsystem label for the LUKS2 device]:subsystem' \ - '--unbound[create unbound (no assigned data segment) LUKS2 keyslot]' \ + '--unbound[create or dump 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)' \ @@ -77,12 +82,13 @@ _arguments -s \ '--encrypt[Encrypt LUKS2 device (in-place encryption)]' \ '--decrypt[decrypt LUKS2 device (remove encryption)]' \ '--init-only[initialize LUKS2 reencryption in metadata only]' \ + '--resume-only[resume initialized LUKS2 reencryption 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}(- : *)"{-V,--version}'[show version information]' \ "${ign}(- : *)"{-\?,--help}'[display help information]' \ "${ign}(- : *)--usage[display brief usage]" \ ':action:->actions' \ @@ -111,6 +117,7 @@ case $state in 'isLuks:check if device is a LUKS partition' 'luksDump:dump header information' 'tcryptDump:dump TCRYPT device information' + 'bitlkDump:dump BITLK device information' 'luksSuspend:suspend LUKS device and wipe key' 'luksResume:resume suspended LUKS device' 'luksHeaderBackup:store binary backup of headers' diff --git a/Completion/Linux/Command/_dkms b/Completion/Linux/Command/_dkms index a0a666e33..2a3c016c5 100644 --- a/Completion/Linux/Command/_dkms +++ b/Completion/Linux/Command/_dkms @@ -8,6 +8,7 @@ subcmds=( 'add:add a module/version combination to the tree for builds and installs' 'remove:remove a module from the tree' 'build:compile a module for a kernel' + 'unbuild:undoes the build of a module' "install:install a build module for it's corresponding kernel" 'uninstall:uninstall a module for a kernel' 'match:install every module that is installed for a template kernel for another kernel' @@ -17,6 +18,7 @@ subcmds=( 'mkrpm:create an RPM package for a module' 'mkdeb:create a debian binary package for a module' 'mkdsc:create a debian source package for a module' + 'mkbmdeb:create a debian package containing just binary modules' 'mkkmp:create a Kernel Module Package source RPM for a module' 'status:display the current status of modules, versions and kernels within the tree' 'autoinstall:try to install the latest revision of all modules that have been installed for other kernel revisions' @@ -32,6 +34,7 @@ args=( '--installtree=:path:_directories' '--sourcetree=:path:_directories' '--dkmsframework=:path:_directories' + '--force-version-override' '1: : _describe -t commands command subcmds' ) @@ -44,7 +47,7 @@ else '(remove|build|install|uninstall|match|status|mk(^kmp))' 'k' \ '(add|remove)' '-rpm_safe_upgrade' \ 'mk(driverdisk|kmp)' '-spec' \ - 'mk(deb|dsc|rpm)' '-legacy-postinst' \ + 'mk(deb|dsc|bmdeb|rpm)' '-legacy-postinst' \ 'mk(tarball|rpm|deb|dsc)' '-(source|binary)-only' \ '(match|build|mkkmp)' '(k|-no-(prepare|clean)-kernel|-kernelsourcedir)' \ '(|un)install' '-no-(depmod|initrd)' \ @@ -67,7 +70,7 @@ case $cmd in remove|build|install|uninstall|mk*|status) args+=( ': :->modules' ) ;| - |remove|build|install|uninstall|match|status|mk(^kmp)) + |remove|(un|)build|install|uninstall|match|status|mk(^kmp)) args+=( '(--all)*-k[specify kernel version]:kernel:->kernels' ) ;| |add|remove) args+=( "${ign}--rpm_safe_upgrade" ) ;| @@ -77,7 +80,7 @@ case $cmd in |(mk|ld)tarball) args+=( "${ign}--archive=:tarball:_files -g '*.tar(-.)'" ) ;| - |mk(deb|dsc|rpm)) + |mk(deb|dsc|bmdeb|rpm)) args+=( "${ign}--legacy-postinst=:value [1]:(0 1)" ) ;| |mk(tarball|rpm|deb|dsc)) args+=( "${ign}(--source-only --binaries-only)--"{source,binaries}-only ) ;| @@ -100,7 +103,7 @@ case $cmd in '-c[specify location of dkms.conf file]:location:_files' ) ;| - |remove|build|install|status|mk(^kmp)) + |remove|(un|)build|install|status|mk(^kmp)) args+=( '(-a --arch -k)--all[specify all relevant kernels/arches]' ) ;| |build) diff --git a/Completion/Linux/Command/_ethtool b/Completion/Linux/Command/_ethtool index dccda4684..95a8bbfb6 100644 --- a/Completion/Linux/Command/_ethtool +++ b/Completion/Linux/Command/_ethtool @@ -5,16 +5,21 @@ local -a state line expl cmds local -A opt_args _arguments -C \ + '--debug[turn on debugging messages]:mask:((1\:parser\ information))' \ + '--json[output results in JSON]' \ + '(-I --include-statistics)'{-I,--include-statistics}'[include command-related statistics in the output]' \ + '(cmds)'{-Q,--per-queue}'[apply per-queue command]: :(queue_mask):queue mask' \ "1:interface:_net_interfaces" \ - '*: :->args' \ + '*:: :->args' \ + + '(cmdc)' \ + '(cmds)'{-c,--show-coalesce}'[query the specified ethernet device for coalescing information]' \ + '(cmds)'{-C,--coalesce}'[change the coalescing settings of the specified ethernet device]' \ + '(cmds)' \ '(1)'{-h,--help}'[display help information]' \ '(1)--version[display version information]' \ {-s,--change}'[allow changing some or all settings of the specified ethernet device]' \ {-a,--show-pause}'[query the specified ethernet device for pause parameter information]' \ {-A,--pause}'[change the pause parameters of the specified ethernet device]' \ - {-c,--show-coalesce}'[query the specified ethernet device for coalescing information]' \ - {-C,--coalesce}'[change the coalescing settings of the specified ethernet device]' \ {-g,--show-ring}'[query the specified ethernet device for RX/TX ring parameter information]' \ {-G,--set-ring}'[change the RX/TX ring parameters of the specified ethernet device]' \ {-k,--show-features,--show-offload}'[query the specified ethernet device for offload information]' \ @@ -46,10 +51,21 @@ _arguments -C \ '--set-eee[set EEE settings]' \ '--set-phy-tunable[set PHY tunable]' \ '--get-phy-tunable[get PHY tunable]' \ + '--get-tunable[get tunable parameters]' \ + "--set-tunable[set driver's tunable parameters]" \ '--reset[reset hardware components]' \ '--show-fec[query device for forward error correction support]' \ '--set-fec[configure forward error correction for device]' \ - {-Q,--per-queue}'[apply per-queue command]' && return + '--cable-test[perform cable test and report the results]' \ + '--cable-test-tdr[perform cable test and report Time Domain Reflectometer data]' \ + '--show-tunnels[show tunnel-related device capabilities and state]' \ + '--monitor[listen to netlink notifications and displays them]::command:( + --all -s --change -k --show-features --show-offload -K + --features --offload --show-priv-flags --set-priv-flags -g --show-ring + -G --set-ring -l --show-channels -L --set-channels -c --show-coalesce + -C --coalesce -a --show-pause -A --pause --show-eee --set-eee + --cable-test --cable-test-tdr + )' && return if [[ -n $state ]]; then case $words[CURRENT-1] in @@ -62,7 +78,8 @@ 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|fast-link-down) + autoneg|adaptive-[rt]x|raw|hex|sg|tso|ufo|gso|lro|eee|tx-lpi|downshift) ;& + fast-link-down|energy-detect-power-down|mode) _wanted onoff expl 'enabled' compadd off on ;; rx-usecs|rx-frames|rx-usecs-irq|rx-frames-irq|tx-usecs|tx-frames) ;& @@ -71,6 +88,8 @@ 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) ;& + page|bank|i2c|first|last|step|pair|lanes) ;& + rx-copybreak|tx-copybreak|pfc-prevention-tout) ;& other|combined|tx-timer|count|msecs) _message -e numbers 'number' ;; @@ -81,7 +100,10 @@ if [[ -n $state ]]; then _wanted duplex expl 'duplex mode' compadd half full ;; port) - _wanted port expl 'device port' compadd tp aui bnc mii fibre + _wanted port expl 'device port' compadd tp aui bnc mii fibre da + ;; + master-slave) + _wanted roles expl role compadd {preferred,forced}-{master,slave} ;; advertise) _values 'hexadecimal value (or a combination of the following)' \ @@ -93,7 +115,8 @@ if [[ -n $state ]]; then '0x020[1000 full]' \ '0x8000[2500 full(not supported by IEEE standards)]' \ '0x800[10000 full]' \ - '0x03F[auto]' + '0x03F[auto]' \ + 'mode[set mode]' ;; xcvr) _wanted xcvr expl 'transceiver type' compadd internal external @@ -144,7 +167,7 @@ if [[ -n $state ]]; then _message -e contexts 'RSS context' ;; *) - case $words[2] in + case ${${(Mk)opt_args:#cmd?*}[1]#cmd?-} in -A|--pause) _values -S ' ' -w 'pause parameter' \ 'autoneg[specify if pause autonegotiation is enabled]' \ @@ -192,6 +215,9 @@ if [[ -n $state ]]; then -p|--identify) (( CURRENT = 4 )) && _message -e length 'duration (seconds)' ;; + -S|--statistics) + _arguments '(-)--all-groups' '(-)--groups:eth-phy: :eth-mac: :eth-ctrl: :rmon' + ;; -t|--test) _values -S ' ' -w 'test mode' \ '(online)offline:perform full set of tests possibly causing normal operation interruption (default)]' \ @@ -202,8 +228,10 @@ if [[ -n $state ]]; then if (( ! $words[(I)msglvl] )); then _values -S ' ' -w 'generic option' \ 'speed[set speed in Mb/s]' \ + 'lanes[set number of lanes]' \ 'duplex[set full or half duplex mode]' \ 'port[select device port]' \ + 'master-slave[configure interface role]' \ 'autoneg[specify if autonegotiation is enabled]' \ 'advertise[set the speed and duplex advertised by autonegotiation]' \ 'phyad[PHY address]' \ @@ -274,16 +302,23 @@ if [[ -n $state ]]; then fi ;; -m|--dump-module-eeprom|--module-info) - _wanted options expl option compadd -F line - raw hex offset length + _wanted options expl option compadd -F line - raw hex offset \ + length page bank i2c ;; --set-eee) _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 fast-link-down msecs + _wanted options expl tunable compadd -F line - downshift count \ + fast-link-down msecs energy-detect-power-down ;; --get-phy-tunable) - _wanted options expl tunable compadd downshift fast-link-down + _wanted options expl tunable compadd downshift fast-link-down \ + energy-detect-power-down + ;; + --[gs]et-tunable) + _wanted options expl tunable compadd rx-copybreak tx-copybreak \ + pfc-prevention-tout ;; --reset) _wanted components expl component compadd flags dedicated all \ @@ -303,6 +338,9 @@ if [[ -n $state ]]; then _wanted options expl option compadd -c --show-coalescing -C --coalesce fi ;; + --cable-test-tdr) + _wanted options expl 'distance options' compadd first last step pair + ;; esac ;; esac diff --git a/Completion/Linux/Command/_findmnt b/Completion/Linux/Command/_findmnt index 9f13e695f..0c832364d 100644 --- a/Completion/Linux/Command/_findmnt +++ b/Completion/Linux/Command/_findmnt @@ -22,9 +22,12 @@ _arguments -s -C \ '(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 -o --output --output-all)'{-o+,--output=}'[specify output columns]: :->columns' \ + '(H -o --output)--output-all[output all available columns]' \ '(H -p --poll)'{-p+,--poll=}'[monitor changes in /proc/self/mountinfo]::action:(mount umount remount move)' \ + '(H --real)--pseudo[print only pseudo-filesystems]' \ '(H -R --submounts)'{-R,--submounts}'[print recursively all submounts]' \ + '(H --pseudo)--real[print only real filesystems]' \ '(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' \ @@ -39,7 +42,7 @@ _arguments -s -C \ '(H)2:: :->targets' \ + '(format)' \ '(H)'{-D,--df}'[imitate the output of df command]' \ - '(H)'{-J,--json}'[use JASON output format]' \ + '(H)'{-J,--json}'[use JSON output format]' \ '(H)'{-l,--list}'[use list output format]' \ '(H)'{-P,--pairs}'[use key="value" output format]' \ '(H)'{-r,--raw}'[use raw output format]' \ @@ -101,7 +104,7 @@ case $state in 'prefixes:prefix:compadd -S "" LABEL= UUID= PARTLABEL= PARTUUID=' ) [[ $state = sources_targets ]] && - alts+=( 'mount-points:moutpoint:__findmnt_mountpoints' ) + alts+=( 'mount-points:mountpoint:__findmnt_mountpoints' ) _alternative $alts && ret=0 fi ;; diff --git a/Completion/Linux/Command/_networkmanager b/Completion/Linux/Command/_networkmanager index c9b09d145..1e05252b2 100644 --- a/Completion/Linux/Command/_networkmanager +++ b/Completion/Linux/Command/_networkmanager @@ -244,7 +244,7 @@ _nm_device_wifi() { local curcontext="$curcontext" state line _arguments -C \ - "1:command:(list connect hotspot rescan)" \ + "1:command:(list connect hotspot rescan show-password)" \ "*::arg:->args" case $line[1] in @@ -252,6 +252,7 @@ _nm_device_wifi() { c*) _nm_device_wifi_connect ;; ho*) _nm_device_wifi_hotspot ;; r*) _nm_device_wifi_rescan ;; + s*) _nm_device_wifi_show-password ;; esac } @@ -362,6 +363,12 @@ _nm_device_wifi_rescan() { "4:ssid:_nm_device_wifi_ssids" } +_nm_device_wifi_show-password() { + _arguments \ + "1: :(ifname)" \ + "2:interface:_nm_device_ifnames" +} + _nm_device_wifi_bssids() { local -a bssids bssids=(${(f)"$(_call_program nmcli nmcli -t -f bssid device wifi list)"}) diff --git a/Completion/Linux/Command/_pidof b/Completion/Linux/Command/_pidof index 05fb23d45..dd0649ce9 100644 --- a/Completion/Linux/Command/_pidof +++ b/Completion/Linux/Command/_pidof @@ -9,6 +9,8 @@ _arguments -C -s -w \ '(- *)'{-V,--version}'[print program version]' \ "(-s --single-shot $exargs)"{-s,--single-shot}'[return one PID only]' \ "(-c --check-root $exargs)"{-c,--check-root}'[omit processes with different root]' \ + '-q[quiet mode, only set the exit code]' \ + '(-w --with-workers)'{-w,--with-workers}'[show kernel workers too]' \ "(-x $exargs)"-x'[include shells running named scripts]' \ "($exargs)"\*{-o+,--omit-pid=}'[omit processes with PIDs]:pids:_sequence -s , _pids' \ '(-S --separator)'{-S+,--separator=}'[specify separator put between PIDs]:separator' \ diff --git a/Completion/Linux/Command/_sysstat b/Completion/Linux/Command/_sysstat index 4de855b69..eba99fc5a 100644 --- a/Completion/Linux/Command/_sysstat +++ b/Completion/Linux/Command/_sysstat @@ -11,6 +11,7 @@ _mpstat() { '--dec=-[specify the number of decimal places to use]:decimal places [2]:(0 1 2)' \ '-o[display statistics in JSON]:format:(JSON)' \ '(-A)-P[specify processor number]:processor: _values -s "," processor ALL {0..$(_call_program processors getconf _NPROCESSORS_ONLN)}' \ + '-T[display topology elements in the CPU report]' \ '-u[report CPU utilization]' \ '(- 1 2)-V[display version information]' \ '1: : _guard "^-*" interval' \ @@ -26,6 +27,7 @@ _cifsiostat() { '-t[print timestamp for each report]' \ '(- 1 2)-V[print version number]' \ '--human[print sizes in human readable format]' \ + '--pretty[make the CIFS report easier to read by a human]' \ '1: : _guard "^-*" interval' \ '2: : _guard "^-*" count' } @@ -49,7 +51,7 @@ _sadf() { '-H[display only the header of the report]' \ '(-g -j -p -r -x)-h[print on a single line when used with -d]' \ '-O[specify output options]: : _values -s , option - autoscale height\:value oneday packed showidle showinfo skipempty showhints' \ + autoscale bwcol customcol height\:value oneday packed showidle showinfo showtoc skipempty hz\:value pcparchive\:name\:_files debug' \ '-P[restrict processor dependant statistics]:processor number(zero indexed) or ALL:(ALL)' \ '--dev=-[specify block devices for which statistics are to be displayed]:block device:_files -g "*(-%)"' \ '--fs=-[specify filesystems for which statistics are to be displayed]:file system:_dir_list -s ,' \ @@ -66,6 +68,7 @@ _sadf() { '-d[output file in SQL format]' \ '-g[print data in SVG format]' \ '-j[output file in JSON]' \ + '-l[export the contents of the data file to a PCP (Performance Co-Pilot) archive]' \ '-p[print in format parsable by tools like awk]' \ '-r[print raw contents of data file]' \ '-x[output file in XML]' \ @@ -105,7 +108,7 @@ _sar() { '-o[save readings to file in binary form]:file:_files' \ '-P[report per-processor statistics]:processor: _values -s "," processors ALL' \ '-p[pretty-print device names]' \ - '-q[report queue length and load averages]' \ + '-q[report queue length and load averages]::keyword:(CPU IO LOAD MEM PSI ALL)' \ '-R[report memory statistics]' \ '-r[report memory utilization statistics]:: :(ALL)' \ '-S[report swap space utilization]' \ diff --git a/Completion/Linux/Command/_valgrind b/Completion/Linux/Command/_valgrind index 23a8cd734..b4bb3248e 100644 --- a/Completion/Linux/Command/_valgrind +++ b/Completion/Linux/Command/_valgrind @@ -205,6 +205,7 @@ _arguments -C ${(P)args} $cmd \ '(--version)--tool=-[specify valgrind tool]:valgrind tool:->tools' \ '(-h --help)'{-h,--help}'[show help information]' \ '--help-debug[show help info including debugging options]' \ + '--help-dyn-options[show the dynamically changeable options]' \ '(-)--version[show version]' \ '(-q --quiet)'{-q,--quiet}'[run silently; only print error msgs]' \ '(-v --verbose)'{-v,--verbose}'[be more verbose]' \ diff --git a/Completion/Linux/Command/_wipefs b/Completion/Linux/Command/_wipefs index 5142def8a..8642aab92 100644 --- a/Completion/Linux/Command/_wipefs +++ b/Completion/Linux/Command/_wipefs @@ -19,6 +19,7 @@ _arguments -s -S \ '(H -p --parsable -i --no-headings -J --json)'{-p,--parsable}'[print out in parsable instead of printable format]' \ '(H -q --quiet)'{-q,--quiet}'[suppress output messages]' \ '(H -t --types)'{-t+,--types=}'[limit the set of filesystem, RAIDs or partition tables]:type:_file_systems' \ + '(H)--lock=-[use exclusive device lock]::mode:(yes no nonblock)' \ '(H)*:disk device:_files -g "*(-%)" -P / -W /' \ + '(H)' \ '(- *)'{-h,--help}'[display help information]' \ diff --git a/Completion/Redhat/Command/_rpm b/Completion/Redhat/Command/_rpm index db7c1145d..d00f88429 100644 --- a/Completion/Redhat/Command/_rpm +++ b/Completion/Redhat/Command/_rpm @@ -129,6 +129,7 @@ _rpm () { '--scm=[select the SCM to use with %autosetup]:scm [patch]:(patch gendiff git quilt)' '*--buildpolicy=[set buildroot policy]:policy:->brp_policies' '!--sign' + '--trace[trace macro expansion]' "--nodebuginfo[don't generate debuginfo for this package]" ) diff --git a/Completion/Unix/Command/_abcde b/Completion/Unix/Command/_abcde index 361b43091..3f748d373 100644 --- a/Completion/Unix/Command/_abcde +++ b/Completion/Unix/Command/_abcde @@ -1,50 +1,41 @@ #compdef abcde -(( $+functions[_abcde_fields] )) || -_abcde_fields(){ - _values -s , field year genre -} - -(( $+functions[_abcde_actions] )) || -_abcde_actions(){ - _values -s , action cddb cue read getalbumart embedalbumart normalize encode tag move replaygain playlist clean -} - -_arguments -s \ +_arguments -s -S -A "-*" \ '(-t -T -p)-1[encode the whole CD in a single file]' \ - '-a[comma-delimited list of actions to perform]:action:_abcde_actions' \ + '-a[comma-delimited list of actions to perform]:action:_sequence compadd - cddb cue read getalbumart embedalbumart normalize encode tag move replaygain playlist clean' \ '-b[enable batch mode normalization]' \ '-B[enable automatic embedding of album art with certain containers]' \ - '-c[specify an additional configuration file to parse]:config:_files' \ - '-C[resume a session for discid when you no longer have the CD available]:discid' \ - '-d[CD-ROM block device that contains audio tracks to be read]:cd-rom-file:_files' \ + '-c+[specify an additional configuration file to parse]:config:_files' \ + '-C+[resume a session when read was completed but CD is not present]:disc id:compadd abcde.*(N:e)' \ + '-d+[specify CD device from which to read audio tracks]:CD device:_files -g "*(-%)" -P / -W /' \ '-D[capture debugging information]' \ '-e[erase information about encoded tracks from the internal status file]' \ '-f[force the removal of the temporary ABCDETEMPDIR directory]' \ "-g[enable lame's --nogap option]" \ '-G[download album art using the getalbumart function]' \ '(- :)-h[get help information]' \ - '-j[start a specified number of encoder processes at once]:number' \ + '-j+[start specified number of encoder processes at once]:number' \ '-k[keep the wav files after encoding]' \ - '-l[use the low-diskspace algorithm]' \ + '-l[use the low disk space algorithm]' \ '-L[use a local CDDB repository]' \ '-m[create DOS-style playlists, modifying the resulting one by adding CRLF line endings those to work]' \ "-n[don't query CDDB database]" \ '-N[non interactive mode]' \ - '-o[select output type]:outputtype:(vorbis ogg mp3 flac spx mpc m4a wav wv ape opus mka aiff)' \ + '-o+[select output type]:output type [vorbis]:(vorbis ogg mp3 flac spx mpc m4a wav wv ape opus mka aiff)' \ "-p[pads track numbers with 0's]" \ '-P[use Unix PIPES to read and encode in one step]' \ - '-r[remote encode on this comma-delimited list of machines using distmp3]:hosts:_sequence _hosts' \ - '-s[fields to be shown in the CDDB parsed entries]:field:_abcde_fields' \ - '-S[set the speed of the CD drive]:speed' \ - '-t[start the numbering of the tracks at a given number]:track-number' \ - '-T[start the numbering of the tracks at a given number and change internal tag numbering]:track-number' \ + '-Q+[specify CD lookup methods]:lookup method [musicbrainz]:_sequence compadd - musicbrainz cddb cdtext' \ + '-r+[remote encode on this comma-delimited list of machines using distmp3]:hosts:_sequence _hosts' \ + '-s+[fields to be shown in the CDDB parsed entries]:field:_sequence compadd - year genre' \ + '-S+[set the speed of the CD drive]:speed' \ + '-t+[start the numbering of the tracks at a given number]:track-number' \ + '-T+[start the numbering of the tracks at a given number and change internal tag numbering]:track-number' \ '-U[set CDDBPROTO to version 5]' \ '(- :)-v[show the version and exit]' \ '-V[be more verbose]' \ '-x[eject the CD when all tracks have been read]' \ - '-X[use an alternative "cue2discid" implementation]:cue2discid' \ - '-w[add a comment to the tracks ripped from the CD]:comment' \ - "-W[concatenate CD's]:cd-number" \ + '-X+[use an alternative "cue2discid" implementation]:cue2discid:_command_names -e' \ + '-w+[add a comment to the tracks ripped from the CD]:comment' \ + "-W+[concatenate CD's]:cd-number" \ '-z[debug mode]' \ - '*:tracks:' + '*: :_guard "^-*" "track list"' diff --git a/Completion/Unix/Command/_ansible b/Completion/Unix/Command/_ansible index 65cae148e..6ec7d0c2e 100644 --- a/Completion/Unix/Command/_ansible +++ b/Completion/Unix/Command/_ansible @@ -22,6 +22,8 @@ case $service in args+=( '(-K --ask-become-pass)'{-K,--ask-become-pass}'[ask for privilege escalation password]' '(-k --ask-pass)'{-k,--ask-pass}'[ask for connection password]' + '--list-hosts[output list of matching hosts]' + '(-l --limit)'{-l+,--limit=}'[further limit hosts to an additional pattern]:host subset:->hosts' '(-T --timeout)'{-T+,--timeout=}'[override the connection timeout]:timeout (seconds) [10]' '(-c --connection)'{-c+,--connection=}'[specify connection type]:connection type [smart]:->connect-types' '(-u --user)'{-u+,--user=}'[specify remote user for connection]:remote user:_users' @@ -47,28 +49,14 @@ case $service in ansible|ansible-console|ansible-inventory|ansible-playbook|ansible-pull) args+=( --ask-vault-pass{,word}'[ask for vault password]' + '(-e --extra-vars)'{-e+,--extra-vars=}'[set additional variables]:key=value or YAML/JSON' '--vault-id=[specify vault identity to use]:vault identity' --vault-pass{,word}-file='[specify vault password file]:vault password file:_files' - ) - ;| - ansible|ansible-console|ansible-inventory|ansible-playbook|ansible-pull) - args+=( \*{-i+,--inventory=}'[specify inventory host file or host list]: : _alternative "files\:inventory file\:_files" "hosts\:host\: _sequence _hosts"' '!(-i --inventory)--inventory-file=:inventory file:_files' ) ;| - ansible|ansible-console|ansible-playbook|ansible-pull) - args+=( - '--list-hosts[output list of matching hosts]' - '(-l --limit)'{-l+,--limit=}'[further limit hosts to an additional pattern]:host subset:->hosts' - ) - ;| - ansible|ansible-playbook|ansible-pull) - args+=( - '(-e --extra-vars)'{-e+,--extra-vars=}'[set additional variables]:key=value or YAML/JSON' - ) - ;| ansible|ansible-console|ansible-inventory) args+=( '--playbook-dir=[specify substitute playbook directory]:directory:_directories' @@ -80,11 +68,16 @@ case $service in "--skip-tags[only run plays and tasks whose tags don't match]" ) ;| + ansible|ansible-console) + args+=( + '--task-timeout[set the task timeout limit]:timeout (seconds)' + ) + ;| ansible) args+=( '(-a --args)'{-a+,--args=}'[specify command or module arguments]:arguments:->args' '(-B --background)'{-B+,--background=}'[run asynchronously, failing after specified time]:fail timeout (seconds)' - '(-m --module-name)'{-m+,--module-name=}'[specify module]:module:->plugins' + '(-m --module-name)'{-m+,--module-name=}'[specify action to execute]: :->plugins' '(-o --one-line)'{-o,--one-line}'[condense output]' '(-P --poll)'{-P+,--poll=}'[specify the poll interval if using -B]:interval (seconds) [15]' '(-t --tree)'{-t+,--tree=}'[specify directory for log output]:directory:_directories' @@ -111,11 +104,14 @@ case $service in ansible-doc) args+=( '!--metadata-dump' # "internal testing only" - '(-l --list -F --list_files -s --snippet)'{-j,--json}'[change output to json format]' - '(-l --list -F --list_files -s --snippet)'{-l,--list}'[list available plugins]' - '(-l --list -F --list_files -s --snippet)'{-F,--list_files}'[show plugin names and their source files without summaries]' - '(-l --list -F --list_files -s --snippet)'{-s,--snippet}'[show playbook snippet for specified plugins]' - '(-t --type)'{-t+,--type=}'[choose plugin type]:plugin type [module]:(become cache callback cliconf connection httpapi inventory lookup netconf shell module strategy vars)' + '(-l --list -F --list_files -s --snippet --metadata-dump -e --entry-point)'{-j,--json}'[change output to json format]' + '(-l --list -F --list_files -s --snippet --metadata-dump -e --entry-point)'{-l,--list}'[list available plugins]' + '(-l --list -F --list_files -s --snippet --metadata-dump -e --entry-point)'{-F,--list_files}'[show plugin names and their source files without summaries]' + '(-l --list -F --list_files -s --snippet --metadata-dump -e --entry-point)'{-s,--snippet}'[show playbook snippet for specified plugins]' + '(-l --list -F --list_files -s --snippet -e --entry-point)--metadata-dump[dump json metadata for all plugins]' + '(-l --list -F --list_files -s --snippet --metadata-dump -e --entry-point)'{-e+,--entry-point=}'[select the entry point for roles]:entry point' + '(-t --type)'{-t+,--type=}'[choose plugin type]:plugin type [module]:(become cache callback cliconf connection httpapi inventory lookup netconf shell vars module strategy role keyword)' + '(-r --roles-path)'{-r+,--roles-path=}'[specify directory containing roles]:directory:_directories' '*:plugin:->plugins' ) ;; @@ -389,6 +385,7 @@ case $state in encrypt_string) args+=( '(-p --prompt)'{-p,--prompt}'[prompt for the string to encrypt]' + "--show-input[don't hide input when prompted for the string to encrypt]" '(-n --name)'{-n+,--name=}'[specify the variable name]:variable' '--stdin-name=[specify the variable name for stdin]:variable' ) diff --git a/Completion/Unix/Command/_attr b/Completion/Unix/Command/_attr index 121c0c539..efa7c5c4f 100644 --- a/Completion/Unix/Command/_attr +++ b/Completion/Unix/Command/_attr @@ -23,6 +23,7 @@ case $service in '(-e --encoding)'{-e+,--encoding=}'[encode values after retrieving them]:encoding:(text hex base64)' \ '(-h --no-dereference)'{-h,--no-dereference}"[don't follow symbolic links]" \ '(-m --match)'{-m+,--match=}'[only include attributes with names matching regex]:regular expression' \ + '--one-file-system[skip files on different filesystems]' \ "--absolute-names[don't strip leading slash characters]" \ '--only-values[dump only attribute values]' \ '(-R --recursive)'{-R,--recursive}'[list attributes of all files and directories recursively]' \ diff --git a/Completion/Unix/Command/_dict b/Completion/Unix/Command/_dict index 202fc5bab..928728e06 100644 --- a/Completion/Unix/Command/_dict +++ b/Completion/Unix/Command/_dict @@ -21,6 +21,8 @@ _arguments -C -S \ '(--key -k)'{--key=,-k+}'[specify key for authentication]:shared secret:' \ '(-)'{--version,-V}'[display program version]' \ '(-)'{--license,-L}'[display program license]' \ + '(-6)-4[force use of IPv4 addresses only]' \ + '(-4)-6[force use of IPv6 addresses only]' \ '(-)--help[display usage info]' \ '(--verbose -v)'{--verbose,-v}'[verbose output]' \ '(--raw -r)'{--raw,-r}'[be very verbose]' \ diff --git a/Completion/Unix/Command/_dig b/Completion/Unix/Command/_dig index 5245a2964..3081e2cfd 100644 --- a/Completion/Unix/Command/_dig +++ b/Completion/Unix/Command/_dig @@ -24,10 +24,12 @@ local -a alts args '*+'{no,}'ednsnegotiation[set EDNS version negotiation]' '*+ednsopt=[specify EDNS option]:code point' '*+noedns[clear EDNS options to be sent]' + '*+'{no,}'expandaaaa[expand AAAA records]' '*+'{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,}'keepalive[request EDNS TCP keepalive]' '*+'{no,}'keepopen[keep TCP socket open between queries]' '*+'{no,}'mapped[allow mapped IPv4 over IPv6 to be used]' '*+'{no,}'recurse[set the RD (recursion desired) bit in the query]' @@ -40,12 +42,15 @@ local -a alts args '*+'{no,}'identify[print IP and port of responder]' '*+'{no,}'comments[print comment lines in output]' '*+'{no,}'stats[print statistics]' + '*+padding[set padding block size]:size [0]' '*+'{no,}'qr[print query as it was sent]' '*+'{no,}'question[print question section of a query]' + '*+'{no,}'raflag[set RA flag in the query]' '*+'{no,}'answer[print answer section of a reply]' '*+'{no,}'authority[print authority section of a reply]' '*+'{no,}'all[set all print/display flags]' '*+'{no,}'subnet[send EDNS client subnet option]:addr/prefix-length' + '*+'{no,}'tcflag[set TC flag in the query]' '*+timeout=[set query timeout]:timeout (seconds) [5]' '*+tries=[specify number of UDP query attempts]:tries' '*+retry=[specify number of UDP query retries]:retries' @@ -57,13 +62,12 @@ local -a alts args '*+'{no,}"fail[don't try next server on SERVFAIL]" '*+'{no,}'besteffort[try to parse even malformed messages]' '*+'{no,}'dnssec[request DNSSEC records]' - '*+'{no,}'sigchase[chase DNSSEC signature chains]' - '*+trusted-key=[specify file containing trusted keys]:file:_files' - '*+'{no,}'topdown[do DNSSEC validation in top down mode]' '*+'{no,}'nsid[include EDNS name server ID request in query]' '*+'{no,}'ttlid[display the TTL whening printing the record]' '*+'{no,}'ttlunits[display the TTL in human-readable units]' + '*+'{no,}'unexpected[print replies from unexpected sources]' '*+'{no,}'unknownformat[print RDATA in RFC 3597 "unknown" format]' + '*+'{no,}'yaml[present the results as YAML]' '*+'{no,}'zflag[set Z flag in query]' ) _arguments -s -C $args \ diff --git a/Completion/Unix/Command/_entr b/Completion/Unix/Command/_entr index 3e2261a18..438ab179a 100644 --- a/Completion/Unix/Command/_entr +++ b/Completion/Unix/Command/_entr @@ -11,6 +11,7 @@ _arguments -s -S \ '-p[postpone first execution of the utility]' \ '(-a)-r[reload a persistent child process]' \ '(*)-s[evaluate the first argument using interpreter specified by $SHELL]' \ + '-z[exit after the utility completes]' \ '(-): :->command' \ '*::arguments:_normal' && ret=0 diff --git a/Completion/Unix/Command/_gem b/Completion/Unix/Command/_gem index 53adfb89c..7e244ccad 100644 --- a/Completion/Unix/Command/_gem +++ b/Completion/Unix/Command/_gem @@ -196,7 +196,7 @@ if [[ $state = command ]]; then ) ;; environment) - args+=( '1:information:(packageversion gemdir gempath version remotesources platform)' ) + args+=( '1:information:(gemdir gempath version remotesources platform)' ) ;; fetch) def=( both \! local \! remote \! ) @@ -299,6 +299,9 @@ if [[ $state = command ]]; then '*:file:_files' ) ;; + yank) + args+=( '--otp=[specify code for multifactor authentication]:code' ) + ;; esac _arguments -C ${args:-'*: :_default'} \ '(-)'{-h,--help}'[display usage information]' \ diff --git a/Completion/Unix/Command/_getfacl b/Completion/Unix/Command/_getfacl index 15be06a1c..27b5ee1c8 100644 --- a/Completion/Unix/Command/_getfacl +++ b/Completion/Unix/Command/_getfacl @@ -22,6 +22,7 @@ _arguments -s -S \ '(-P --physical)'{-P,--physical}"[physical walk, don't follow symbolic links]" \ '(-t --tabular)'{-t,--tabular}'[use tabular output format]' \ '(-n --numeric)'{-n,--numeric}'[print numeric user/group identifiers]' \ + '--one-file-system[skip files on different filesystems]' \ '(-p --absolute-names)'{-p,--absolute-names}"[don't strip leading '/' in pathnames]" \ '(- *)'{-v,--version}'[display version information]' \ '(- *)'{-h,--help}'[display help information]' \ diff --git a/Completion/Unix/Command/_gnutls b/Completion/Unix/Command/_gnutls index 6c9956b10..b9f91264d 100644 --- a/Completion/Unix/Command/_gnutls +++ b/Completion/Unix/Command/_gnutls @@ -37,6 +37,8 @@ case "$service" in '--x509crlfile=[specify CRL file to use]:file:_files' '*--x509keyfile=[specify X.509 key file to use]:file:_files' '*--x509certfile=[specify X.509 certificate file to use]:file:_files' + '*--rawpkkeyfile=[specify private key file or URL to use]:file:_files' + '*--rawpkfile=[specify raw public-key file to use]:file:_files' '(-l --list -p --port)'{-l,--list}'[print list of the supported algorithms/modes]' '--keymatexport=[specify label used for exporting keying material]:label' '--keymatexportsize=[specify size of the exported keying material]:size' @@ -70,7 +72,8 @@ case "$service" in '--fastopen[enable TCP Fast Open]' "--print-cert[print peer's certificate in PEM format]" "--save-cert=[save peer's certificate chain in the specified file in PEM format]:file:_files" - "--save-ocsp=[save peer's OCSP status response in the provided file]:file:_files" + "(--save-ocsp-multi)--save-ocsp=[save peer's OCSP status response in the provided file]:file:_files" + "(--save-ocsp)--save-ocsp-multi=[save all peer's OCSP responses in the provided file]:file:_files" '--save-server-trace=[save the server-side TLS message trace in the provided file]:file:_files' '--save-client-trace=[save the client-side TLS message trace in the provided file]:file:_files' '--dh-bits=[specify minimum number of bits allowed for DH]:bits' @@ -93,6 +96,8 @@ case "$service" in '--inline-commands-prefix=[change delimiter used for inline commands]:delimiter [^]' '--fips140-mode[report status of FIPS140-2 mode in gnutls library]' '--logfile=[redirect informational messages to a specific file]:file:_files' + '--waitresumption[block waiting for the resumption data under TLS1.3]' + '--ca-auto-retrieve[enable automatic retrieval of missing CA certificates]' ) ;; @@ -109,6 +114,7 @@ case "$service" in "--nodb[don't use a resumption database]" '--http[act as an HTTP server]' '--echo[act as an Echo server]' + "--crlf[don't replace CRLF by LF in Echo server mode]" '(-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]' @@ -144,7 +150,8 @@ case "$service" in '--verify-crl[verify a CRL]' '(--verify-email)--verify-hostname=[specify hostname to be used for certificate chain verification]:hostname:_hosts' '(--verify-hostname)--verify-email=[specify email to be used for certificate chain verification]:email:_email_addresses' - '--verify-purpose=[specify a purpose OID to be used for certificate chain verification]' + '--verify-purpose=[specify a purpose OID to be used for certificate chain verification]:purpose' + '--verify-profile=[specify a security level profile to be used for verification]:profile' '--p7-sign[sign using a PKCS #7 structure]' '--p7-detached-sign[sign using a detached PKCS #7 structure]' "--no-p7-include-cert[don't include signer's certificate will in the cert list]" diff --git a/Completion/Unix/Command/_gprof b/Completion/Unix/Command/_gprof index 3bb7a5765..a7e602fd5 100644 --- a/Completion/Unix/Command/_gprof +++ b/Completion/Unix/Command/_gprof @@ -3,8 +3,8 @@ local curcontext="$curcontext" state line ret=1 typeset -A opt_args -_arguments -C -s -{a,b,c,D,h,i,l,L,s,T,v,w,x,y,z} \ - -{A,C,e,E,f,F,J,n,N,O,p,P,q,Q,Z}:'function name:->funcs' \ +_arguments -C -s -{a,b,c,D,h,i,l,L,r,s,T,v,w,x,y,z} \ + -{A,C,e,E,f,F,J,n,N,O,p,P,q,Q,R,S,t,Z}:'function name:->funcs' \ '-I:directory:_dir_list' \ '-d-:debug level:' '-k:function names:->pair' \ '-m:minimum execution count:' \ diff --git a/Completion/Unix/Command/_gzip b/Completion/Unix/Command/_gzip index 42d4ae705..8354b34d4 100644 --- a/Completion/Unix/Command/_gzip +++ b/Completion/Unix/Command/_gzip @@ -9,10 +9,14 @@ files=( '*:files:->files' ) case "$service" in unpigz|pigz) pigz=( - '(-K --zip)'{-K,--zip}'[compress to PKWare zip format]' + '(-A --alias)'{-A+,--alias=}'[specify filename to use in zip entry for stdin]:filename' + '(-C --comment)'{-C+,--comment=}'[put specified comment in the gzip or zip header]' + '(-H --huffman -U --rle)'{-H,--huffman}'[use only Huffman coding for compression]' + '(-U --rle -H --huffman)'{-U,--rle}'[use run-length encoding for compression]' + '(-K --zip -z --zlib)'{-K,--zip}'[compress to PKWare zip format]' '(-b --blocksize)'{-b+,--blocksize}'[set compression block size]:size (KiB)' '(-p --processes)'{-p,--processes}'[specify number of processes to use]' - '(-z --zlib)'{-z,--zlib}'[compress to zlib (.zz) format]' + '(-z --zlib -K --zip)'{-z,--zlib}'[compress to zlib (.zz) format]' '(-m --no-time)'{-m,--no-time}"[don't store/restore modification time in/from header]" '(-M --time)'{-M,--time}"[store/restore modification time in/from header]" '(--synchronous)-Y[force output file write to permanent storage]' diff --git a/Completion/Unix/Command/_iostat b/Completion/Unix/Command/_iostat index f5291a19b..1152b0d8b 100644 --- a/Completion/Unix/Command/_iostat +++ b/Completion/Unix/Command/_iostat @@ -128,10 +128,13 @@ case $OSTYPE:l in '-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)' + '-f[specify alternative directory to read device statistics from]:directory:_directories' + '+f[specify additional directory to read device statistics from]:directory:_directories' '*-g[display statistics for a group of devices]:group name' '-H[only display global statistics for group]' '(--human)-h[human readable device utilization report]' '--human[print sizes in human readable format]' + '--pretty[make report easier to read by a human]' '-j[display persistent device name]:name type:(ID LABEL PATH UUID)' '(-m)-k[display statistics in kB/s]' '(-k)-m[display statistics in MB/s]' diff --git a/Completion/Unix/Command/_java b/Completion/Unix/Command/_java index ee0441d97..ff6e82645 100644 --- a/Completion/Unix/Command/_java +++ b/Completion/Unix/Command/_java @@ -24,18 +24,24 @@ javac) '(-cp -classpath)'{-cp,-classpath}'[specify where to find user class files]:class path:->classpath' \ '-sourcepath[specify where to find input source files]:source path:->sourcepath' \ '-bootclasspath[override location of bootstrap class files]:bootstrap class path:->bootstrapclasspath' \ + '-endorseddirs[override location of endorsed standards path]:path:->extdirs' \ '-extdirs[override location of installed extensions]:extensions directories:->extdirs' \ '-d[specify where to place generated class files]:directory:_files -/' \ '-encoding[specify character encoding used by source files]:encoding:->encoding' \ '-proc\:-[control annotation processing]:annotation processing:(none only)' \ '-processor[specify annotation processors to run]:class:_files' \ '-processorpath[specify where to find annotation processors]:directory:_directories' \ + '-parameters[generate metadata for reflection on method parameters]' \ '-s[specify directory for generated source files]:directory:_directories' \ + '-h[specify where to place generated native header files]:directory:_directories' \ '-source[provide source compatibility with specified release]:release:(1.{2..8} {5..8})' \ '-target[specify VM version]:release:(1.{1..5})' \ + '-profile[check that API used is available in the specified profile]:profile' \ '(-)-help[print a synopsis of standard options]' \ '(-)-version[print version information]' \ '(-)-X[display information about non-standard options]' \ + '-J-[pass flag directly to the runtime system]:flag' \ + '-Werror[terminate compilation if warnings occur]' \ '*:java source file:_files -g \*.java\(-.\)' && return 0 ;; @@ -75,6 +81,7 @@ java) '(- 1)-'{\?,help}'[print help message]' \ '(- 1)-X-[non-standard java option]:option' \ '(- 1)-jar[specify a program encapsulated as jar]:jar:_files -g \*.jar\(-.\)' \ + '-splash\:-[show splash screen with specified image]:image:_files' \ '(-):class:_java_class -m main ${(kv)opt_args[(i)(-classpath|-cp)]}' \ '*::args:= _normal' \ && return 0 @@ -90,15 +97,20 @@ javadoc) '-help[print help message]' \ '-doclet[specify a doclet]:doclet:_java_class -t doclet ${(kv)opt_args[(i)-classpath]}' \ '-docletpath[specify a path to search doclet]:doclet path:->docletpath' \ - '-1.1[Javadoc 1.1 compatible output]' \ '-sourcepath[specify path for source files]:source path:->sourcepath' \ - '-classpath[specify path for user class files]:class path:->classpath' \ + {-cp,-classpath}'[specify path for user class files]:class path:->classpath' \ + '-exclude[specify a list of packages to exclude]:package list' \ + '-subpackages[specify subpackages to recursively load]:subpackage list' \ + '-breakiterator[compute first sentence with BreakIterator]' \ '-bootclasspath[specify path for bootstrap class files]:bootstrap class path:->bootstrapclasspath' \ + '-source[provide source compatibility with specified release]:release' \ '-extdirs[specify directories for extensions]:extensions directories:->extdirs' \ '-verbose[print verbose messages]' \ '-locale[specify locale]:language_country_variant:' \ '-encoding[specify character encoding for source files]:encoding:->encoding' \ + "-quiet[don't display status messages]" \ '-J-[specify java option]:java option:' \ + '-X[print a synopsis of nonstandard options and exit]' \ '-d[specify destination directory]:destination directory:_files -/' \ '-use[display pages for use]' \ '-version[include @version text]' \ @@ -111,15 +123,27 @@ javadoc) '-bottom[specify bottom text]:bottom text:' \ '-link[generate a link to external reference classes]:document URL:' \ '-linkoffline[generate a link for external reference class names]:document URL::package list URL:' \ + '-excludedocfilessubdir[exclude any doc-files subdirectories with given name]:name:_directories' \ '-group[generate tables for each group]:group heading::package patterns:' \ - '-nodeprecated[do not document deprecated API]' \ - '-nodeprecatedlist[do not generate deprecated API list]' \ - '-notree[do not generate class and interface hierarchy]' \ - '-noindex[do not generate index]' \ - '-nohelp[do not generate help link]' \ - '-nonavbar[do not generate navigation bar]' \ + "-nodeprecated[don't include @deprecated information]" \ + '-noqualifier[exclude the list of qualifiers from the output]:qualifier list' \ + "-nosince[don't include @since information]" \ + "-notimestamp[don't include hidden time stamp]" \ + "-nodeprecatedlist[don't generate deprecated API list]" \ + "-notree[don't generate class and interface hierarchy]" \ + "-noindex[don't generate index]" \ + "-nohelp[don't generate help link]" \ + "-nonavbar[don't generate navigation bar]" \ + '-serialwarn[generate warning about @serial tag]' \ + '*-tag[specify single argument custom tag]:tag' \ + '-taglet[specify fully qualified name of Taglet to register]:taglet' \ + '-tagletpath[specify path to Taglets]:path:_directories' \ + '-charset[specify charset of generated documentation]:charset:->encoding' \ '-helpfile[specify alternative help link]:helpfile path/filename:' \ - '-stylesheet[specify alternative HTML style sheet]:stylesheet path/filename:' \ + '-linksource[generate source in HTML]' \ + '-sourcetab[specify the number of spaces each tab takes up in the source]:spaces' \ + '-keywords[include HTML meta tags with package, class and member info]' \ + '-stylesheetfile[specify alternative HTML style sheet]:stylesheet path/filename:_directories' \ '-docencoding[specify character encoding for output HTML files]:encoding:->encoding' \ '*:package name, source file or @list:->docsrc' && ret=0 ;; @@ -143,9 +167,11 @@ jar) 'f[specify archive file]' \ 'v[verbose mode]' \ '(e)m[specify manifest file]' \ + 'n[perform Pack200 normalization after creating a new archive]' \ '(m)e[specify class of for application entry point]' \ '0[store only without using ZIP compression]' \ - 'M[do not create manifest file]' \ + "M[don't create manifest file]" \ + "P[preserve leading / and .. components on file names]" \ 'i[generate index information for specified jar files]' && return else jar_cmd="${words[2]#-}" @@ -171,7 +197,7 @@ javah|javah_g) '-help[print help message]' \ '-version[print version]' \ '-jni[JNI-style native method function prototypes]' \ - '-classpath[specify path for user class files]:class path:->classpath' \ + {-cp,-classpath}'[specify path for user class files]:class path:->classpath' \ '-bootclasspath[specify path for bootstrap class files]:bootstrap class path:->bootstrapclasspath' \ '-old[generate old JDK1.0-style header files]' \ '-force[force output]' \ @@ -182,17 +208,19 @@ javah|javah_g) javap) _arguments -C \ '-help[print help message]' \ + '-version[print version information]' \ + {-v,-verbose}'[print additional information]' \ '-l[line and local variable tables]' \ - '-b[backward compatible to JDK1.1]' \ - '-public[only public classes and members]' \ - '-protected[only protected and public classes and members]' \ - '-package[only package, protected and public classes and members (default)]' \ - '-private[all classes and members]' \ + '(-protected -package -p -private)-public[show only public classes and members]' \ + '(-public -package -p -private)-protected[show only protected/public classes and members]' \ + '(-public -protected -p -private)-package[show only package/protected/public classes and members (default)]' \ + '(-public -package -protected -p -private)'{-p,-private}'[show all classes and members]' \ '-J-[specify java option]:java option:' \ - '-s[internal type signatures]' \ '-c[disassemble code]' \ - '-verbose[stack size, number of locals and args for methods]' \ - '-classpath[specify path for user class files]:class path:->classpath' \ + '-s[print internal type signatures]' \ + '-sysinfo[show system info (path, size, date, MD5 hash) of class being processed]' \ + '-constants[show final constants]' \ + {-cp,-classpath}'[specify path for user class files]:class path:->classpath' \ '-bootclasspath[specify path for bootstrap class files]:bootstrap class path:->bootstrapclasspath' \ '-extdirs[specify directories for extensions]:extensions directories:->extdirs' \ '*:class:_java_class ${(kv)opt_args[(i)-classpath]}' && return 0 diff --git a/Completion/Unix/Command/_less b/Completion/Unix/Command/_less index cb71314a6..0b474b991 100644 --- a/Completion/Unix/Command/_less +++ b/Completion/Unix/Command/_less @@ -1,7 +1,7 @@ #compdef less -value-,LESS,-default- -value-,LESSCHARSET,-default- -local curcontext="$curcontext" state line expl ret=1 -local -a files +local curcontext="$curcontext" fgbg=foreground ret=1 +local -a state line expl files basic suf case $service in *LESSCHARSET*) @@ -37,15 +37,15 @@ _arguments -S -s -A "[-+]*" \ '(-b --buffers)'{-b+,--buffers=}'[specify amount of buffer space used for each file]:buffer space (kilobytes)' \ '(-B --auto-buffers)'{-B,--auto-buffers}"[don't automatically allocate buffers for pipes]" \ '(-C --CLEAR-SCREEN -c --clear-screen)'{-c,--clear-screen}'[repaint screen instead of scrolling]' \ - '(-c --clear-screen -C --CLEAR-SCREEN)'{-C,--CLEAR-SCREEN}'[clear screen before repaints]' \ + '!(-c --clear-screen)'{-C,--CLEAR-SCREEN} \ '(-d --dumb)'{-d,--dumb}'[suppress error message if terminal is dumb]' \ + '*-D+[set screen colors]: :->colors' \ '(-e -E --quit-at-eof --QUIT-AT-EOF)'{-e,--quit-at-eof}'[exit the second time end-of-file is reached]' \ '(-e -E --quit-at-eof --QUIT-AT-EOF)'{-E,--QUIT-AT-EOF}'[exit when end-of-file is reached]' \ '(-f --force)'{-f,--force}'[force opening of non-regular files]' \ '(-F --quit-if-one-screen)'{-F,--quit-if-one-screen}'[exit if entire file fits on first screen]' \ '(-G --HILITE-SEARCH -g --hilite-search)'{-g,--hilite-search}'[highlight only one match for searches]' \ '(-g --hilite-search -G --HILITE-SEARCH)'{-G,--HILITE-SEARCH}'[disable highlighting of search matches]' \ - '--old-bot[revert to the old bottom of screen behavior]' \ '(-h --max-back-scroll)'{-h+,--max-back-scroll=}'[specify backward scroll limit]:backward scroll limit (lines)' \ '(-I --IGNORE-CASE -i --ignore-case)'{-i,--ignore-case}'[ignore case in searches that lack uppercase]' \ '(-i --ignore-case -I --IGNORE-CASE)'{-I,--IGNORE-CASE}'[ignore case in all searches]' \ @@ -83,18 +83,49 @@ _arguments -S -s -A "[-+]*" \ '(-\" --quotes)'{-\"+,--quotes=}'[change quoting character]:quoting characters' \ '(-~ --tilde)'{-~,--tilde}"[don't display tildes after end of file]" \ '(-\# --shift)'{-\#+,--shift=}"[specify amount to move when scrolling horizontally]:number" \ + '--file-size[automatically determine the size of the input file]' \ + '--incsearch[search file as each pattern character is typed in]' \ + '--line-num-width=[set the width of line number field]:width [7]' \ '--follow-name[the F command changes file if the input file is renamed]' \ '--mouse[enable mouse input]' \ '--no-histdups[remove duplicates from command history]' \ '--rscroll=[set the character used to mark truncated lines]:character [>]' \ '--save-marks[retain marks across invocations of less]' \ + '--status-col-width=[set the width of the -J status column]:width [2]' \ '--use-backslash[subsequent options use backslash as escape char]' \ + '--use-color[enable colored text]' \ '--wheel-lines=[specify lines to move for each click of the mouse wheel]:lines' \ "$files[@]" && ret=0 if [[ -n "$state" ]]; then case $state in + colors) + if compset -P 1 \?; then + [[ $IPREFIX[-1] != [a-z] ]] || compset -P 1 + || _describe 'color application' '( +:add\ to\ existing\ attribute )' + suf=( -S '' ) + compset -P 1 '([a-zA-Z]|*.)' && fgbg=background && suf=() + basic=( B:blue C:cyan G:green K:black M:magenta R:red W:white Y:yellow ) + _describe -t colors "$fgbg color" \ + "( -:default ${(j. .)${(@)basic/:/:light\ }} ${(Lj. .)basic} )" "$suf[@]" && ret=0 + else + _describe 'text' '( + B:binary\ characters + C:control\ characters + E:errors\ and\ informational\ messages + M:mark\ letters\ in\ the\ status\ column + N:line\ numbers\ enabled\ via\ the\ -N\ option + P:prompts + R:the\ rscroll\ character + S:search\ results + W:the\ highlight\ enabled\ via\ the\ -w\ option + d:bold\ text + k:blinking\ text + s:standout\ text + u:underlined\ text + )' -S '' && ret=0 + fi + ;; prompts) if compset -p 1; then _message -e prompt diff --git a/Completion/Unix/Command/_mtr b/Completion/Unix/Command/_mtr index 806e344d1..9a73cfbd4 100644 --- a/Completion/Unix/Command/_mtr +++ b/Completion/Unix/Command/_mtr @@ -4,6 +4,7 @@ _arguments -s -S \ '(H -F --filename)'{-F,--filename}'[read hostnames from a file]' \ '(H -6)-4[use IPv4 only]' \ '(H -4)-6[use IPv6 only]' \ + '(H -I --interface)'{-I+,--interface=}'[use named network interface]: :_net_interfaces' \ '(H -a --address)'{-a+,--address=}'[bind outgoing packets to specific interface]:source IP:_hosts' \ '(H -f --first-ttl)'{-f+,--first-ttl=}'[specify TTL to start]:TTL [1]' \ '(H -m --max-ttl)'{-m+,--max-ttl=}'[specify maximum number of hops to probe]:hops [30]' \ @@ -17,7 +18,6 @@ _arguments -s -S \ '(H -Q --tos)'{-Q+,--tos=}'[specify type of service for IP header]:tos (0-255)' \ '(H -e --mpls)'{-e,--mpls}'[display ICMP MPLS information]' \ '(H -Z --timeout)'{-Z+,--timeout=}'[specify how long to keep probe sockets open before giving up on the connection]:timeout (seconds)' \ - '(H -M --mark)'{-M+,--mark=}'[mark each sent packet]:mark' \ '(H -r --report)'{-r,--report}'[report mode]' \ '(H -w --report-wide)'{-w,--report-wide}"[wide report mode\: don't truncate hostnames]" \ '(H -c --report-cycles)'{-c+,--report-cycles=}'[report cycles]:number of pings' \ diff --git a/Completion/Unix/Command/_nm b/Completion/Unix/Command/_nm index 2f608c5fc..79f537ac6 100644 --- a/Completion/Unix/Command/_nm +++ b/Completion/Unix/Command/_nm @@ -62,7 +62,8 @@ if _pick_variant -r variant binutils=GNU elftoolchain=elftoolchain elfutils=elfu '!(--no-recurse-limit)--recurse-limit' '--no-recurse-limit[disable demangling recursion limit]' '(-f --format -P)-f+[specify output format]:format:(bsd sysv posix)' - '(-C --no-demangle)--demangle=-[decode symbol names]::style:(auto gnu lucid arm hp edg gnu-v3 java gnat rust dlang)' + '(-C --no-demangle)--demangle=-[decode symbol names]::style [auto]:(auto gnu lucid arm hp edg gnu-v3 java gnat rust dlang)' + '--ifunc-chars=[specify characters to use for indirect function symbols]:characters for global/local indirect function symbols [ii]' '--plugin[load specified plugin]:plugin' '--special-syms[include special symbols in the output]' '--synthetic[display synthetic symbols as well]' diff --git a/Completion/Unix/Command/_objdump b/Completion/Unix/Command/_objdump index 5152e6b6e..e2dde7e4c 100644 --- a/Completion/Unix/Command/_objdump +++ b/Completion/Unix/Command/_objdump @@ -67,7 +67,8 @@ case $variant in '(-z --disassemble-zeroes)'{-z,--disassemble-zeroes}"[don't skip blocks of zeroes when disassembling]" '--start-address=[only process data whose address is >= ADDR]:address' - '--stop-address=[only process data whose address is <= ADDR]:address' + '--stop-address=[only process data whose address is < ADDR]:address' + "--no-addresses[don't print address alongside disassembly]" '--prefix-addresses[print complete address alongside disassembly]' '(--show-raw-insn --no-show-raw-insn)'--{,no-}show-raw-insn'[display hex alongside symbolic disassembly]' '--insn-width=[display specified number of bytes on a single line with -d]:width (bytes)' @@ -80,6 +81,7 @@ case $variant in '--dwarf-start=[display DIEs at specified or deeper depth]:depth' '--dwarf-check[perform additional dwarf internal consistency checks]' '--ctf-parent=[use specified section as the CTF parent]:section' + '--visualize-jumps=-[visualize jumps by drawing ASCII art lines]::color:(color extended-color off)' ) ;; elfutils) @@ -165,6 +167,7 @@ case "$state" in _values -s "" "dwarf section" \ "l[rawline]" "L[decodedline]" "i[info]" "a[abbrev]" "p[pubnames]" \ "r[aranges]" "m[macro]" "f[frames]" "F[frames-interp]" "s[str]" \ + 'O[str-offsets]' \ "o[loc]" "R[ranges]" "t[pubtypes]" "U[trace_info]" "u[trace_abbrev]" \ "T[trace_aranges]" "g[gdb_index]" "A[addr]" "c[cu_index]" "k[links]" \ "K[follow-links]" && ret=0 @@ -172,7 +175,7 @@ case "$state" in dwarf-names) _sequence _wanted dwarf-sections expl "dwarf section" compadd - \ rawline decodedline info abbrev pubnames aranges macro frames \ - frames-interp str loc Ranges pubtypes gdb_index trace_info \ + frames-interp str str-offsets loc Ranges pubtypes gdb_index trace_info \ trace_abbrev trace_aranges addr cu_index links follow-links && ret=0 ;; bfdnames) diff --git a/Completion/Unix/Command/_patchutils b/Completion/Unix/Command/_patchutils index 50ea3e4c4..a5f6441b1 100644 --- a/Completion/Unix/Command/_patchutils +++ b/Completion/Unix/Command/_patchutils @@ -85,6 +85,7 @@ case $service in '(-H --with-filename -h --no-filename)'{-h,--no-filename}"[don't print the name of the patch file containing each patch]" '(-f --file)'{-f+,--file=}'[read regular expressions from file]:file:_files' '--output-matching=[display the matching hunk- or file-level diffs]:level:(hunk file)' + '--only-match=[restrict regex to matching removals, additions or modifications]:limit:(rem removals add additions mod modifications all)' ) ;; splitdiff) diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index 38b1aebd8..afd2fe54b 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -31,6 +31,7 @@ arguments=( '(-M)-N+[extract name list from specified system]:system file:_files' '(-o -n --oldest --newest)'{-n,--newest}'[match newest process]' '(-o -n --oldest --newest)'{-o,--oldest}'[match oldest process]' + '(-O --older)'{-O+,--older=}'[select where older than specified age]:age (seconds)' '(-P --parent)'{-P+,--parent=}'[match only on specified parent process IDs]: :->ppid' '(-l)-q[suppress normal output]' '(-r --runstates)'{-r+,--runstates}'[match runstates]:run state:compadd -S "" D I R S T t W X Z' @@ -62,8 +63,8 @@ arguments=( case $OSTYPE in linux*) # Note: We deliberately exclude -v but not --inverse from pkill - pgopts=acdFfGghLlnoPrstUuVvwx- - pkopts=ceFfGghLnoPstUuVx- + pgopts=acdFfGghLlnoOPrstUuVvwx- + pkopts=ceFfGghLnoOPstUuVx- arguments=( ${arguments:#((#s)|*\))(\*|)-[acl]*} '(-c --count)'{-c,--count}'[display count of matching processes]' diff --git a/Completion/Unix/Command/_rar b/Completion/Unix/Command/_rar index 68982be60..d1d381974 100644 --- a/Completion/Unix/Command/_rar +++ b/Completion/Unix/Command/_rar @@ -4,6 +4,8 @@ local common expl common=( '-ad[append archive name to destination path]' + '-ad1[create a separate folder for files unpacked from each archive]' + "-ad2[like -ad1 but use archives' own folders]" '-ap[set path inside archive]' '-av\-[disable authenticity verification check]' '-c\-[disable comments show]' @@ -13,6 +15,7 @@ common=( '-dh[open shared files]' '-ep[exclude paths from name]' '-f[freshen files]' + '-idn[hide archived names]' '-idp[disable percentage display]' '-ierr[send all messages to stderr]' '-inul[disable all messages]' @@ -27,6 +30,7 @@ common=( '-tb+[process files modified before a date]:date (YYYYMMDDHHMMSS)' '-tn+[process files newer than a specified time]:time' '-to+[process files older than a specified time]:time' + '-ts-[save or restore time]:time:((m\:modification c\:change a\:access p\:preserve))' '-u[update files]' '-v[create volumes with size autodetection or list all volumes]' '-ver[file version control]' diff --git a/Completion/Unix/Command/_readelf b/Completion/Unix/Command/_readelf index edabc3da1..fc0fb7ce1 100644 --- a/Completion/Unix/Command/_readelf +++ b/Completion/Unix/Command/_readelf @@ -18,7 +18,7 @@ args=( '(-c --archive-index)'{-c,--archive-index}'[show symbol/file index in an archive]' \*{-x,--hex-dump=}"[dump contents of specified section as bytes]:section:($sections)" \*{-p,--string-dump=}"[dump contents of specified section as strings]:section:($sections)" - '-w+[show the contents of DWARF2 debug sections]::debug section:(l L i a p r m f F s o R t U u T g A c k K)' + '-w+[show the contents of DWARF2 debug sections]::debug section:(l L i a p r m f F s o O R t U u T g A c k K)' '--debug-dump=[show the contents of DWARF2 debug sections]::section:(rawline decodedline info abbrev pubnames aranges macro frames frames-interp str loc Ranges pubtypes gdb_index trace_info trace_abbrev trace_aranges addr cu_index links follow-links)' '(-I --histogram)'{-I,--histogram}'[show histogram of bucket list lengths]' '(-W --wide)'{-W,--wide}'[allow output width to exceed 80 characters]' @@ -50,6 +50,12 @@ case $variant in ;| binutils) args+=( + '!(-C --demangle)--no-demangle' + '(--demangle)-C[decode symbol names]' + '(-C)--demangle=-[decode symbol names]::style [auto]:(auto gnu lucid arm hp edg gnu-v3 java gnat)' + '!(--no-recurse-limit)--recurse-limit' + '--no-recurse-limit[disable demangling recursion limit]' + '(-L --lint --enable-checks)'{-L,--lint,--enable-checks}'[display warning messages for possible problems]' \*{-R,--relocated-dump=}"[dump contents of specified section as relocated bytes]:section:($sections)" "--dwarf-depth=[don't show DIEs at greater than specified depth]:depth" '--dwarf-start=[show DIEs starting at specified depth or deeper]:depth' @@ -57,6 +63,7 @@ case $variant in '--ctf-parent=[use specified section as the CTF parent]:section' '--ctf-symbols=[use specified section as the CTF external symbol table]:section' '--ctf-strings=[use specified section as the CTF external string table]:section' + '(-T --silent-truncation)'{-T,--silent-truncation}"[if a symbol name is truncated, don't add ... suffix]" ) ;; elfutils) diff --git a/Completion/Unix/Command/_ri b/Completion/Unix/Command/_ri index 070f46ac2..4d5a72985 100644 --- a/Completion/Unix/Command/_ri +++ b/Completion/Unix/Command/_ri @@ -6,26 +6,29 @@ typeset -A opt_args _arguments -C \ '(- *)'{-h,--help}'[print help information and exit]' \ '(- *)'{-v,--version}'[display the version of ri]' \ - '*'{-d,--doc-dir}'[directory to search for documentation]:ri doc directory:_files -/' \ - '(-f --fmt --format)'{-f,--fmt,--format}'[format to use when displaying output]:output format:(ansi bs html plain simple)' \ + '*'{-d+,--doc-dir=}'[directory to search for documentation]:ri doc directory:_directories' \ + '(-f --format)'{-f+,--format=}'[format to use when displaying output]:output format [bs]:(ansi bs markdown rdoc)' \ '(-T --no-pager)'{-T,--no-pager}'[send output directly to stdout]' \ - '(-i, --interactive)'{-i,--interactive}'[interactive mode]' \ + '(-i --interactive)'{-i,--interactive}'[interactive mode]' \ + '(-a --all)'{-a,--all}'[show all documentation for a class or module]' \ + '(-l --list)'{-l,--list}'[list classes ri knows about]' \ '--list-doc-dirs[list the directories from which ri will source documentation]' \ - '(-w --width)'{-w,--width}'[set the width of the output]:output width:' \ - '--no-standard-docs[do not include documentation from the Ruby standard library, site_lib, installed gems, or ~/.rdoc]' \ - '(--no-use-cache --use-cache)--'{no-,}'use-cache[whether or not to use ri'\''s cache]' \ - '(--no-system --system)--'{no-,}'system[include documentation from Ruby'\''s standard library]' \ + '(-w --width)'{-w+,--width=}'[set the width of the output]:output width [72]' \ + '(-l --list)--server=-[run RDoc server on the given port]::port [8214]:_ports' \ + "--no-standard-docs[don't include documentation from the Ruby standard library, site_lib, installed gems, or ~/.rdoc]" \ + '(--no-use-cache --use-cache)--'{no-,}"use-cache[whether or not to use ri's cache]" \ + '(--no-system --system)--'{no-,}"system[include documentation from Ruby's standard library]" \ '(--no-site --site)--'{no-,}'site[include documentation from libraries installed in site_lib]' \ '(--no-gems --gems)--'{no-,}'gems[include documentation from RubyGems]' \ '(--no-home --home)--'{no-,}'home[include documentation stored in ~/.rdoc]' \ - '*:ri name:->ri-name' && ret=0 + '--profile[run with the Ruby profiler]' \ + '--dump=[dump data from an ri cache or data file]:cache:_files' \ + '*:ri name:->ri-name' && return if [[ "$state" = ri-name ]]; then local -a ri_dirs ri_ext ri_names ri_wants ri_names local class_dir esc_name dir curtag tag descr expl - ret=1 - if "ruby${words[1]#ri}" -rrdoc/ri/ri_options -e 1 >/dev/null 2>&1; then # Old-style Ruby 1.8.x RI ri_dirs=( ${(f)"$(_call_program ri-names "ruby${words[1]#ri}" -rrdoc/ri/ri_options -e '"o = RI::Options.instance; o.parse(ARGV); o.path.each { |p| puts p }"' -- ${(kv)opt_args[(I)-d|--doc-dir|--(system|site|gems|home)]})"} ) diff --git a/Completion/Unix/Command/_ruby b/Completion/Unix/Command/_ruby index a57bffcda..0e1f5dbc0 100644 --- a/Completion/Unix/Command/_ruby +++ b/Completion/Unix/Command/_ruby @@ -15,7 +15,7 @@ all=( common=( '*-I+[specify $LOAD_PATH directory (may be used more than once)]:library directory:_files -/' '-w[turn warnings on for your script]' - '-W-[set warning level]:warning level:((0\:silent 1\:medium 2\:verbose))' + '-W-[set warning level]:warning level:((0\:silent 1\:medium 2\:verbose \\\:deprecated \\\:experimental))' '(-)1:ruby script:_files -g "*.rb(-.)"' '*::script argument:= ->normal' ) @@ -35,7 +35,7 @@ opts=( '(-n)-p[assume loop like -n but print line also like sed]' '-s[enable some switch parsing for switches after script name]' '-S[look for the script using PATH environment variable]' - '-T-[turn on tainting checks]::taint level [1]:((0\:strings\ from\ streams/environment/ARGV\ are\ tainted 1\:no\ dangerous\ operation\ by\ tainted\ value 2\:process/file\ operations\ prohibited 3\:all\ generated\ objects\ are\ tainted 4\:no\ global\ \(non-tainted\)\ variable\ modification/no\ direct\ output))' + '!-T-[turn on tainting checks]::taint level [1]:((0\:strings\ from\ streams/environment/ARGV\ are\ tainted 1\:no\ dangerous\ operation\ by\ tainted\ value 2\:process/file\ operations\ prohibited 3\:all\ generated\ objects\ are\ tainted 4\:no\ global\ \(non-tainted\)\ variable\ modification/no\ direct\ output))' '(--verbose)-v[print version number, then turn on verbose mode]' '(-v)--verbose[turn on verbose mode and disable script from stdin]' '-x-[strip off text before #!ruby line and perhaps cd to directory]:directory:_files -/' @@ -49,11 +49,11 @@ opts=( '--jit[enable jit with default options]' '--jit-warnings[enable printing JIT warnings]' '--jit-debug[enable JIT debugging (very slow)]' - '--jit-wait[wait until JIT compilation is finished every time (for testing)]' + '--jit-wait[wait until JIT compilation finishes every time (for testing)]' '--jit-save-temps[save JIT temporary files]' '--jit-verbose=-[print JIT logs of level num or less to stderr]:maximum log level [0]' - '--jit-max-cache=-[specify max number of methods to be JIT-ed in a cache]:number [1000]' - '--jit-min-calls=-[specify number of calls to trigger JIT]:calls [5]' + '--jit-max-cache=-[specify max number of methods to be JIT-ed in a cache]:number [100]' + '--jit-min-calls=-[specify number of calls to trigger JIT]:calls [10000]' ) irb=( diff --git a/Completion/Unix/Command/_script b/Completion/Unix/Command/_script index ac3bf3973..7a3960be0 100644 --- a/Completion/Unix/Command/_script +++ b/Completion/Unix/Command/_script @@ -4,14 +4,19 @@ local args hlp="-h --help -V --version" if [[ $service = scriptreplay ]]; then _arguments -S -s \ - "(1 -t --timing $hlp)"{-t+,--timing=}'[specify file containing timing output]:timing file:_files' \ - "(2 -s --typescript $hlp)"{-s+,--typescript=}'[specify file containing terminal output]:typescript file:_files' \ + "(1 -t --timing -T --log-timing $hlp)"{-t+,-T+,--timing=,--log-timing=}'[specify file containing timing output]:timing file:_files' \ + "(-I --log-in -B --log-io $hlp)"{-I+,--log-in=}'[specify file containing terminal input]:file:_files' \ + "(2 -s --typescript -B --log-io $hlp)"{-s+,-O+,--typescript=,--log-out=}'[specify file containing terminal output]:typescript file:_files' \ + "(-B --log-io -I --log-in -s -O --typescript --log-out $hlp)"{-B,--log-io}'[specify file containing terminal input and output]' \ + "($hlp)--summary[display overview about recorded session and exit]" \ "(3 -d --divisor $hlp)"{-d+,--divisor=}'[speed up replay]:factor' \ "(-m --maxdelay $hlp)"{-m+,--maxdelay=}'[set maximum delay between updates]:delay (seconds)' \ + "(-x --stream $hlp)"{-x+,--stream=}'[specify stream type]:name:(out in signal or info)' \ + "(-c --cr-mode $hlp)"{-c+,--cr-mode=}'[specify CR char mode]:mode:(auto never always)' \ '(- *)'{-h,--help}'[display help information]' \ '(- *)'{-V,--version}'[display version information]' \ "(-t --timing $hlp):timing file:_files" \ - "(-s --typescript $hlp):typescript file:_files" \ + "(-s --typescript -O --log-out $hlp):typescript file:_files" \ "(-d --divisor $hlp): :_guard '[0-9.]#' 'timing divisor'" return fi @@ -19,12 +24,18 @@ fi case $OSTYPE in linux*) args=( -S - "(-a --append $hlp)"{-a,--append}'[append output]' + "(-I --log-in $hlp)"{-I,--log-in}'[log stdin to file]:file:_files' + "(-O --log-out $hlp)"{-O,--log-out}'[log stdout to file]:file:_files' + "(-B --log-io $hlp)"{-B,--log-io}'[log stdin and stdout to file]:file:_files' + "(-T --log-timing -t --timing $hlp)"{-T+,--log-timing=}'[log timing information to file]:file:_files' + "(-m --logging-format $hlp)"{-m+,--logging-format=}'[specify log file format]:format:(classic advanced)' + "(-a --append $hlp)"{-a,--append}'[append to the log file]' "(-c --command $hlp)"{-c,--command=}'[run specified command instead of a shell]:command:_cmdstring' "(-e --return $hlp)"{-e,--return}'[return exit status of the child process]' "(-f --flush $hlp)"{-f,--flush}'[flush output after each write]' + "(-E --echo $hlp)"{-E+,--echo=}'[echo input]:when:(auto always never)' "($hlp)--force[use output file even when it is a link]" - '(-o --output-limit)'{-o+,--output-limit=}'[terminate if output files exceed specified size]:size (bytes)' + "(-o --output-limit $hlp)"{-o+,--output-limit=}'[terminate if output files exceed specified size]:size (bytes)' "(-q --quiet $hlp)"{-q,--quiet}'[be quiet]' "(-t --timing $hlp)"{-t-,--timing=-}'[output timing data]::timing file:_files' '(- 1)'{-h,--help}'[display help information]' diff --git a/Completion/Unix/Command/_sqlite b/Completion/Unix/Command/_sqlite index 0f03c61c1..7ef3c6daa 100644 --- a/Completion/Unix/Command/_sqlite +++ b/Completion/Unix/Command/_sqlite @@ -22,7 +22,7 @@ options+=( ) output_modes=( column HTML line list ) -(( $+sqlite3 )) && output_modes+=( ascii csv quote ) +(( $+sqlite3 )) && output_modes+=( ascii box csv json markdown quote table tabs ) exclusive=( $^dashes-${^output_modes:l} ) for display_opt in $output_modes ; do # finagle the description to match the way SQLite's -help formats them @@ -54,6 +54,7 @@ options+=( $^dashes'-memtrace[trace all memory allocations and deallocations]' $^dashes'-mmap[set default mmap size]:size' $^dashes'-newline[set output row separator]:separator [\n]' + $^dashes'-nofollow[refuse to open symbolic links to database files]' $^dashes'-pagecache[specify size and number of slots for page cache memory]:size (bytes): :slots' $^dashes'-readonly[open the database read-only]' $^dashes'-stats[print memory stats before each finalize]' diff --git a/Completion/Unix/Command/_strip b/Completion/Unix/Command/_strip index e7f3418d7..3e1a6b698 100644 --- a/Completion/Unix/Command/_strip +++ b/Completion/Unix/Command/_strip @@ -32,6 +32,7 @@ if _pick_variant gnu=GNU solaris --version; then "--no-merge-notes[don't attempt to remove redundant notes]" '*'{-K+,--keep-symbol=}'[keep given symbol]:symbol name' '*'{-N+,--strip-symbol=}'[strip given symbol]:symbol name' + "*--keep-section=[don't strip given section]:section" '(*)-o+[output file]:output file:_files' '(-p --preserve-dates)'{-p,--preserve-dates}'[preserve access and modification dates]' '(-w --wildcard)'{-w,--wildcard}'[permit wildcards in symbol names]' diff --git a/Completion/Unix/Command/_sudo b/Completion/Unix/Command/_sudo index e3d12d72f..29e5e6d75 100644 --- a/Completion/Unix/Command/_sudo +++ b/Completion/Unix/Command/_sudo @@ -14,7 +14,9 @@ done args=( '(-A --askpass)'{-A,--askpass}'[use a helper program for password prompting]' + '(-B --bell)'{-B,--bell}'[ring bell when prompting]' '(-C --close-from)'{-C+,--close-from=}'[close file descriptors]:lowest fd to close' + '(-D --chdir)'{-D+,--chdir=}'[change the working directory before running command]:directory:_directories' '(-g --group)'{-g+,--group=}'[run command as the specified group name or ID]:group:_groups' '(-)'{-h,--help}'[display help message and exit]' '(-h --host)'{-h+,--host=}'[run command on host]:host:_hosts' @@ -23,6 +25,7 @@ args=( \*{-l,--list}"[list user's privileges or check a specific command]" '(-n --non-interactive)'{-n,--non-interactive}'[non-interactive mode, no prompts are used]' '(-p --prompt)'{-p+,--prompt=}'[use the specified password prompt]:prompt' + '(-R --chroot)'{-R+,--chroot=}'[change the root directory before running command]:directory:_directories' '(-r --role)'{-r+,--role=}'[create SELinux security context with specified role]: :_selinux_roles' '(-S --stdin)'{-S,--stdin}'[read password from standard input]' '(-t --type)'{-t+,--type=}'[create SELinux security context with specified type]: :_selinux_types' diff --git a/Completion/Unix/Command/_tiff b/Completion/Unix/Command/_tiff index da55b541c..ef12777de 100644 --- a/Completion/Unix/Command/_tiff +++ b/Completion/Unix/Command/_tiff @@ -59,6 +59,7 @@ tiff2pdf) '-s+[set document subject, overrides image image description default]:subject' \ '-k+[set document keywords]:keywords' \ '-b[set PDF "Interpolate" user preference]' \ + '-m+[set memory allocation limit]:limit (MiB)' \ '(- :)-h[display usage information]' \ ':input file:_files -g "*.(#i)tif(|f)(-.)"' ;; @@ -83,6 +84,7 @@ tiff2ps) '-i+[enable/disable (Nz/0) pixel interpolation]:state [enabled]:((0\:disable 1\:enable))' \ '-l+[set the left margin]:margin (inches)' \ '-m[use "imagemask" operator instead of "image"]' \ + '-M+[set memory allocation limit]:limit (MiB)' \ '-o+[set initial TIFF directory (file offset)]:file offset (bytes)' \ '(-e)-p[generate non-Encapsulated PostScript]' \ '-O+[specify output file]:output file:_files -g "*.(#i)(|e)ps(-.)"' \ @@ -121,6 +123,7 @@ tiffcp) '-i[ignore read errors]' \ '-b+[specify bias (dark) monochrome image to be subtracted from all others]:file:_files' \ '-,=-[specify substitute character for image indices]:character [,]' \ + '-m+[set memory allocation limit]:limit (MiB)' \ '-r+[specify rows per strip]:rows per strip' \ '-w+[specify output tile width]:output tile width' \ '-l+[specify output tile length]:output tile length' \ diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 284a325e5..844af58fc 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -127,6 +127,7 @@ _tmux_aliasmap=( confirm confirm-before menu display-menu display display-message + popup display-popup # buffers clearhist clear-history @@ -168,6 +169,7 @@ _tmux-attach-session() { _arguments -s \ '-c+[specify working directory for the session]:directory:_directories' \ '-d[detach other clients attached to target session]' \ + '-f+[set client flags]: :_tmux_client_flags' \ '-r[put the client into read-only mode]' \ '-t+[specify target session]:target session: __tmux-sessions-separately' \ "-E[don't apply update-environment option]" \ @@ -188,6 +190,8 @@ _tmux-bind-key() { _tmux-break-pane() { [[ -n ${tmux_describe} ]] && print "break a pane from an existing into a new window" && return _arguments -s \ + '(-b)-a[move window to next index after]' \ + '(-a)-b[move window to next index before]' \ "-d[don't make the new window become the active one]" \ '-F+[specify output format]:format:__tmux-formats' \ '-P[print information of new window after it has been created]' \ @@ -221,6 +225,7 @@ _tmux-choose-buffer() { '-r[reverse sort order]' \ '-F+[specify format for each list item]:format:__tmux-formats' \ '-f+[filter items]:filter format:__tmux-formats' \ + '-K+[specify format for each shortcut key]:format:__tmux-formats' \ '-O+[initial sort order]:order:(time name size)' \ '-t+[specify target window]:session:__tmux-windows' \ '*:::template:= _tmux' @@ -234,6 +239,7 @@ _tmux-choose-client() { '-r[reverse sort order]' \ '-F+[specify format for each list item]:format:__tmux-formats' \ '-f+[filter items]:filter format:__tmux-formats' \ + '-K+[specify format for each shortcut key]:format:__tmux-formats' \ '-O+[initial sort order]:order:(time name size)' \ '-t+[specify target window]:session:__tmux-windows' \ '*:::template:= _tmux' @@ -248,6 +254,7 @@ _tmux-choose-tree() { '-r[reverse sort order]' \ '-F+[specify format for each list item]:format:__tmux-formats' \ '-f+[filter items]:filter format:__tmux-formats' \ + '-K+[specify format for each shortcut key]:format:__tmux-formats' \ '-O+[initial sort order]:order:(time name size)' \ '-s[choose among sessions]' \ '-t+[specify target window]:session:__tmux-windows' \ @@ -275,6 +282,8 @@ _tmux-command-prompt() { '-I+[specify list of initial inputs]:initial-text (comma-separated list)' \ '-p+[specify list of prompts]:prompts (comma-separated list)' \ '-t+[specify target client]:client:__tmux-clients' \ + '(-W)-T[prompt is for a target - tab complete as appropriate]' \ + '(-T)-W[prompt is for a window - tab complete as appropriate]' \ '*:::template:= _tmux' } @@ -289,6 +298,7 @@ _tmux-confirm-before() { _tmux-copy-mode() { [[ -n ${tmux_describe} ]] && print "enter copy mode" && return _arguments -s \ + '-s+[specify source pane]:pane:__tmux-panes' \ '-t+[specify target pane]:pane:__tmux-panes' \ '-e[scrolling to the bottom should exit copy mode]' \ '-H[hide the position indicator in the top right]' \ @@ -297,6 +307,16 @@ _tmux-copy-mode() { '-M[begin a mouse drag]' } +_tmux-customize-mode() { + [[ -n ${tmux_describe} ]] && print "enter customize mode" && return + _arguments -s \ + '-F+[specify format for each item in the tree]:format:__tmux-formats' \ + '-f+[specify initial filter]:filter:__tmux-formats' \ + '-N[start without the option information]' \ + '-t+[specify target pane]:pane:__tmux-panes' \ + '-Z[zoom the pane]' +} + _tmux-delete-buffer() { [[ -n ${tmux_describe} ]] && print "delete a paste buffer" && return _arguments '-b+[specify target buffer name]:buffer:__tmux-buffers' @@ -318,6 +338,7 @@ _tmux-display-menu() { local -a state line expl _arguments -C -s -S -A "-*" \ '-c+[specify target client]:client:__tmux-clients' \ + "-O[don't close menu if mouse is released without making a selection]" \ '-t+[specify target pane]:pane:__tmux-panes' \ '-T+[specify title]:title' \ '-x+[specify horizontal position]: : _alternative "columns\: \:_guard \[0-9\]\# column" "positions\:position\:((R\:right P\:bottom M\:mouse W\:window))"' \ @@ -326,7 +347,7 @@ _tmux-display-menu() { if [[ -n $state ]]; then case $(( CURRENT % 3 )) in - 1) _message -e options 'menu option' ;; + 1) _message -e menu-options 'menu option' ;; 2) _message -e keys 'shortcut key' ;; 0) compset -q @@ -345,7 +366,9 @@ _tmux-display-message() { _arguments -s -S -A "-*" \ '(-p -F :)-a[list the format variables and their values]' \ '-I[forward any input read from stdin to the target pane]' \ + '-N[ignore key presses and only close after the delay]' \ '-c+[specify target client]:client:__tmux-clients' \ + '-d+[time to display message]:delay (milliseconds)' \ '(-a)-p[print message to stdout]' \ '-t+[specify target pane]:pane:__tmux-panes' \ '(-a)-F+[specify output format]:format:__tmux-formats' \ @@ -362,9 +385,25 @@ _tmux-display-panes() { '*:::command:= _tmux' } +_tmux-display-popup() { + [[ -n ${tmux_describe} ]] && print "display a popup box over a pane" && return + _arguments -s \ + '-C[close any popup on the client]' \ + '-c+[specify target client]:client:__tmux-clients' \ + '-d+[specify working directory for the command]:directory:_directories' \ + '-E[close the popup when the command exits]' \ + '-w+[specify width]:width' \ + '-h+[specify height]:height' \ + '-t+[specify target pane]:pane:__tmux-panes' \ + '-x+[specify horizontal position]:position' \ + '-y+[specify vertical position]:position' \ + ':shell command:_cmdstring' +} + _tmux-find-window() { [[ -n ${tmux_describe} ]] && print "search for a pattern in windows" && return _arguments -s \ + '-i[ignore case]' \ '-r[use regular expression matching]' \ '-C[match visible contents]' \ '-N[match window name]' \ @@ -454,6 +493,8 @@ _tmux-last-window() { _tmux-link-window() { [[ -n ${tmux_describe} ]] && print "link a window to another" && return _arguments -s \ + '(-b)-a[move window to next index after destination window]' \ + '(-a)-b[move window to next index before destination window]' \ "-d[don't make the new window become the active one]" \ '-k[kill the target window if it exists]' \ '-s+[specify source window]:window:__tmux-windows' \ @@ -462,7 +503,9 @@ _tmux-link-window() { _tmux-list-buffers() { [[ -n ${tmux_describe} ]] && print "list paste buffers of a session" && return - _arguments '-F+[specify output format]:format:__tmux-formats' + _arguments \ + '-F+[specify output format]:format:__tmux-formats' \ + '-f+[filter items]:filter format:__tmux-formats' } _tmux-list-clients() { @@ -498,12 +541,15 @@ _tmux-list-panes() { _arguments -s $args \ '-a[list all panes the server possesses]' \ '-F+[specify output format]:format:__tmux-formats' \ + '-f+[filter items]:filter format:__tmux-formats' \ '-s[if specified, -t chooses a session]' } _tmux-list-sessions() { [[ -n ${tmux_describe} ]] && print "list sessions managed by server" && return - _arguments '-F+[specify output format]:format:__tmux-formats' + _arguments \ + '-F+[specify output format]:format:__tmux-formats' \ + '-f+[filter items]:filter format:__tmux-formats' } _tmux-list-windows() { @@ -511,6 +557,7 @@ _tmux-list-windows() { _arguments -s \ '-a[list all windows the tmux server possesses]' \ '-F[specify output format]:format:__tmux-formats' \ + '-f+[filter items]:filter format:__tmux-formats' \ '-t+[specify session]:session:__tmux-sessions' } @@ -518,6 +565,8 @@ _tmux-load-buffer() { [[ -n ${tmux_describe} ]] && print "load a file into a paste buffer" && return _arguments -A "-*" -S \ '-b+[specify target buffer name]:buffer:__tmux-buffers' \ + '-t+[specify target client]:client:__tmux-clients' \ + '-w[also send the buffer to the clipboard using the xterm escape sequence]' \ '1:file:_files' } @@ -537,21 +586,14 @@ _tmux-lock-session() { } _tmux-move-pane() { - [[ -n ${tmux_describe} ]] && print "move a pane into a new space" && return - _arguments -s \ - '-b[join source pane left of or above target pane]' \ - "-d[don't make the new window become the active one]" \ - '-h[split horizontally]' \ - '-v[split vertically]' \ - "-l+[define new pane's size]:numeric value" \ - "-p+[define new pane's size in percent]:numeric value" \ - '-s+[specify source pane]:pane:__tmux-panes' \ - '-t+[specify target pane]:pane:__tmux-panes' + _tmux-join-pane "$@" } _tmux-move-window() { [[ -n ${tmux_describe} ]] && print "move a window to another" && return _arguments -s \ + '(-b)-a[move window to next index after destination window]' \ + '(-a)-b[move window to next index before destination window]' \ "-d[don't make the new window become the active one]" \ '-k[kill the target window if it exists]' \ '-s+[specify source window]:window:__tmux-windows' \ @@ -567,7 +609,9 @@ _tmux-new-session() { "-d[don't attach new session to current terminal]" \ "-D[with -A, detach other clients attached to session]" \ "-E[don't apply update-environment option]" \ + '*-e[specify environment variable]:environment variable:_parameters -g "*export*" -qS=' \ '-F+[specify output format]:format:__tmux-formats' \ + '-f+[specify client flags]: :_tmux_client_flags' \ '-n+[specify initial window name]:window name' \ '-P[print information about new session after it is created]' \ '-s+[name the session]:session name:__tmux-sessions' \ @@ -581,14 +625,16 @@ _tmux-new-session() { _tmux-new-window() { [[ -n ${tmux_describe} ]] && print "create a new window" && return _arguments -s -A "-*" -S \ - '-a[insert new window at next free index from -t]' \ + '(-b)-a[insert new window at next index after target]' \ + '(-a)-b[insert new window at next index before target]' \ '-c+[specify working directory for the session]:directory:_directories' \ '*-e[specify environment variable]:environment variable:_parameters -g "*export*" -qS=' \ - "-d[don't make the new window become the active one]" \ + "(-S)-d[don't make the new window become the active one]" \ '-F+[specify output format]:format:__tmux-formats' \ '-k[destroy it if the specified window exists]' \ '-n+[specify a window name]:window name' \ '-P[print information about new window after it is created]' \ + '(-d)-S[select window if name already exists]' \ '-t+[specify target window]:window:__tmux-windows' \ '*:: :_cmdambivalent' } @@ -640,11 +686,13 @@ _tmux-previous-window() { _tmux-refresh-client() { [[ -n ${tmux_describe} ]] && print "refresh a client" && return - _arguments -s -S -A "-*" \ + _arguments -s -A "-*" -S \ + '-B+[set a subscription to a format for a control mode client]:subscription' \ + '-A+[allow a control mode client to trigger actions on a pane]:pane:__tmux-panes -P% -S\:' \ '-C+[set the width and height of a control client]:width,height' \ '-c[reset so that the position follows the cursor]' \ '-D[move visible portion of window down]' \ - '-F+[specify flags]:flag:(no-output)' \ + '-f+[set client flags]:flag:_tmux_client_flags' \ '-L[move visible portion of window left]' \ '-l[request clipboard from the client and store it in a new paste buf using xterm(1) escape sequence]' \ "-S[only update the client's status bar]" \ @@ -677,6 +725,7 @@ _tmux-resize-pane() { '-R[resize to the right]' \ '-U[resize upward]' \ '-t+[specify target pane]:pane:__tmux-panes' \ + '-T[trim lines below the cursor position and moves lines out of the history to replace them]' \ '-x+[specify width]:width' \ '-y+[specify height]:height' \ '-Z[toggle zoom of pane]' \ @@ -729,10 +778,22 @@ _tmux-rotate-window() { _tmux-run-shell() { [[ -n ${tmux_describe} ]] && print "execute a command without creating a new window" && return - _arguments -s -A "-*" -S \ - '-b[run shell command in background]' \ + local curcontext="$curcontext" ret=1 + local -a state line expl + _arguments -C -s -A "-*" -S \ + '-b[run command in background]' \ + '(1)-C[run a tmux command]' \ + '-d+[specify delay before starting the command]:delay (seconds)' \ '-t+[specify target pane]:pane:__tmux-panes' \ - ':command:_cmdstring' + '(2)1:command:_cmdstring' \ + '2:tmux command:->tmux-commands' && ret=0 + + if [[ -n $state ]]; then + compset -q + words=( run "$words[@]" ) + (( CURRENT++ )) + _tmux && ret=0 + fi } _tmux-save-buffer() { @@ -815,6 +876,8 @@ _tmux-set-buffer() { '-a[append to rather than overwriting target buffer]' \ '-b+[specify target buffer index]:pane:__tmux-buffers' \ '-n+[specify new buffer name]:buffer-name' \ + '-t+[specify target client]:client:__tmux-clients' \ + '-w[also send the buffer to the clipboard using the xterm escape sequence]' \ ':data' } @@ -824,7 +887,9 @@ _tmux-set-environment() { local curcontext="$curcontext" state line ret=1 typeset -A opt_args _arguments -C -s -A "-*" -S : \ + '-F[expand value as a format]' \ '(-t)-g[modify global environment]' \ + '-h[mark the variable as hidden]' \ '(-u)-r[remove variable before starting new processes]' \ '(-r)-u[unset a variable]' \ '(-g)-t[specify target session]:target session:__tmux-sessions' \ @@ -861,6 +926,7 @@ _tmux-set-option() { '-o[prevent setting of an option that is already set]' \ '-q[suppress errors about unknown or ambiguous options]' \ '-u[unset a non-global option]' \ + '-U[unset a pane option across all panes in the window]' \ '(-w -s)-p[change pane (no session) options]' \ '(-p -s)-w[change window (not session) options]' \ '(-p -w)-s[change server (not session) options]' \ @@ -899,6 +965,8 @@ _tmux-set-hook() { '-a[append to hook]' \ '(-R)-g[add hook to global list]' \ '(-g -u)-R[run hook immediately]' \ + '(-w)-p[set pane hooks]' \ + '(-p)-w[set window hooks]' \ '(-R)-u[unset a hook]' \ '-t+[specify target session]:session:__tmux-sessions' \ ':hook name:_tmux_hooks' \ @@ -909,6 +977,8 @@ _tmux-show-hooks() { [[ -n ${tmux_describe} ]] && print "show the global list of hooks" && return _arguments -s -S -A "-*" \ '-g[show global list of hooks]' \ + '(-w)-p[show pane hooks]' \ + '(-p)-w[show window hooks]' \ '-t+[specify target session]:session:__tmux-sessions' \ } @@ -924,6 +994,7 @@ _tmux-show-environment() { typeset -A opt_args _arguments -C -A "-*" -s : \ '(-t)-g[show global environment]' \ + '-h[show hidden variables]' \ '-s[format output as Bourne shell commands]' \ '(-g)-t+[specify target session]:target session:__tmux-sessions' \ '1:: :->name' && ret=0 @@ -986,6 +1057,7 @@ _tmux-show-window-options() { _tmux-source-file() { [[ -n ${tmux_describe} ]] && print "execute tmux commands from a file" && return _arguments \ + '-F[expand path as a format]' \ '-n[file is parsed but no commands are executed]' \ "-q[don't report error if path doesn't exist]" \ '-v[show parsed commands and line numbers if possible]' \ @@ -1006,6 +1078,7 @@ _tmux-split-window() { "(-p)-l[define new pane's size]:size" \ "!(-f -l)-p+:size (percentage)" \ '-t+[specify target pane]:pane:__tmux-panes' \ + '-Z[zoom the pane]' \ '(:)-I[create empty pane and forward stdin to it]' \ ':command:_cmdambivalent' # Yes, __tmux-panes is correct here. The behaviour was changed @@ -1065,6 +1138,7 @@ _tmux-unbind-key() { _arguments -C -s \ '-a[remove all key bindings]' \ '-n[remove a non-prefix binding]' \ + '-q[prevent errors being returned]' \ '-T[specify key table]:key table' \ '*:: :->boundkeys' @@ -1383,6 +1457,11 @@ _tmux_hooks() { 'post-hooks:command post-hook:compadd - after-${_tmux_aliasmap}' } +_tmux_client_flags() { + _values -s , flag active-pane ignore-size no-output \ + 'pause-after:time (seconds)' read-only wait-exit +} + function __tmux-get-optarg() { local opt="$1" local -i i @@ -1607,16 +1686,11 @@ function __tmux-options-complete() { } function __tmux-panes() { - local expl line + local expl line orig="$IPREFIX" local -i num local -a panes opts - compset -P '*.' - if [[ -n ${IPREFIX} ]]; then - opts=( -t "${IPREFIX%.}" ) - else - opts=( ) - fi + compset -P '*.' && opts=( -t "${${IPREFIX%.}#$orig}" ) num=0 command tmux 2> /dev/null list-panes "${opts[@]}" | while IFS= read -r line; do panes+=( $(( num++ )):${line//:/} ) @@ -1761,10 +1835,13 @@ _tmux() { '-2[force using 256 colours]' \ '-c[execute a shell command]:command name:_command_names' \ '-C[start tmux in control mode. -CC disables echo]' \ + "-D[don't start the tmux server as a daemon]" \ '-f[specify configuration file]:tmux config file:_files -g "*(-.)"' \ '-l[behave like a login shell]' \ '-L[specify socket name]:socket name:__tmux-socket-name' \ + "-N[don't start the server even if the command would normally do so]" \ '-S[specify socket path]:server socket:_path_files -g "*(=,/)"' \ + '-T+[set terminal features for the client]: : _values -s , 256 clipboard ccolour cstyle extkeys focus margins mouse overline rectfill RGB strikethrough sync title usstyle' \ '-u[force using UTF-8]' \ '-v[request verbose logging]' \ '-V[report tmux version]' \ diff --git a/Completion/Unix/Command/_vim b/Completion/Unix/Command/_vim index d9dc1a5b3..5c6054e70 100644 --- a/Completion/Unix/Command/_vim +++ b/Completion/Unix/Command/_vim @@ -27,9 +27,8 @@ arguments=( '-D[debugging mode]' '-n[no swap file (memory only)]' {-r,-L}'[list swap files and exit or recover from a swap file]::swap file:_vim_files -g "*.sw?(-.)"' - '( -H -F)-A[start in Arabic mode]' - '(-A -F)-H[start in Hebrew mode]' - '(-A -H )-F[start in Farsi mode]' + '(-H)-A[start in Arabic mode]' + '(-A)-H[start in Hebrew mode]' '-u[use given vimrc file instead of default .vimrc]:config:->config' "--noplugin[don't load plugin scripts]" '-o-[number of windows to open (default: one for each file)]::window count: ' @@ -99,8 +98,11 @@ fi [[ $service != *view ]] && arguments+='-R[readonly mode]' [[ $service = *g* ]] || (( ${words[(I)-g]} )) && arguments+=( '(--nofork -f)'{--nofork,-f}'[do not detach the GUI version from the shell]' + '(-background -bg)'{-background,-bg}'[use specified color for the background]:color:_x_color' + '(-foreground -fg)'{-foreground,-fg}'[use specified color for normal text]:color:_x_color' '-font:font:_xft_fonts' '-geometry:geometry:_x_geometry' + '-iconic[start vim iconified]' '(-rv -reverse)'{-rv,-reverse}'[use reverse video]' '-display:display:_x_display' '--role[set unique role to identify main window]:role' diff --git a/Completion/Unix/Command/_w3m b/Completion/Unix/Command/_w3m index eff9901ca..de425cfb1 100644 --- a/Completion/Unix/Command/_w3m +++ b/Completion/Unix/Command/_w3m @@ -1,7 +1,5 @@ #compdef w3m -# w3m version w3m/0.5.1 - local curcontext="$curcontext" state line expl ret=1 typeset -A opt_args @@ -21,7 +19,7 @@ _arguments -C \ '(-B *)-v[visual startup mode]' \ '-M[monochrome display]' \ '-N[open URL of command line on each new tab]' \ - '-F[automatically render frame]' \ + '-F[automatically render frames]' \ '-cols[specify column width (used with -dump)]:column width' \ '-ppc[specify the number of pixels per character (4.0...32.0)]:number of pixels (4.0...32.0):' \ '-ppl[specify the number of pixels per line (4.0...64.0)]:number of pixels (4.0...64.0):' \ @@ -34,17 +32,17 @@ _arguments -C \ '-header[insert string as a header]:header:' \ '+-[goto specified line]:line number:_guard "[0-9]#" "line number"' \ '-num[show line number]' \ + '-session[use specified session]:id' \ "-no-proxy[don't use proxy]" \ '(-6)-4[IPv4 only (-o dns_order=4)]' \ '(-4)-6[IPv6 only (-o dns_order=6)]' \ "-no-mouse[don't use mouse]" \ '(-no-cookie)-cookie[use cookie]' \ "(-cookie)-no-cookie[don't use cookie]" \ - '-pauth[proxy authentication]:user\:pass:->pauth' \ - '(-no-graph)-graph[use graphic character]' \ - "(-graph)-no-graph[don't use graphic character]" \ + '(-no-graph)-graph[use DEC special graphics for border of table and menu]' \ + '(-graph)-no-graph[use ASCII character for border of table and menu]' \ '-S[squeeze multiple blank lines]' \ - '-W[toggle wrap search mode]' \ + '-W[toggle search wrap mode]' \ "-X[don't use termcap init/deinit]" \ '-title=[set buffer name to terminal title string]:terminal:_terminals' \ '*-o[assign value to config option]:option=value:->option' \ @@ -97,14 +95,6 @@ case "$state" in _describe -t options 'option' options "$suf[@]" && ret=0 fi ;; - pauth) - if compset -P 1 '*:'; then - _message -e passwords 'password' - else - compset -S ':*' || suf=( -S ':' ) - _users "$suf[@]" && ret=0 - fi - ;; esac return ret diff --git a/Completion/Unix/Command/_wget b/Completion/Unix/Command/_wget index d061fcd06..50fd7791a 100644 --- a/Completion/Unix/Command/_wget +++ b/Completion/Unix/Command/_wget @@ -34,6 +34,8 @@ _arguments -C -s \ '(--server-response -S)'{--server-response,-S}'[print server response]' \ "--spider[don't download anything]" \ '(--timeout -T)'{--timeout=,-T+}'[set all timeout values]:timeout (seconds)' \ + '--dns-servers=[specify DNS servers to query]:DNS server:_sequence _hosts' \ + '--bind-dns-address=[bind DNS resolver to specified address]:hostname or IP on local host' \ '(--timeout -T)--dns-timeout=[set the DNS lookup timeout]:DNS lookup timeout (seconds)' \ '(--timeout -T)--connect-timeout=[set the connect timeout]:connect timeout (seconds)' \ '(--timeout -T)--read-timeout=[set the read timeout]:read timeout (seconds)' \ @@ -107,7 +109,7 @@ _arguments -C -s \ "--ca-directory=[specify dir where hash list of CA's are stored]:directory:_directories" \ '--crl-file=[specify file with bundle of CRLs]:file:_files' \ '--pinnedpubkey=:file:_files' \ - '!--random-file=:file:_files' \ + '--random-file[specify file with random data for seeding generator]:file:_files' \ '--egd-file=[specify filename of EGD socket]:file:_files' \ '--ciphers=[set the priority string (GnuTLS) or cipher list string (OpenSSL) directly]:string' \ '--no-hsts[disable HSTS]' \ diff --git a/Completion/Unix/Command/_wiggle b/Completion/Unix/Command/_wiggle index 0a2f0c0cb..1d747a479 100644 --- a/Completion/Unix/Command/_wiggle +++ b/Completion/Unix/Command/_wiggle @@ -1,15 +1,17 @@ #compdef wiggle -local fns='-m --merge -d --diff -x --extract' +local fns='-m --merge -d --diff -x --extract -B --browse' _arguments \ "($fns -1 -2 -3)"{-m,--merge}'[select the merge function]' \ "($fns -3 3)"{-d,--diff}'[display differences between files]' \ "($fns 2 3)"{-x,--extract}'[extract one branch of a patch or merge file]' \ '(-w --words -l --lines)'{-w,--words}'[make operations and display word based]' \ - '(-l --lines -w --words)'{-l,--lines}'[make operations and display line based]' \ + '(-l --lines -w --words --non-space)'{-l,--lines}'[make operations and display line based]' \ + '(-l --lines)--non-space[words are separated by spaces]' \ '(-p --patch)'{-p,--patch}'[treat last named file as a patch]' \ '(-r --replace)'{-r,--replace}'[replace original file with merged output]' \ + '--no-backup[never save original file (as name.porig)]' \ '(-R --reverse -x --extract)'{-R,--reverse}'[swap the files or revert changes]' \ '(-2 -3 -m --merge)-1[select branch]' \ '(-1 -3 -m --merge)-2[select branch]' \ diff --git a/Completion/Unix/Command/_xmlsoft b/Completion/Unix/Command/_xmlsoft index 9f1206988..08b123e54 100644 --- a/Completion/Unix/Command/_xmlsoft +++ b/Completion/Unix/Command/_xmlsoft @@ -80,6 +80,7 @@ case $service in '(--dtdvalid --relaxng --schema)--postvalid[do a posteriori validation, i.e after parsing]' \ '(--postvalid --relaxng --schema --dtdvalidfpi)--dtdvalid[do a posteriori validation against a given DTD]:DTD:_webbrowser' \ '(--postvalid --relaxng --schema --dtdvalid)--dtdvalidfpi[as --dtdvalid but specify DTD with public identifier]:DTD identifier' \ + '--quiet[be quiet when successful]' \ '--timing[print some timings]' \ '(--noout --output -o)'{--output,-o}'[save to a given file]:output file:_files' \ '--repeat[repeat 100 times, for timing or profiling]' \ diff --git a/Completion/Unix/Command/_xxd b/Completion/Unix/Command/_xxd index 3a8efd664..31d26ab64 100644 --- a/Completion/Unix/Command/_xxd +++ b/Completion/Unix/Command/_xxd @@ -39,6 +39,7 @@ arguments=( {-g+,-groupsize}'[specify the number of octets per group]: :_guard "[0-9]#" "number of octets per group"' {-l+,-len}'[specify number of octets to output]: :_guard "[0-9]#" "number of octets to output"' {-o+,-offset}'[add specified offset to displayed file position]:offset' + '-d[show offset in decimal instead of hex]' {-s,-skip,-seek}'[specify file offset to dump from]: :_guard "[0-9]#" "file offset to dump from (absolute or relative)"' ': :_files' diff --git a/Completion/X/Command/_xrandr b/Completion/X/Command/_xrandr index 6143054aa..2551e1958 100644 --- a/Completion/X/Command/_xrandr +++ b/Completion/X/Command/_xrandr @@ -36,6 +36,7 @@ _arguments -C \ '*--set:property:(Backlight scaling\ mode):value:->value' \ '*--scale:output scaling:' \ '*--transform:transformation matrix:' \ + '*--filter:mode:(nearest bilinear)' \ '*--off[disable the output]' \ '*--crtc:crtc to use:' \ '*--panning:panning:' \ diff --git a/Completion/X/Command/_xterm b/Completion/X/Command/_xterm index 6d98985e7..180c2eb21 100644 --- a/Completion/X/Command/_xterm +++ b/Completion/X/Command/_xterm @@ -3,7 +3,7 @@ _xt_arguments \ -+{132,ah,ai,aw,bc,bdc,cb,cjk_width,cm,cn,cu,dc,fbb,fbx,fullscreen,hf,hm,hold,ie,im,itc,j,k8,l,lc,ls,maximized,mb,mesg,mk_width,nul,pc,pob,rvc,rw,s,samename,sb,sf,si,sk,sm,sp,t,u8,uc,ulc,ulit,ut,vb,wc,wf} \ -{version,help,leftbar,rightbar,C} \ - '-report-'{charclass,colors,fonts} \ + '-report-'{charclass,colors,fonts,icons,xres} \ '-T:title' \ '-b:inner border size:' \ '-baudrate:rate [38400]' \ -- cgit v1.2.3 From 64befeb4ca5bd9ddb7162584585cd9041711ff8c Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Sun, 29 Aug 2021 17:12:56 +0200 Subject: 49327: complete for new git maintenance, for-each-repo, sparse-checkout and bugreport commands --- ChangeLog | 3 ++ Completion/Unix/Command/_git | 108 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 109 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index ae43c1979..044b38ca2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-08-29 Oliver Kiddle <opk@zsh.org> + * 49327: Completion/Unix/Command/_git: complete for new git + maintenance, for-each-repo, sparse-checkout and bugreport commands + * 49319: Completion/...: completion options update * 49317: Completion/Unix/Command/_transmission, diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index d27b43098..a82b70e83 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -641,6 +641,7 @@ _git-clone () { '(-4 --ipv4 -6 --ipv6)'{-6,--ipv6}'[use IPv6 addresses only]' \ '--filter=[object filtering]:filter:_git_rev-list_filters' \ '--remote-submodules[any cloned submodules will use their remote-tracking branch]' \ + '--sparse[initialize the sparse-checkout file to start with only the top-level files]' \ ': :->repository' \ ': :_directories' && ret=0 @@ -1215,6 +1216,46 @@ _git-log () { return ret } +(( $+functions[_git-maintenance] )) || +_git-maintenance() { + local curcontext="$curcontext" state state_descr line ret=1 + local -A opt_args + + _arguments -C \ + ': :->command' \ + '*::: := ->option-or-argument' && ret=0 + + case $state in + (command) + local -a commands + + commands=( + register:'initialize config values to run maintenance on this repository' + run:'run one or more maintenance tasks' + start:'start running maintenance on the current repository' + stop:'halt the background maintenance schedule' + unregister:'remove the current repository from background maintenance' + ) + + _describe -t commands command commands && ret=0 + ;; + (option-or-argument) + curcontext=${curcontext%:*}-$line[1]: + case $line[1] in + (run) + _arguments -S $endopt \ + '--auto[run tasks based on the state of the repository]' \ + '--schedule=[run tasks based on frequency]:frequency (seconds)' \ + "--quiet[don't report progress or other information to stderr]" \ + '*--task=[run a specific task]:task:(gc commit-graph prefetch loose-objects incremental-repack pack-refs)' && ret=0 + ;; + esac + ;; + esac + + return ret +} + (( $+functions[_git-merge] )) || _git-merge () { local -a merge_options @@ -1732,6 +1773,50 @@ _git-show () { return ret } +(( $+functions[_git-sparse-checkout] )) || +_git-sparse-checkout() { + local curcontext="$curcontext" state state_descr line ret=1 + local -A opt_args + + _arguments -C \ + ': :->command' \ + '*::: := ->option-or-argument' && ret=0 + + case $state in + (command) + local -a commands + + commands=( + list:'describe the patterns in the sparse-checkout file' + init:'enable the core.sparseCheckout setting' + set:'write a set of patterns to the sparse-checkout file' + add:'update the sparse-checkout file to include additional patterns' + reapply:'reapply the sparsity pattern rules to paths in the working tree' + disable:'disable the config setting, and restore all files in the working directory' + ) + + _describe -t commands command commands && ret=0 + ;; + (option-or-argument) + curcontext=${curcontext%:*}-$line[1]: + case $line[1] in + init) + _arguments \ + '--cone[allow for better performance with a limited set of patterns]' \ + '--no-sparse-index[rewrite index to not be sparse]' + ;; + set|add) + _arguments -S \ + '--stdin[read patterns from input]' \ + '*:pattern:_files' && ret=0 + ;; + esac + ;; + esac + + return ret +} + (( $+functions[_git-stash] )) || _git-stash () { local curcontext=$curcontext state line ret=1 @@ -4001,6 +4086,13 @@ _git-blame () { return ret } +(( $+functions[_git-bugreport] )) || +_git-bugreport() { + _arguments \ + '(-o --output-directory)'{-o+,--output-directory=}'[specify a destination for the bugreport file]:directory:_directories' \ + '(-s --suffix)'{-s+,--suffix=}'[specify a strftime format suffix for the filename]:format:_date_formats' +} + (( $+functions[_git-cherry] )) || _git-cherry () { # TODO: --abbrev is undocumented. @@ -4916,7 +5008,7 @@ _git-merge-index () { (( $+functions[_git-mktag] )) || _git-mktag () { - _message 'no arguments allowed; only accepts tags on standard input' + _arguments --no-strict } (( $+functions[_git-mktree] )) || @@ -5264,6 +5356,14 @@ _git-for-each-ref () { ':: :_guard "([^-]?#|)" pattern' } +(( $+functions[_git-for-each-repo] )) || +_git-for-each-repo() { + _arguments -S \ + '(-C --config)'{-C,--config=}'[specify config variable for list of paths]:config variable' \ + ':git command:_git_commands' \ + '*:: := _git' +} + (( $+functions[_git-ls-files] )) || _git-ls-files () { local no_empty_directory_opt= @@ -5965,6 +6065,7 @@ _git_commands () { gui:'run portable graphical interface to git' init:'create empty git repository or re-initialize an existing one' log:'show commit logs' + maintenance:'run tasks to optimize Git repository data' merge:'join two or more development histories together' mv:'move or rename file, directory, or symlink' notes:'add or inspect object notes' @@ -5978,6 +6079,7 @@ _git_commands () { rm:'remove files from the working tree and from the index' shortlog:'summarize git log output' show:'show various types of objects' + sparse-checkout:'initialize and modify the sparse-checkout' stash:'stash away changes to dirty working directory' status:'show working-tree status' submodule:'initialize, update, or inspect submodules' @@ -6001,6 +6103,7 @@ _git_commands () { ancillary_interrogator_commands=( blame:'show what revision and author last modified each line of a file' + bugreport:'collect information for user to file a bug report' count-objects:'count unpacked objects and display their disk consumption' difftool:'show changes using common diff tools' fsck:'verify connectivity and validity of objects in database' @@ -6035,7 +6138,7 @@ _git_commands () { index-pack:'build pack index file for an existing packed archive' merge-file:'run a three-way file merge' merge-index:'run merge for files needing merging' - mktag:'create tag object' + mktag:'create tag object with extra validation' mktree:'build tree-object from git ls-tree formatted text' multi-pack-index:'write and verify multi-pack-indexes' pack-objects:'create packed archive of objects' @@ -6054,6 +6157,7 @@ _git_commands () { diff-index:'compare content and mode of blobs between index and repository' diff-tree:'compare content and mode of blobs found via two tree objects' for-each-ref:'output information on each ref' + for-each-repo:'run a git command on a list of repositories' get-tar-commit-id:'extract commit ID from an archive created using git archive' ls-files:'information about files in index/working directory' ls-remote:'show references in a remote repository' -- cgit v1.2.3 From b60bab1cc1e7ba94913a0be29ce270798aa55bf7 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Sat, 4 Sep 2021 13:11:07 +0200 Subject: 49345: fix git file completion for paths starting with ../ --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 044b38ca2..006017026 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-09-04 Oliver Kiddle <opk@zsh.org> + + * 49345: Completion/Unix/Command/_git: fix git file completion + for paths starting with ../ + 2021-08-29 Oliver Kiddle <opk@zsh.org> * 49327: Completion/Unix/Command/_git: complete for new git diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index a82b70e83..7c7fb22bc 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -7370,7 +7370,6 @@ __git_changed_files () { # which case it is relative to the repository root. (( $+functions[__git_tree_files] )) || __git_tree_files () { - local multi_parts_opts local tree Path integer at_least_one_tree_added local -a tree_files compadd_opts @@ -7383,11 +7382,12 @@ __git_tree_files () { zparseopts -D -E -a compadd_opts V+: J+: 1 2 o+: n f x+: X+: M+: P: S: r: R: q F: - [[ "$1" == */ ]] && Path="$1" || Path="${1:h}/" + Path=${(M)1##(../)#} + [[ ${1##(../)#} = */* ]] && extra_args+=( -r ) shift (( at_least_one_tree_added = 0 )) - for tree in $*; do - tree_files+=(${(ps:\0:)"$(_call_program tree-files git ls-tree -r ${(q)extra_args} --name-only -z ${(q)tree} 2>/dev/null)"}) + for tree; do + tree_files+=(${(ps:\0:)"$(_call_program tree-files git ls-tree $extra_args --name-only -z ${(q)tree} $Path 2>/dev/null)"}) __git_command_successful $pipestatus && (( at_least_one_tree_added = 1 )) done -- cgit v1.2.3 From c843af635a470f209e4aca70b26fcd74ed31071b Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA <syohex@gmail.com> Date: Wed, 1 Sep 2021 13:38:55 +0900 Subject: 49343: Fix file name completion of GNU digest utilities --- ChangeLog | 3 +++ Completion/Unix/Command/_md5sum | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 006017026..f6467b8d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-09-04 Oliver Kiddle <opk@zsh.org> + * Shohei YOSHIDA: 49343: Completion/Unix/Command/_md5sum: + Fix file name completion of GNU digest utilities + * 49345: Completion/Unix/Command/_git: fix git file completion for paths starting with ../ diff --git a/Completion/Unix/Command/_md5sum b/Completion/Unix/Command/_md5sum index 3dfcd6322..e0de826a7 100644 --- a/Completion/Unix/Command/_md5sum +++ b/Completion/Unix/Command/_md5sum @@ -45,6 +45,9 @@ args+=( '(sum -w --status --warn)'{-w,--warn}'[warn about each improperly formatted checksum line]' ) # Operands -args+=( '*: :_files' ) +args+=( + + operand + '*: :_files' +) _arguments -s -S : $args -- cgit v1.2.3 From c0e5b212f32b3349e963ab2c49a2576bad9e7a08 Mon Sep 17 00:00:00 2001 From: Bart Schaefer <schaefer@ipost.com> Date: Mon, 6 Sep 2021 12:20:27 -0700 Subject: 48832: try _gnu_generic first --- ChangeLog | 4 ++++ Completion/Unix/Command/_curl | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index f6467b8d6..85132c36e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2021-09-06 Bart Schaefer <schaefer@zsh.org> + + * 48832: Completion/Unix/Type/_urls: try _gnu_generic first + 2021-09-04 Oliver Kiddle <opk@zsh.org> * Shohei YOSHIDA: 49343: Completion/Unix/Command/_md5sum: diff --git a/Completion/Unix/Command/_curl b/Completion/Unix/Command/_curl index 72e2e5b53..ecccdd389 100644 --- a/Completion/Unix/Command/_curl +++ b/Completion/Unix/Command/_curl @@ -4,4 +4,4 @@ # definition is provided as a fallback, and should be installed later # in $fpath than the curl-provided definition of _curl. -_urls "$@" +_gnu_generic || _urls "$@" -- cgit v1.2.3 From 1e9013941e7a830827acf6cffcbd1c407358ecfe Mon Sep 17 00:00:00 2001 From: Marlon Richert <marlonrichert@users.noreply.github.com> Date: Fri, 17 Sep 2021 16:05:53 +0300 Subject: Add support for multi-project builds to _gradle --- ChangeLog | 3 +++ Completion/Unix/Command/_gradle | 38 ++++++++++++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 1955e3351..5ae9f2fd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-09-28 Oliver Kiddle <opk@zsh.org> + * Marlon Richert: 49423: Completion/Unix/Command/_gradle: + Add support for multi-project builds + * 49454: Completion/compdump: open dump file once only instead of reopening it for appends diff --git a/Completion/Unix/Command/_gradle b/Completion/Unix/Command/_gradle index adf5e9aa8..a1d9381cb 100644 --- a/Completion/Unix/Command/_gradle +++ b/Completion/Unix/Command/_gradle @@ -1,9 +1,9 @@ #compdef gradle gradlew local curcontext="$curcontext" ret=1 state state_descr line -local gradle_inspect=yes cache_policy tag_order +local gradle_inspect=yes cache_policy tag_order filter= local -A opt_args -local -a gradle_group_tasks gradle_all_tasks +local -aU gradle_group_tasks gradle_all_tasks tasks # Set the caching policy to invalidate cache if the build file is newer than the cache. _gradle_caching_policy() { @@ -78,31 +78,53 @@ if [[ $words[CURRENT] != -* ]]; then local -a match mbegin mend # Run gradle/gradlew and retrieve possible tasks. for outputline in ${(f)"$($service --build-file $gradle_buildfile -q tasks --all)"}; do - if [[ $outputline == [[:blank:]]#(#b)([[:alnum:]]##)' - '(*) ]]; then + # Subproject tasks are prefixed with one or more instances of [[:alnum:]]##\: + # Leaving out the prefix runs the task in all subprojects where it exists. + if [[ $outputline == + [[:blank:]]#(#b)([[:alnum:]]##\:)#([[:alnum:]]##)' - '(*) ]]; then # The descriptions of main tasks start at beginning of line, descriptions of # secondary tasks are indented. if [[ $outputline == [[:alnum:]]* ]]; then - gradle_group_tasks+=( "$match[1]:$match[2]" ) + gradle_group_tasks+=( + "$match[-2]:$match[-1]" + "${${(j::)match[1,-2]}//:/\:}:$match[-1]" + ) else - gradle_all_tasks+=( "$match[1]:$match[2]" ) + gradle_all_tasks+=( + "${${(j::)match[1,-2]}//:/\:}:$match[-1]" + ) fi fi done _store_cache $cache_name gradle_group_tasks gradle_all_tasks fi + filter= + zstyle -T ":completion:${curcontext}:tasks" prefix-needed && + [[ $PREFIX != ([[:alnum:]]##\:)## ]] && + filter+="*\:*" if [[ $state == task ]]; then _tags gradle_group gradle_all while _tags; do # Offer main tasks and secondary tasks in different tags. - _requested gradle_group && _describe 'group task' gradle_group_tasks && ret=0 - _requested gradle_all && _describe 'secondary task' gradle_all_tasks && ret=0 + if _requested gradle_group; then + tasks=( ${gradle_group_tasks:#$~filter} ) + _describe -t tasks 'group task' tasks && + ret=0 + fi + if _requested gradle_all; then + tasks=( ${gradle_all_tasks:#$~filter} ) + _describe -t tasks 'secondary task' tasks && + ret=0 + fi (( ret )) || break done elif [[ $state == alltask ]]; then # After '--exclude-task', we don't make a distinction between main tasks and # secondary tasks. - _describe 'task' gradle_group_tasks -- gradle_all_tasks && ret=0 + tasks=( ${gradle_group_tasks:#$~filter} ${gradle_all_tasks:#$~filter} ) + _describe -t tasks 'task' tasks && + ret=0 fi fi else -- cgit v1.2.3 From 713588e2350ef2257f2f8a934041832234876b92 Mon Sep 17 00:00:00 2001 From: Matthew Martin <phy1729@gmail.com> Date: Wed, 13 Oct 2021 22:01:23 -0500 Subject: 49441: _timeout: Add OpenBSD --- ChangeLog | 4 ++++ Completion/Unix/Command/_timeout | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 817379927..81d8c699e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2021-10-13 Matthew Martin <phy1729@gmail.com> + + * 49441: Completion/Unix/Command/_timeout: Add OpenBSD. + 2021-10-11 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> * 49464: Completion/Linux/Command/_basenc: new completion diff --git a/Completion/Unix/Command/_timeout b/Completion/Unix/Command/_timeout index 223059e4d..2235fa5ec 100644 --- a/Completion/Unix/Command/_timeout +++ b/Completion/Unix/Command/_timeout @@ -2,8 +2,8 @@ local args -if [[ $service = g* || $OSTYPE != *(freebsd|netbsd)* ]]; then - # GNU coreutils or DFly as opposed to Free/NetBSD implementation +if [[ $service = g* || $OSTYPE != *(freebsd|netbsd|openbsd)* ]]; then + # GNU coreutils or DFly as opposed to Free/Net/OpenBSD implementation args=( '(-v --verbose)'{-v,--verbose}'[indicate when signal is sent upon timeout]' '(- *)--help[display usage information]' -- cgit v1.2.3 From 0f1e4d8e78a9692eaf38da8fd4ee6b23b75e2fdf Mon Sep 17 00:00:00 2001 From: Xavier Hsinyuan <me@lstlx.com> Date: Fri, 15 Oct 2021 18:56:46 +0800 Subject: github #79 (tweaked): _ssh: update options in apple's version of ssh-add --- ChangeLog | 6 ++++++ Completion/Unix/Command/_ssh | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 81d8c699e..0428248de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2021-10-16 dana <dana@dana.is> + + * github #79 (tweaked): Xavier Hsinyuan: + Completion/Unix/Command/_ssh: update options in apple's version + of ssh-add + 2021-10-13 Matthew Martin <phy1729@gmail.com> * 49441: Completion/Unix/Command/_timeout: Add OpenBSD. diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index 20087174c..2385272f1 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -81,9 +81,19 @@ _ssh () { '*:file:->file' "$common[@]" "$common_transfer[@]" && ret=0 ;; ssh-add) - [[ $OSTYPE == darwin* ]] && args=( - '-A[add identities from keychain]' - '-K[update keychain when adding/removing identities]' + if [[ $OSTYPE != darwin* || $APPLE_SSH_ADD_BEHAVIOR == openssh ]]; then + args=( + '-K[load resident keys from a FIDO authenticator]' + ) + else + [[ ${APPLE_SSH_ADD_BEHAVIOR:-macos} == macos ]] && args=( + '-A[add identities from keychain]' + '-K[update keychain when adding/removing identities]' + ) + fi + [[ $OSTYPE == darwin<20->.* ]] && args+=( + '--apple-load-keychain[add identities from keychain]' + '--apple-use-keychain[update keychain when adding/removing identities]' ) _arguments -s : $args \ '-c[identity is subject to confirmation via SSH_ASKPASS]' \ -- cgit v1.2.3 From 4e9d0075f438c4404b29ad6901f6ed6aa4d0fdc6 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Tue, 26 Oct 2021 18:35:36 +0200 Subject: 49519: quote completed options as needed and remove the now superfluous quotes from option specifications --- ChangeLog | 9 ++++++++- Completion/Base/Utility/_arguments | 10 +++++----- Completion/Darwin/Command/_qtplay | 2 +- Completion/Unix/Command/_less | 4 ++-- Completion/Unix/Command/_nm | 2 +- Completion/Unix/Command/_php | 2 +- Completion/Unix/Command/_strings | 2 +- Completion/Unix/Command/_zip | 2 +- Completion/X/Command/_gnome-gv | 2 +- 9 files changed, 21 insertions(+), 14 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index abdab0ffe..ff8a738c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2021-10-26 Oliver Kiddle <opk@zsh.org> + * 49519: Completion/Base/Utility/_arguments, + Completion/Darwin/Command/_qtplay, Completion/Unix/Command/_less, + Completion/Unix/Command/_nm, Completion/Unix/Command/_php, + Completion/Unix/Command/_strings, Completion/Unix/Command/_zip, + Completion/X/Command/_gnome-gv: quote completed options as needed + and remove the now superfluous quotes from option specifications + * 49516: Src/Zle/compmatch.c: bail out early from matching control if command line content is too short for the coanchor @@ -12,7 +19,7 @@ 2021-10-23 Oliver Kiddle <opk@zsh.org> - * 49499 based on 49496 by Jun T.: Src/Zle/computil.c + * 49499 based on 49496 by Jun T.: Src/Zle/computil.c, Test/Y03arguments.ztst: fixes to option -A of _arguments * 49500: Completion/Linux/Command/_lsns: new completion diff --git a/Completion/Base/Utility/_arguments b/Completion/Base/Utility/_arguments index cab7c929e..5ff34ff47 100644 --- a/Completion/Base/Utility/_arguments +++ b/Completion/Base/Utility/_arguments @@ -513,8 +513,8 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then tmp2=( "${PREFIX}${(@M)^${(@)${(@)tmp1%%:*}#[-+]}:#?}" ) _describe -O option \ - tmp1 tmp2 -Q -S '' -- \ - tmp3 -Q + tmp1 tmp2 -S '' -- \ + tmp3 [[ -n "$optarg" && "$single" = next && nm -eq $compstate[nmatches] ]] && _all_labels options expl option \ @@ -525,9 +525,9 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then else next+=( "$odirect[@]" ) _describe -O option \ - next -Q -M "$matcher" -- \ - direct -QS '' -M "$matcher" -- \ - equal -QqS= -M "$matcher" + next -M "$matcher" -- \ + direct -S '' -M "$matcher" -- \ + equal -qS= -M "$matcher" fi PREFIX="$prevpre" IPREFIX="$previpre" diff --git a/Completion/Darwin/Command/_qtplay b/Completion/Darwin/Command/_qtplay index 39a7c6de2..839efee83 100644 --- a/Completion/Darwin/Command/_qtplay +++ b/Completion/Darwin/Command/_qtplay @@ -15,6 +15,6 @@ _arguments -S \ '-t[specify update time]:update time (seconds)' \ '-T[kill time]:ticks' \ '-V[volume]:percentage of normal volume' \ - '(-)'{-?,--help,-h}'[display help information]' \ + '(-)'{-\?,--help,-h}'[display help information]' \ '(-)*:quicktime file:_files' diff --git a/Completion/Unix/Command/_less b/Completion/Unix/Command/_less index 0b474b991..ae912a633 100644 --- a/Completion/Unix/Command/_less +++ b/Completion/Unix/Command/_less @@ -80,9 +80,9 @@ _arguments -S -s -A "[-+]*" \ '--no-keypad[disable use of keypad terminal init string]' \ '(-y --max-forw-scroll)'{-y,--max-forw-scroll}'[specify forward scroll limit]' \ '(-z --window)'{-z+,--window=}'[specify scrolling window size]:lines' \ - '(-\" --quotes)'{-\"+,--quotes=}'[change quoting character]:quoting characters' \ + '(-" --quotes)'{-\"+,--quotes=}'[change quoting character]:quoting characters' \ '(-~ --tilde)'{-~,--tilde}"[don't display tildes after end of file]" \ - '(-\# --shift)'{-\#+,--shift=}"[specify amount to move when scrolling horizontally]:number" \ + '(-# --shift)'{-\#+,--shift=}"[specify amount to move when scrolling horizontally]:number" \ '--file-size[automatically determine the size of the input file]' \ '--incsearch[search file as each pattern character is typed in]' \ '--line-num-width=[set the width of line number field]:width [7]' \ diff --git a/Completion/Unix/Command/_nm b/Completion/Unix/Command/_nm index 79f537ac6..888f1ef87 100644 --- a/Completion/Unix/Command/_nm +++ b/Completion/Unix/Command/_nm @@ -53,7 +53,7 @@ if _pick_variant -r variant binutils=GNU elftoolchain=elftoolchain elfutils=elfu '(-C)--demangle[decode symbol names]' '(--format -P)-f+[specify output format]:format:(bsd sysv posix)' '(- *)--usage[give a short usage message]' - '(- *)-\\?[display help information]' + '(- *)-?[display help information]' ) ;; binutils) diff --git a/Completion/Unix/Command/_php b/Completion/Unix/Command/_php index c4c4ab3e2..9a8f519b1 100644 --- a/Completion/Unix/Command/_php +++ b/Completion/Unix/Command/_php @@ -93,7 +93,7 @@ _php() { + '(hv)' # Help/version options; kept separate by convention '(- 1 *)'{-h,--help}'[display help information]' '(- 1 *)'{-v,--version}'[display version information]' - '!(- 1 *)'{-\?,-\\\?,--usage} + '!(- 1 *)'{-\?,--usage} + '(im)' # Info/module options (exclusive with everything but -c/-n) '(fi mc pb pf rf rn sc sv *)'{-i,--info}'[display configuration information (phpinfo())]' diff --git a/Completion/Unix/Command/_strings b/Completion/Unix/Command/_strings index af95af52f..685daa286 100644 --- a/Completion/Unix/Command/_strings +++ b/Completion/Unix/Command/_strings @@ -45,7 +45,7 @@ if _pick_variant -r variant binutils=GNU elftoolchain=elftoolchain elfutils=elfu elfutils) args+=( '(- *)--usage[display a short usage message]' - '(- *)-\\?[display help information]' + '(- *)-?[display help information]' ) ;; esac diff --git a/Completion/Unix/Command/_zip b/Completion/Unix/Command/_zip index bc9aab1a5..cfa51be36 100644 --- a/Completion/Unix/Command/_zip +++ b/Completion/Unix/Command/_zip @@ -115,7 +115,7 @@ case $service in '(-U)-UU[ignore any Unicode fields]' \ '-W[modify pattern matching so only ** matches /]' \ '-\:[allow extraction outside of extraction base directory]' \ - '-\\\^[allow control characters in extracted entries]' \ + '-^[allow control characters in extracted entries]' \ '-i[include the following names]:*-*:pattern' \ '-x[exclude the following names]:*-*:pattern' \ "(-p -f -u -l -t -z -n -o -j -C -X -q -qq -a -aa -v -L -M)1:zip file:_files -g '(#i)*.(zip|xpi|[ejw]ar)(-.)'" \ diff --git a/Completion/X/Command/_gnome-gv b/Completion/X/Command/_gnome-gv index 25de6fadf..b1b66e2a4 100644 --- a/Completion/X/Command/_gnome-gv +++ b/Completion/X/Command/_gnome-gv @@ -1,6 +1,6 @@ #compdef gnome-gv ggv _arguments \ - '(--help)-\\?[help]' \ + '(--help)-?[help]' \ '(--windows)-w[number of empty windows]:number:' \ '*:file: _pspdf -z' -- -- cgit v1.2.3 From 9c515a5a2f67e39b049d50e364ebfe17e536cc23 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Fri, 12 Nov 2021 22:00:10 +0100 Subject: unposted: fix case statement fall-through for ansible-galaxy role completion --- ChangeLog | 3 +++ Completion/Unix/Command/_ansible | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 1be5a36e3..350b23f9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-11-12 Oliver Kiddle <opk@zsh.org> + * unposted: Completion/Unix/Command/_ansible: fix case statement + fall-through for ansible-galaxy role completion + * 49566: Doc/Zsh/compsys.yo: document the _default function * 49564: Completion/Unix/Type/_files, Doc/Zsh/compsys.yo: always diff --git a/Completion/Unix/Command/_ansible b/Completion/Unix/Command/_ansible index 6ec7d0c2e..785ae45d0 100644 --- a/Completion/Unix/Command/_ansible +++ b/Completion/Unix/Command/_ansible @@ -278,7 +278,7 @@ case $state in ;| role-(info|init|install|list|remove)) args+=( '*: :_guard "^-*" "role name"' ) - ;; + ;| role-(info|search|list|remove|install)) args+=( '(-p --roles-path)'{-p,--roles-path}'[specify location of roles]:path:_directories' ) ;| -- cgit v1.2.3 From 356dcb20cef387a5eea5f8fcbfe123b24e3bb928 Mon Sep 17 00:00:00 2001 From: Dimitris Apostolou <dimitris.apostolou@icloud.com> Date: Fri, 12 Nov 2021 23:33:37 +0200 Subject: github #82: Fix typos --- ChangeLog | 11 +++++++++++ Completion/BSD/Command/_kdump | 2 +- Completion/BSD/Command/_ktrace | 2 +- Completion/Debian/Command/_aptitude | 2 +- Completion/Linux/Command/_modutils | 2 +- Completion/Linux/Command/_sysstat | 2 +- Completion/Mandriva/Command/_urpmi | 2 +- Completion/Redhat/Command/_dnf | 2 +- Completion/Unix/Command/_ansible | 2 +- Completion/Unix/Command/_gcc | 4 ++-- Etc/FAQ.yo | 4 ++-- Etc/NEWS-4.3 | 2 +- Functions/Chpwd/cdr | 2 +- Functions/Misc/regexp-replace | 2 +- Functions/Newuser/zsh-newuser-install | 2 +- NEWS | 2 +- Src/Zle/compmatch.c | 8 ++++---- Src/exec.c | 2 +- Src/math.c | 4 ++-- Test/A01grammar.ztst | 2 +- Test/B12limit.ztst | 2 +- 21 files changed, 37 insertions(+), 26 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index de6bbb08b..1dfe2e39a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2021-11-12 Oliver Kiddle <opk@zsh.org> + * github #82: Dimitris Apostolou: Completion/BSD/Command/_kdump, + Completion/Redhat/Command/_dnf, Completion/BSD/Command/_ktrace, + Completion/Linux/Command/_modutils, Test/A01grammar.ztst, + Completion/Linux/Command/_sysstat, Functions/Chpwd/cdr, + Completion/Unix/Command/_ansible, Completion/Unix/Command/_gcc, + Completion/Mandriva/Command/_urpmi, Etc/NEWS-4.3, + Completion/Debian/Command/_aptitude, Etc/FAQ.yo, + Functions/Newuser/zsh-newuser-install, NEWS, + Functions/Misc/regexp-replace, Src/Zle/compmatch.c, + Src/exec.c, Src/math.c, Test/B12limit.ztst: fix typos + * Marlon: 49572: Completion/Base/Completer/_expand, Test/Y01completion.ztst: Let _expand preserve array form w/out zstyle glob diff --git a/Completion/BSD/Command/_kdump b/Completion/BSD/Command/_kdump index 946296a75..e5c7c4cce 100644 --- a/Completion/BSD/Command/_kdump +++ b/Completion/BSD/Command/_kdump @@ -30,7 +30,7 @@ local args=( '-f+[use the specified file (- for stdin)]:dump file:_files' '-l[loop reading the trace file]' '-m+[maximum I/O bytes to display]:max data bytes:' - '-n[supress ad hoc translations]' + '-n[suppress ad hoc translations]' '-p+[show output only for the specified pid]: :_kdump_pid' '(-E -T)-R[display relative timestamps]' '(-E -R )-T[display absolute timestamps]' diff --git a/Completion/BSD/Command/_ktrace b/Completion/BSD/Command/_ktrace index 13c11f15d..9613ba2bf 100644 --- a/Completion/BSD/Command/_ktrace +++ b/Completion/BSD/Command/_ktrace @@ -4,7 +4,7 @@ local args=( '-a[append to the trace file]' '(*)-C[disable tracing on all user owned processes or all processes if executed by root]' '-c[clear the trace points]' - '-d[trace current decendants]' + '-d[trace current descendants]' '-f+[log trace to specified file]:trace file:_files' '(-p *)-g+[enable/disable tracing on specified process group]:pgid:_pgids' '-i[inherit trace flags on future children]' diff --git a/Completion/Debian/Command/_aptitude b/Completion/Debian/Command/_aptitude index 91d233f11..5b10adb80 100644 --- a/Completion/Debian/Command/_aptitude +++ b/Completion/Debian/Command/_aptitude @@ -15,7 +15,7 @@ _arguments -C \ '(-F --display-format)'{-F,--display-format}'[specify output format for search command]:format:->format-strings' \ '--group-by=[control how the versions command groups its output]:grouping:(archive auto none package source-package source-version)' \ '--log-file=[specify output log file]:file:_files' \ - '*--log-level=[specify mimimum message level to log]:level:compadd -o nosort off fatal error warn info debug trace' \ + '*--log-level=[specify minimum message level to log]:level:compadd -o nosort off fatal error warn info debug trace' \ '--log-resolver[set some standard log levels related to the resolver]' \ '(--allow-new-installs)--no-new-installs[prevent safe-upgrade from installing any new packages]' \ '(--allow-new-upgrades)--no-new-upgrades[prevent safe-upgrade from upgrading packages regardless]' \ diff --git a/Completion/Linux/Command/_modutils b/Completion/Linux/Command/_modutils index 1205f2506..3e46130a2 100644 --- a/Completion/Linux/Command/_modutils +++ b/Completion/Linux/Command/_modutils @@ -105,7 +105,7 @@ _modutils() { loaded-modules|loadable-modules) if [[ -r /proc/modules ]]; then loaded_modules=(${${(f)"$(</proc/modules)"}%% *}) - # For compatibilty with old systems. Kernels nowadays provide + # For compatibility with old systems. Kernels nowadays provide # `/proc/modules` which is more reliable and faster for us. elif [[ -x /sbin/lsmod ]]; then loaded_modules=(${${(f)"$(_call_program loaded-modules /sbin/lsmod)"}[2,-1]%% *}) diff --git a/Completion/Linux/Command/_sysstat b/Completion/Linux/Command/_sysstat index eba99fc5a..5620da73d 100644 --- a/Completion/Linux/Command/_sysstat +++ b/Completion/Linux/Command/_sysstat @@ -52,7 +52,7 @@ _sadf() { '(-g -j -p -r -x)-h[print on a single line when used with -d]' \ '-O[specify output options]: : _values -s , option autoscale bwcol customcol height\:value oneday packed showidle showinfo showtoc skipempty hz\:value pcparchive\:name\:_files debug' \ - '-P[restrict processor dependant statistics]:processor number(zero indexed) or ALL:(ALL)' \ + '-P[restrict processor dependent statistics]:processor number(zero indexed) or ALL:(ALL)' \ '--dev=-[specify block devices for which statistics are to be displayed]:block device:_files -g "*(-%)"' \ '--fs=-[specify filesystems for which statistics are to be displayed]:file system:_dir_list -s ,' \ '--iface=-[specify network interfaces for which statistics are to be displayed]:network interface:_sequence _net_interfaces' \ diff --git a/Completion/Mandriva/Command/_urpmi b/Completion/Mandriva/Command/_urpmi index be6350129..21c44ffaa 100644 --- a/Completion/Mandriva/Command/_urpmi +++ b/Completion/Mandriva/Command/_urpmi @@ -131,7 +131,7 @@ _urpmi() { "($help --no-probe --probe-hdlist)--probe-synthesis[try to find and use synthesis file]" \ "($help)--update[mark as update media]" \ "($help)--version[use specified distribution version]:Mandrake version: " \ - "($help)--virtual[create virtual media wich are always up-to-date]" \ + "($help)--virtual[create virtual media which are always up-to-date]" \ "($help)-c[clean headers cache directory]" \ "($help)-f[force generation of hdlist files]" \ "($help --distrib):name of media: " \ diff --git a/Completion/Redhat/Command/_dnf b/Completion/Redhat/Command/_dnf index 174788ec6..ce111f38f 100644 --- a/Completion/Redhat/Command/_dnf +++ b/Completion/Redhat/Command/_dnf @@ -345,7 +345,7 @@ _dnf_command() { ;; clean) tmp=( - 'dbcache:remove chache files generated from the repository metadata' + 'dbcache:remove cache files generated from the repository metadata' 'expire-cache:mark the repository metadata expired' 'metadata:remove the repository metadata' 'packages:remove any cached packages' diff --git a/Completion/Unix/Command/_ansible b/Completion/Unix/Command/_ansible index 785ae45d0..2d976b0a0 100644 --- a/Completion/Unix/Command/_ansible +++ b/Completion/Unix/Command/_ansible @@ -358,7 +358,7 @@ case $state in '(-p --collections-path)'{-p+,--collections-path=}'[specify directory containing collections]:_directories' '(-r --requirements-file *)'{-r+,--requirements-file=}'[specify file containing a list of collections to install]:file:_files' '--pre[include pre-release versions]' - '*:collecion name:_files' + '*:collection name:_files' ) ;; esac diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index b6f1da2c6..ac0e8fda3 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -957,10 +957,10 @@ if [[ "$service" = clang* ]]; then '-fveclib=[use the given vector functions library]:arg' '-fvectorize[enable the loop vectorization passes]' '-fvirtual-function-elimination[enables dead virtual function elimination optimization]' - '-fvisibility-dllexport=[the visibility for dllexport defintions]:arg' + '-fvisibility-dllexport=[the visibility for dllexport definitions]:arg' '-fvisibility-externs-dllimport=[the visibility for dllimport external declarations]:arg' '-fvisibility-externs-nodllstorageclass=[the visibility for external declarations without an explicit DLL dllstorageclass]:arg' - '-fvisibility-from-dllstorageclass[set the visiblity of symbols in the generated code from their DLL storage class]' + '-fvisibility-from-dllstorageclass[set the visibility of symbols in the generated code from their DLL storage class]' '-fvisibility-global-new-delete-hidden[give global C++ operator new and delete declarations hidden visibility]' '-fvisibility-inlines-hidden[give inline C++ member functions hidden visibility by default]' '-fvisibility-inlines-hidden-static-local-var[visibility inlines hidden static local var]' diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo index 20f6449f1..235a205d3 100644 --- a/Etc/FAQ.yo +++ b/Etc/FAQ.yo @@ -333,7 +333,7 @@ sect(What's the latest version?) Changes of this kind are almost always forced by an awkward or unnecessary feature in the original design (as perceived by current users), or to enhance compatibility with other Bourne shell - derivatives, or (mostly in the 3.0 series) to provide POSIX compliancy. + derivatives, or (mostly in the 3.0 series) to provide POSIX compliance. sect(Where do I get it?) @@ -871,7 +871,7 @@ label(25) the most obvious difference from zsh is that it does not attempt to emulate the Korn shell. Since both shells are under active development it is probably not sensible to be too specific here. - Broadly, bash has paid more attention to standards compliancy + Broadly, bash has paid more attention to standards compliance (i.e. POSIX) for longer, and has so far avoided the more abstruse interactive features (programmable completion, etc.) that zsh has. diff --git a/Etc/NEWS-4.3 b/Etc/NEWS-4.3 index 19b3daada..8d93af134 100644 --- a/Etc/NEWS-4.3 +++ b/Etc/NEWS-4.3 @@ -139,7 +139,7 @@ The new shell option POSIX_CD, active in emulations of POSIX-based shells, makes the cd builtin POSIX-compatible. The POSIX_JOBS option already referred to has various other -compatibility enchancements. +compatibility enhancements. The new shell option POSIX_STRINGS makes a null character in $'...' expansion terminate the string, as is already the case in bash. This is diff --git a/Functions/Chpwd/cdr b/Functions/Chpwd/cdr index 4bed88b13..43745e5aa 100644 --- a/Functions/Chpwd/cdr +++ b/Functions/Chpwd/cdr @@ -55,7 +55,7 @@ # pattern from the directory list. The match is against the fully # expanded directory path and the full string must match (use wildcards # at the ends if needed). If output is going to a terminal, the -# function will print the new list for the user to confrim; this can be +# function will print the new list for the user to confirm; this can be # skipped by giving -P instead of -p. # # Details of directory handling diff --git a/Functions/Misc/regexp-replace b/Functions/Misc/regexp-replace index 0d5948075..d4408f0f7 100644 --- a/Functions/Misc/regexp-replace +++ b/Functions/Misc/regexp-replace @@ -40,7 +40,7 @@ if (( $4 )); then # append offsets and computed replacement to the array # we need to perform the evaluation in a scalar assignment so that if # it generates an array, the elements are converted to string (by - # joining with the first chararacter of $IFS as usual) + # joining with the first character of $IFS as usual) 5=${(e)3} argv+=(${(s: :)ZPCRE_OP} "$5") diff --git a/Functions/Newuser/zsh-newuser-install b/Functions/Newuser/zsh-newuser-install index 60ac16b13..9e911d07c 100644 --- a/Functions/Newuser/zsh-newuser-install +++ b/Functions/Newuser/zsh-newuser-install @@ -627,7 +627,7 @@ Type: } -# Print and despatch a submenu. +# Print and dispatch a submenu. # The first argument is the title. The remaining arguments # are pairs of descriptions and functions to execute. # There shouldn't be more than 9 entries. diff --git a/NEWS b/NEWS index aac10eddb..3459391e7 100644 --- a/NEWS +++ b/NEWS @@ -571,7 +571,7 @@ Here is a summary of the most significant changes: - The zshroadmap manual page provides a slightly more helpful introduction to the shell manual than was previously available. -- There have been some notable enhancements to POSIX comptability +- There have been some notable enhancements to POSIX compatibility when the shell is in a corresponding emulation (e.g. "emulate sh"). Expansion (parameters, globbing, etc.) and redirection diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c index 95eff1e92..56e5509a4 100644 --- a/Src/Zle/compmatch.c +++ b/Src/Zle/compmatch.c @@ -1438,7 +1438,7 @@ pattern_match_restrict(Cpattern p, Cpattern wp, convchar_t *wsc, int wsclen, /* * If either is "?", they match each other; no further tests. - * Apply this even if the character wasn't convertable; + * Apply this even if the character wasn't convertible; * there's no point trying to be clever in that case. */ if (p->tp != CPAT_ANY || wp->tp != CPAT_ANY) @@ -1496,7 +1496,7 @@ pattern_match_restrict(Cpattern p, Cpattern wp, convchar_t *wsc, int wsclen, * characters. We're matching two patterns against * one another to generate a character to insert. * This is a bit too psychedelic, so I'm going to - * bale out now. See you on the ground. + * bail out now. See you on the ground. */ return 0; } @@ -1564,7 +1564,7 @@ pattern_match(Cpattern p, char *s, Cpattern wp, char *ws) c = unmeta_one(s, &len); /* * If either is "?", they match each other; no further tests. - * Apply this even if the character wasn't convertable; + * Apply this even if the character wasn't convertible; * there's no point trying to be clever in that case. */ if (p->tp != CPAT_ANY || wp->tp != CPAT_ANY) @@ -1934,7 +1934,7 @@ bld_line(Cmatcher mp, ZLE_STRING_T line, char *mword, char *word, * This is the nightmare case: we have line and * and word matchers and some pattern which restricts * the value on the line without us knowing exactly - * what it is. Despatch to the special function + * what it is. Dispatch to the special function * for that. */ if (mp && !mp->flags && mp->wlen <= wlen && diff --git a/Src/exec.c b/Src/exec.c index 1f23a862d..1860a10ed 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -3954,7 +3954,7 @@ execcmd_exec(Estate state, Execcmd_params eparams, if (type == WC_AUTOFN) { /* * We pre-loaded this to get any redirs. - * So we execuate a simplified function here. + * So we execute a simplified function here. */ lastval = execautofn_basic(state, do_exec); } else diff --git a/Src/math.c b/Src/math.c index ade02d80c..4f24361a4 100644 --- a/Src/math.c +++ b/Src/math.c @@ -162,7 +162,7 @@ static int unary = 1; #define TOKCOUNT 53 /* - * Opeator recedences: in reverse order, i.e. lower number, high precedence. + * Operator precedences: in reverse order, i.e. lower number, high precedence. * These are the C precedences. * * 0 Non-operators: NUM (numeric constant), ID (identifier), @@ -219,7 +219,7 @@ static int c_prec[TOKCOUNT] = }; /* - * Opeator recedences: in reverse order, i.e. lower number, high precedence. + * Operator precedences: in reverse order, i.e. lower number, high precedence. * These are the default zsh precedences. * * 0 Non-operators: NUM (numeric constant), ID (identifier), diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst index c114ff103..ac39a4eea 100644 --- a/Test/A01grammar.ztst +++ b/Test/A01grammar.ztst @@ -922,7 +922,7 @@ F:Note that the behaviour of 'exit' inside try-list inside a function is unspeci x=1 x=2 | echo $x echo $x -0:Assignment-only current shell commands in LHS of pipelin +0:Assignment-only current shell commands in LHS of pipeline >1 >1 diff --git a/Test/B12limit.ztst b/Test/B12limit.ztst index 48d33e6e3..9dce59824 100644 --- a/Test/B12limit.ztst +++ b/Test/B12limit.ztst @@ -11,7 +11,7 @@ %test limit | grep UNKNOWN || print OK -0:Check if there is unknown resouce(s) in the system +0:Check if there is unknown resource(s) in the system >OK F:A failure here does not indicate any error in zsh. It just means there F:is a resource in your system that is unknown to zsh developers. Please -- cgit v1.2.3 From 8cf76fb8f923917af3c21036c5132256d6b421e1 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Fri, 19 Nov 2021 21:50:33 +0100 Subject: 49584: allow for build options in gem install completion --- ChangeLog | 3 +++ Completion/Unix/Command/_gem | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index eb5eb5ed1..9c6d1b5a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-11-19 Oliver Kiddle <opk@zsh.org> + * 49584: Completion/Unix/Command/_gem: allow for build options + in gem install completion + * Arseny Maslennikov: 49575: Doc/Zsh/compsys.yo: clarify _alternative's action syntax diff --git a/Completion/Unix/Command/_gem b/Completion/Unix/Command/_gem index 7e244ccad..7d81619bb 100644 --- a/Completion/Unix/Command/_gem +++ b/Completion/Unix/Command/_gem @@ -56,6 +56,11 @@ if [[ $state = command ]]; then check|cleanup|contents|dependency|list|open|pristine|rdoc|uninstall|unpack|update) args+=( '(--all --skip)*:installed gem:->gems-local' ) ;| + install) + (( ${(M)#line:#[^-]*} > 1 )) && args+=( + '(*)--[specify build options]:*:build option:_default' + ) + ;| fetch|install|lock|owner|search|yank) args+=( '*:gem:->gems-remote' ) ;| -- cgit v1.2.3 From 973e356c34378d3d81585f83efe1349fc6c58d06 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Fri, 19 Nov 2021 21:54:50 +0100 Subject: 49594: adapt to changes in 49499 to ensure file modes starting with dash aren't taken to be flags --- ChangeLog | 3 +++ Completion/Unix/Command/_chmod | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 9c6d1b5a2..d678081a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-11-19 Oliver Kiddle <opk@zsh.org> + * 49594: Completion/Unix/Command/_chmod: adapt to changes in 49499 + to ensure file modes starting with dash aren't taken to be flags + * 49584: Completion/Unix/Command/_gem: allow for build options in gem install completion diff --git a/Completion/Unix/Command/_chmod b/Completion/Unix/Command/_chmod index 3f6db7e91..42e3fa63b 100644 --- a/Completion/Unix/Command/_chmod +++ b/Completion/Unix/Command/_chmod @@ -1,7 +1,10 @@ #compdef chmod gchmod zf_chmod local curcontext="$curcontext" state line expl ret=1 variant -local -a args privs aopts=( -A '-*' ) +local -a args privs aopts + +# usual -* pattern picks up valid non-options, e.g. -x which is like a-x +aopts=( -A '-[^gorstuwxX]*' ) args=( '*: :->files' '1: :_file_modes' ) -- cgit v1.2.3 From 16d5d6a9dae526355caf16f2de9d57d84b5d9993 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Wed, 24 Nov 2021 23:07:18 +0100 Subject: 49597: add a helper for completing numbers with unit suffixes and separate out defaults, ranges and units in completion descriptions --- ChangeLog | 14 +++++++ Completion/BSD/Command/_ipfw | 4 +- Completion/Base/Core/_description | 8 ++++ Completion/Base/Utility/_numbers | 87 +++++++++++++++++++++++++++++++++++++++ Completion/Linux/Command/_btrfs | 8 ++-- Completion/Unix/Command/_dd | 14 ++++--- Completion/Unix/Command/_git | 6 +-- Completion/Unix/Command/_head | 22 ++++------ Completion/Unix/Command/_killall | 12 ++---- Completion/Unix/Command/_pv | 18 ++------ Completion/Unix/Command/_rclone | 10 ++--- Completion/Unix/Command/_rsync | 10 ++--- Completion/Unix/Command/_stdbuf | 6 ++- Completion/Unix/Command/_tail | 22 ++++------ Completion/Unix/Command/_timeout | 2 +- Completion/Unix/Command/_zfs | 20 ++++++--- Completion/X/Command/_xset | 4 +- Doc/Zsh/compsys.yo | 81 +++++++++++++++++++++++++++++++++++- 18 files changed, 258 insertions(+), 90 deletions(-) create mode 100644 Completion/Base/Utility/_numbers (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index bb8b73085..d7b225d42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2021-11-24 Oliver Kiddle <opk@zsh.org> + + * 49597: Completion/Base/Core/_description, Doc/Zsh/compsys.yo, + Completion/Base/Utility/_numbers, Completion/BSD/Command/_ipfw, + Completion/Linux/Command/_btrfs, Completion/Unix/Command/_dd, + Completion/Unix/Command/_git, Completion/Unix/Command/_head, + Completion/Unix/Command/_killall, Completion/Unix/Command/_pv, + Completion/Unix/Command/_rclone, Completion/Unix/Command/_rsync, + Completion/Unix/Command/_stdbuf, Completion/Unix/Command/_tail, + Completion/Unix/Command/_timeout, Completion/Unix/Command/_zfs, + Completion/X/Command/_xset: add a helper for completing numbers + with unit suffixes and separate out defaults, ranges and units + in completion descriptions + 2021-11-22 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> * 49586: Src/hist.c: fix :a and :A modifiers (with PWD="/") on diff --git a/Completion/BSD/Command/_ipfw b/Completion/BSD/Command/_ipfw index 2354a70fe..49d0ef1e8 100644 --- a/Completion/BSD/Command/_ipfw +++ b/Completion/BSD/Command/_ipfw @@ -249,8 +249,8 @@ actions=( $'/(pipe|queue|sched)[ \t\0]/' -'pqs=${match%?}' ':dummynet-commands:dummynet configuration:$ca pipe queue sched' $word ': _message -e numbers number' $word ':options:config:$ca config' - \( $'/bw[ \t\0]/' \( $'/<->/' ': _guard "[0-9]#" bandwidth' - $word ':units:unit:compadd -M "m:{a-z}={A-Z}" {K,M,G}{bit,Byte}/s' + \( $'/bw[ \t\0]/' + \( $word ':bandwidths: :_numbers -M "m:{a-z}={A-Z}" bandwidth {K,M,G}{bit,Byte}/s' \| $word ':devices:device:_net_interfaces -qS " "' \) \| $'/delay[ \t\0]/' $word ': _message -e numbers "propagation delay (ms)"' \| $'/burst[ \t\0]/' $word ': _message -e numbers "size (bytes)"' diff --git a/Completion/Base/Core/_description b/Completion/Base/Core/_description index 5b54484c7..368b41ee2 100644 --- a/Completion/Base/Core/_description +++ b/Completion/Base/Core/_description @@ -2,6 +2,7 @@ local name nopt xopt format gname hidden hide match opts tag local -a ign gropt sort +local -a match mbegin mend opts=() @@ -78,6 +79,13 @@ shift 2 if [[ -z "$1" && $# -eq 1 ]]; then format= elif [[ -n "$format" ]]; then + if [[ -z $2 ]]; then + argv+=( h:${1%%( ##\((#b)([^\)]#[^0-9-][^\)]#)(#B)\)|)( ##\((#b)([0-9-]##)(#B)\)|)( ##\[(#b)([^\]]##)(#B)\]|)} ) + [[ -n $match[1] ]] && argv+=( m:$match[1] ) + [[ -n $match[2] ]] && argv+=( r:$match[2] ) + [[ -n $match[3] ]] && argv+=( o:$match[3] ) + fi + zformat -F format "$format" "d:$1" "${(@)argv[2,-1]}" fi diff --git a/Completion/Base/Utility/_numbers b/Completion/Base/Utility/_numbers new file mode 100644 index 000000000..97bb8b4c8 --- /dev/null +++ b/Completion/Base/Utility/_numbers @@ -0,0 +1,87 @@ +#autoload + +# Usage: _numbers [compadd options] [-t tag] [-f|-N] [-u units] [-l min] [-m max] \ +# [-d default] ["description"] [unit-suffix...] + +# -t : specify a tag (defaults to 'numbers') +# -u : indicate the units, e.g. seconds +# -l : lowest possible value +# -m : maximum possible value +# -d : default value +# -N : allow negative numbers (implied by range including a negative) +# -f : allow decimals (float) + +# For a unit-suffix, an initial colon indicates a unit that asserts the default +# otherwise, colons allow for descriptions, e.g: + +# :s:seconds m:minutes h:hours + +# unit-suffixes are not sorted by the completion system when listed +# Specify them in order of magnitude, this tends to be ascending unless +# the default is of a higher magnitude, in which case, descending. +# So for, example +# bytes kB MB GB +# s ms us ns +# Where the compadd options include matching control or suffixes, these +# are applied to the units + +# For each unit-suffix, the format style is looked up with the +# unit-suffixes tag and the results concatenated. Specs used are: +# x : the suffix +# X : suffix description +# d : indicate suffix is for the default unit +# i : list index +# r : reverse list index +# The latter three of these are useful with ternary expressions. + +# _description is called with the x token set to make the completed +# list of suffixes available to the normal format style + +local desc tag range suffixes suffix suffixfmt pat='<->' partial='' +local -a expl formats +local -a default max min keep tags units +local -i i +local -A opts + +zparseopts -K -D -A opts M+:=keep q:=keep s+:=keep S+:=keep J+: V+: 1 2 o+: n F: x+: X+: \ + t:=tags u:=units l:=min m:=max d:=default f=type e=type N=type + +desc="${1:-number}" tag="${tags[2]:-numbers}" +(( $# )) && shift + +[[ -n ${(M)type:#-f} ]] && pat='(<->.[0-9]#|[0-9]#.<->|<->)' partial='(|.)' +[[ -n ${(M)type:#-N} || $min[2] = -* || $max[2] = -* ]] && \ + pat="(|-)$pat" partial="(|-)$partial" + +if (( $#argv )) && compset -P "$pat"; then + zstyle -s ":completion:${curcontext}:units" list-separator sep || sep=-- + _description -V units expl unit + disp=( ${${argv#:}/:/ $sep } ) + compadd -M 'r:|/=* r:|=*' -d disp "$keep[@]" "$expl[@]" - ${${argv#:}%%:*} + return +elif [[ -prefix $~pat || $PREFIX = $~partial ]]; then + formats=( "h:$desc" ) + (( $#units )) && formats+=( m:${units[2]} ) desc+=" ($units[2])" + (( $#min )) && range="$min[2]-" + (( $#max )) && range="${range:--}$max[2]" + [[ -n $range ]] && formats+=( r:$range ) desc+=" ($range)" + (( $#default )) && formats+=( o:${default[2]} ) desc+=" [$default[2]]" + + zstyle -s ":completion:${curcontext}:unit-suffixes" format suffixfmt || \ + suffixfmt='%(d.%U.)%x%(d.%u.)%(r..|)' + for ((i=0;i<$#;i++)); do + zformat -f suffix "$suffixfmt" "x:${${argv[i+1]#:}%%:*}" \ + "X:${${argv[i+1]#:}#*:}" "d:${#${argv[i+1]}[1]#:}" \ + i:i r:$(( $# - i - 1)) + suffixes+="$suffix" + done + [[ -n $suffixes ]] && formats+=( x:$suffixes ) + + _comp_mesg=yes + _description -x $tag expl "$desc" $formats + [[ $compstate[insert] = *unambiguous* ]] && compstate[insert]= + compadd "$expl[@]" + return 0 +fi + +return 1 diff --git a/Completion/Linux/Command/_btrfs b/Completion/Linux/Command/_btrfs index bb0f724e6..65cf067aa 100644 --- a/Completion/Linux/Command/_btrfs +++ b/Completion/Linux/Command/_btrfs @@ -147,16 +147,16 @@ while (( $#state )); do '--tbytes[show sizes in TiB, or TB with --si]' ) ;| - filesystem:resize) args+=( '1:size:_guard "(|+|-)[0-9]#[GKM]"' '2:path:->mounts' );; + filesystem:resize) args+=( '1: :_numbers -u bytes -N size K M G T P E' '2:path:->mounts' );; filesystem:defragment) args+=( '!-v' '-r[defragment files recursively]' '-c+[compress files while defragmenting]::compression algorithm:(zlib lzo zstd)' '-r[defragment files recursively]' '-f[flush after defragmenting]' - '-s[start position]:byte position' - '-l[defragment limited number of bytes]:length (bytes)' - '-t[defragment only files over a certain size]:minimum size (bytes) [32M]' + '-s[start position]: :_numbers -u bytes -d "beginning of file" offset K M G T P E' + '-l[defragment limited number of bytes]: :_numbers -u bytes length K M G T P E' + '-t[defragment only extents up to a certain size]: :_numbers -u bytes -d 32M "maximum extent size" K M G T P E' '*:file:_files' ) ;; diff --git a/Completion/Unix/Command/_dd b/Completion/Unix/Command/_dd index e5c5e63ce..10682bc8e 100644 --- a/Completion/Unix/Command/_dd +++ b/Completion/Unix/Command/_dd @@ -1,18 +1,19 @@ #compdef dd gdd -local -a vals conv flags +local -a vals conv flags units local variant +units=( w:word b:block k:1024 m g t ) _pick_variant -r variant gnu=GNU $OSTYPE --version vals=( - '(ibs obs)bs[block size]:block size (bytes)' - 'cbs[conversion buffer size]:buffer size (bytes)' + '(ibs obs)bs[block size]: :_numbers -u bytes "block size" $units' + 'cbs[conversion buffer size]: :_numbers -u bytes "buffer size" $units' 'conv[specify conversions to apply]: :_values -s , conversion $conv' 'count[number of input blocks to copy]:blocks' - '(bs)ibs[input block size]:block size (bytes)' + '(bs)ibs[input block size]: :_numbers -u bytes -d 512 "block size" $units' 'if[specify input file]:input file:_tilde_files' - '(bs)obs[output block size]:block size (bytes)' + '(bs)obs[output block size]: :_numbers -u bytes -d 512 "block size" $units' 'of[specify output file]:output file:_tilde_files' 'seek[output blocks initially skipped]:blocks' 'skip[input blocks initially skipped]:blocks' @@ -63,7 +64,7 @@ case $variant in freebsd*) vals+=( 'fillchar[specify padding character]:character' - 'speed[limit copying speed]:speed (bytes/second)' + 'speed[limit copying speed]: :_numbers -u bytes/second speed $units' ) conv+=( '(pareven parnone parodd parset)'{pareven,parnone,parodd,parset} @@ -75,6 +76,7 @@ case $variant in ) flags+=( fullblock noatime nocache count_bytes skip_bytes seek_bytes ) conv+=( excl nocreat fdatasync fsync ) + units=( c:1 w:2 b:512 kB:1000 K:1024 MB:1000^2 M:1024\^2 GB G TB T PB P EB E ZB Z YB Y ) ;; netbsd*) vals+=( diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 7c7fb22bc..c757376b0 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -3720,8 +3720,8 @@ _git-fast-import () { now\:"use current time and timezone"' \ '--done[terminate with error if there is no "done" command at the end of the stream]' \ '--force[force updating modified existing branches]' \ - '--max-pack-size=-[maximum size of each packfile]: : __git_guard_bytes' \ - '--big-file-threshold=-[maximum size of blob to create deltas for]: : __git_guard_bytes' \ + '--max-pack-size=-[maximum size of each packfile]: : __git_guard_bytes -d unlimited size' \ + '--big-file-threshold=-[maximum size of blob to create deltas for]: : __git_guard_bytes -d 512m size' \ '--depth=-[maximum delta depth for blob and tree deltification]: :__git_guard_number "maximum delta depth"' \ '--active-branches=-[maximum number of branches to maintain active at once]: :__git_guard_number "maximum number of branches"' \ '--export-marks=-[dump internal marks table when complete]: :_files' \ @@ -7506,7 +7506,7 @@ __git_guard_number () { (( $+functions[__git_guard_bytes] )) || __git_guard_bytes () { - _guard '[[:digit:]]#([kKmMgG]|)' ${*:-size} + _numbers -u bytes ${*:-size} k m g } (( $+functions[__git_datetimes] )) || diff --git a/Completion/Unix/Command/_head b/Completion/Unix/Command/_head index f25c97c83..0771b1e4d 100644 --- a/Completion/Unix/Command/_head +++ b/Completion/Unix/Command/_head @@ -32,20 +32,14 @@ _arguments -C -s -S $opts : $args '*:file:_files' && return 0 case $state in (number) - local mlt sign digit - mlt='multiplier:multiplier:((b\:512 K\:1024 KB\:1000 M\:1024\^2' - mlt+=' MB\:1000\^2 G\:1024\^3 GB\:1000\^3 T\:1024\^4 TB\:1000\^4))' - sign='sign:sign:((-\:"print all but the last specified bytes/lines"' - sign+=' +\:"print the first specified bytes/lines (default)"))' - digit='digits:digit:(0 1 2 3 4 5 6 7 8 9)' - if compset -P '(-|+|)[0-9]##'; then - _alternative $mlt $digit && ret=0 - elif [[ -z $PREFIX ]]; then - _alternative $sign $digit && ret=0 - elif compset -P '(+|-)'; then - _alternative $digit && ret=0 - fi - ;; + local alts + [[ -z $PREFIX ]] && alts=( + 'sign:sign:((-\:"print all but the last specified bytes/lines" +\:"print the first specified bytes/lines (default)"))' + ) + compset -P '+' + alts+=( 'numbers: :_numbers -N $state_descr b\:512 K\:1024 KB\:1000 M\:1024\^2 MB\:1000\^2 G\:1024\^3 GB\:1000\^3 T\:1024\^4 TB\:1000\^4' ) + _alternative $alts && ret=0 + ;; esac return ret diff --git a/Completion/Unix/Command/_killall b/Completion/Unix/Command/_killall index 36accb2e0..3ddd36341 100644 --- a/Completion/Unix/Command/_killall +++ b/Completion/Unix/Command/_killall @@ -38,15 +38,9 @@ if _pick_variant psmisc=PSmisc unix --version; then case $state in (time) - local -a units=( 's:seconds' 'm:minutes' 'h:hours' 'd:days' - 'w:weeks' 'M:months' 'y:years' ) - if compset -P '[0-9]##(|.[0-9]#)'; then - _alternative 'float-numbers:: _message "float number"' \ - 'units:: _describe unit units' && ret=0 - else - _message 'float number and unit' && ret=0 - fi - ;; + _numbers -fN age 's:seconds' 'm:minutes' 'h:hours' 'd:days' \ + 'w:weeks' 'M:months' 'y:years' + ;; esac return ret diff --git a/Completion/Unix/Command/_pv b/Completion/Unix/Command/_pv index 68f8e8586..d02d3a35d 100644 --- a/Completion/Unix/Command/_pv +++ b/Completion/Unix/Command/_pv @@ -25,7 +25,7 @@ _arguments -s -S $args \ '(-q --quiet)'{-q,--quiet}"[don't output any transfer information at all, useful with -L]" \ '(-W --wait)'{-W,--wait}'[display nothing until first byte transferred]' \ '(-D --delay-start -R --remote)'{-D+,--delay-start=}'[display nothing until delay has passed]:delay (seconds)' \ - '(-s --size)'{-s+,--size=}'[set estimated data size]:size (bytes):->size-unit' \ + '(-s --size)'{-s+,--size=}'[set estimated data size]: :_numbers -u bytes size K M G T' \ '(-l --line-mode -R --remote)'{-l,--line-mode}'[count lines instead of bytes]' \ '(-0 --null -l --line-mode)'{-0,--null}'[lines are null-terminated]' \ '(-i --interval)'{-i+,--interval=}'[update every after specified interval]:interval (seconds) [1]' \ @@ -34,8 +34,8 @@ _arguments -s -S $args \ '(-N --name)'{-N+,--name=}'[prefix visual information with given name]:name' \ '(-f --force -R --remote)'{-f,--force}'[output even if standard error is not a terminal]' \ '(-c --cursor -R --remote)'{-c,--cursor}'[use cursor positioning escape sequences]' \ - '(-L --rate-limit)'{-L+,--rate-limit=}'[limit transfer rate]:rate (bytes per second):->size-unit' \ - '(-B --buffer-size)'{-B+,--buffer-size=}'[use a buffer size of given size]:size (bytes):->size-unit' \ + '(-L --rate-limit)'{-L+,--rate-limit=}'[limit transfer rate]: :_numbers -u "bytes per second" rate K M G T' \ + '(-B --buffer-size)'{-B+,--buffer-size=}'[use a buffer size of given size]: :_numbers -u bytes size K M G T' \ '(-C --no-splice)'{-C,--no-splice}'[never use splice(), always use read/write]' \ '(-R --remote)*'{-E,--skip-errors}"[skip read errors in input${Edesc}]" \ '(-S --stop-at-size -R --remote)'{-S,--stop-at-size}'[stop after --size bytes have been transferred]' \ @@ -70,18 +70,6 @@ case $state in _pids $suf && ret=0 fi ;; - size-unit) - if compset -P '<->'; then - _tags values units - else - _tags values - fi - while _tags; do - _requested values && _message -e values "$state_descr" && ret=0 - _requested units expl unit compadd -o nosort - K M G T && ret=0 - (( ret )) || break - done - ;; esac return ret diff --git a/Completion/Unix/Command/_rclone b/Completion/Unix/Command/_rclone index 27b4dd926..a2e3429f5 100644 --- a/Completion/Unix/Command/_rclone +++ b/Completion/Unix/Command/_rclone @@ -62,7 +62,7 @@ _arguments -C \ '--backup-dir[make backups into hierarchy based at specified directory]:directory:_directories' \ '--bind[specify socal address to bind to for outgoing connections]:IPv4, IPv6 or name' \ '--buffer-size[specify in memory buffer size when reading files for each --transfer]:size [16M]' \ - '--bwlimit[specify bandwidth limit]:BwTimetable (kBytes/s or b|k|M|G suffix)' \ + '--bwlimit[specify bandwidth limit]: :_numbers -u kBytes/s limit b k M G' \ '--cache-dir[specify directory rclone will use for caching]:directory [~/.cache/rclone]:_directories' \ '--checkers[specify number of checkers to run in parallel]:number [8]': \ '(-c --checksum)'{-c,--checksum}'[skip based on checksum & size, not mod-time & size]' \ @@ -99,15 +99,15 @@ _arguments -C \ '--log-format[specify comma separated list of log format options]:string ["date,time"]' \ '--log-level[specify log level]:string [NOTICE]:(DEBUG INFO NOTICE ERROR)' \ '--low-level-retries[number of low level retries to do]:int [10]' \ - '--max-age[only transfer files younger than this in s or suffix ms|s|m|h|d|w|M|y]:duration [default off]' \ + '--max-age[only transfer files younger than specified age]: :_numbers -u seconds age ms\:milliseconds \:s\:seconds m\:minutes h\:hours d\:days w\:weeks M\:months y\:years' \ '--max-backlog[maximum number of objects in sync or check backlog]:int [10000]' \ '--max-delete[when synchronizing, limit the number of deletes]:delete limit [-1]' \ '--max-depth[limit the recursion depth]:depth [-1]' \ - '--max-size[only transfer files smaller than this in k or suffix b|k|M|G]:int [default off]' \ + '--max-size[only transfer files smaller than specified size]: :_numbers -u kBytes size \:k M G' \ '--max-transfer[maximum size of data to transfer]:int [default off]' \ '--memprofile[write memory profile to file]:file:_files' \ - '--min-age[only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y]:duration [default off]' \ - '--min-size[only transfer files bigger than this in k or suffix b|k|M|G]:int [default off]' \ + '--min-age[only transfer files older than specified age]: :_numbers -u seconds age ms\:milliseconds \:s\:seconds m\:minutes h\:hours d\:days w\:weeks M\:months y\:years' \ + '--min-size[only transfer files bigger than specified size]: :_numbers -u kBytes size \:k M G' \ '--modify-window[specify max time delta to be considered the same]:duration [1ns]' \ '--multi-thread-cutoff[use multi-threaded downloads for files above specified size]:size (250M)' \ '--multi-thread-streams[specify max number of streams to use for multi-threaded downloads]:number (4)' \ diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync index b1a4f6046..eb906e974 100644 --- a/Completion/Unix/Command/_rsync +++ b/Completion/Unix/Command/_rsync @@ -99,7 +99,7 @@ _rsync() { _arguments -s \ '*'{-v,--verbose}'[increase verbosity]' \ {--no-v,--no-verbose}'[turn off --verbose]' \ - '--bwlimit=[limit I/O bandwidth]:limit (KiB per second)' \ + '--bwlimit=[limit I/O bandwidth]: :_numbers -f -u "KiB per second" -d 1g limit B K M G T P' \ '--outbuf=[set output buffering]:buffering:(none line block)' \ '--port=[specify alternate port number]:port:(873)' \ '--address=[bind to the specified address]:bind address:_bind_addresses' \ @@ -181,7 +181,7 @@ _rsync() { {--no-W,--no-whole-file}'[turn off --whole-file]' \ '(--cc --checksum-choice)'{--cc,--checksum-choice}'=[choose the checksum algorithms]:algorithm:_sequence -n 2 compadd - auto md4 md5 none' \ '(-x --one-file-system)'{-x,--one-file-system}"[don't cross filesystem boundaries]" \ - '(-B --block-size)'{-B+,--block-size=}'[force a fixed checksum block-size]:block size (bytes)' \ + '(-B --block-size)'{-B+,--block-size=}'[force a fixed checksum block-size]: :_numbers -f -u bytes -d 1g "block size" B K M G T P' \ '(-e --rsh)'{-e+,--rsh=}'[specify the remote shell to use]:remote-shell command:(rsh ssh)' \ '--rsync-path=[specify path to rsync on the remote machine]:remote command' \ '--ignore-existing[ignore files that already exist on receiving side]' \ @@ -199,10 +199,10 @@ _rsync() { '--force-change[affect user-/system-immutable files/dirs]' \ '--force-uchange[affect user-immutable files/dirs]' \ '--force-schange[affect system-immutable files/dirs]' \ - '--max-delete=[do not delete more than NUM files]:number' \ - '--max-size=[do not transfer any file larger than specified size]:number' \ + "--max-delete=[don't delete more than NUM files]: :_numbers -f -u bytes size B K M G T P" \ + "--max-size=[don't transfer any file larger than specified size]: :_numbers -f -u bytes size B K M G T P" \ '--min-size=[do not transfer any file smaller than specified size]:number' \ - '--max-alloc=[set limit to individual memory allocation]:size (bytes) [1g]' \ + '--max-alloc=[set limit to individual memory allocation]: :_numbers -f -u bytes -d 1g size B K M G T P' \ '(-P)--partial[keep partially transferred files]' \ '--no-partial[turn off --partial]' \ '--partial-dir=[put a partially transferred file into specified directory]:directory:_directories' \ diff --git a/Completion/Unix/Command/_stdbuf b/Completion/Unix/Command/_stdbuf index a18938ee1..4b7d98ba0 100644 --- a/Completion/Unix/Command/_stdbuf +++ b/Completion/Unix/Command/_stdbuf @@ -7,7 +7,9 @@ short=( -e -i -o ) long=( --error --input --output ) buf=( err in out ) -opt='[set initial buffering for std${buf[i]}]:mode or size:((0\:unbuffered L\:line\ buffered' +opt='[set initial buffering for std${buf[i]}]: : _alternative + "sizes\: \: _numbers -u bytes size k M G" + "modes\:mode\:((0\:unbuffered L\:line\ buffered' if _pick_variant gnu=GNU freebsd --version; then gnu=1 args=( @@ -17,7 +19,7 @@ if _pick_variant gnu=GNU freebsd --version; then else opt+=' B\:fully\ buffered' fi -opt+='))' +opt+='))"' for ((i=1;i<=3;i++)); do args+=( "(${long[i]})${short[i]}+${(e)opt}" ) diff --git a/Completion/Unix/Command/_tail b/Completion/Unix/Command/_tail index 6d6e9b2d5..e54a0b06e 100644 --- a/Completion/Unix/Command/_tail +++ b/Completion/Unix/Command/_tail @@ -53,20 +53,14 @@ _arguments -C -s -S $opts : $args '*:file:_files' && return case $state in (number) - local mlt sign digit - mlt='multipliers:multiplier:((b\:512 K\:1024 KB\:1000 M\:1024\^2' - mlt+=' MB\:1000\^2 G\:1024\^3 GB\:1000\^3 T\:1024\^4 TB\:1000\^4))' - sign='signs:sign:((+\:"start at the specified byte/line"' - sign+=' -\:"output the last specified bytes/lines (default)"))' - digit='digits:digit:(0 1 2 3 4 5 6 7 8 9)' - if compset -P '(-|+|)[0-9]##'; then - _alternative $mlt $digit && ret=0 - elif [[ -z $PREFIX ]]; then - _alternative $sign $digit && ret=0 - elif compset -P '(+|-)'; then - _alternative $digit && ret=0 - fi - ;; + local alts + [[ -z $PREFIX ]] && alts=( + 'sign:sign:((-\:"print all but the last specified bytes/lines" +\:"print the first specified bytes/lines (default)"))' + ) + compset -P '+' + alts+=( 'numbers: :_numbers -N $state_descr b\:512 K\:1024 KB\:1000 M\:1024\^2 MB\:1000\^2 G\:1024\^3 GB\:1000\^3 T\:1024\^4 TB\:1000\^4' ) + _alternative $alts && ret=0 + ;; esac return ret diff --git a/Completion/Unix/Command/_timeout b/Completion/Unix/Command/_timeout index 2235fa5ec..c041283ac 100644 --- a/Completion/Unix/Command/_timeout +++ b/Completion/Unix/Command/_timeout @@ -16,5 +16,5 @@ _arguments -S -A "-" $args \ "--foreground[don't propagate timeout to the command children]" \ '(-s --signal)'{-s,--signal}'[specify the signal to send on timeout]:signal:_signals' \ '(-k --kill-after)'{-k,--kill-after}'[followup first signal with SIGKILL if command persists after specified time]:time' \ - '1: :_guard "[0-9.]#([smhd]|)" duration' \ + '1: :_numbers -f -u seconds duration :s:seconds m:minutes h:hours d:days' \ '*:::command:_normal' diff --git a/Completion/Unix/Command/_zfs b/Completion/Unix/Command/_zfs index 452e1160d..51da9170b 100644 --- a/Completion/Unix/Command/_zfs +++ b/Completion/Unix/Command/_zfs @@ -162,12 +162,20 @@ _zfs() { "multilevel:value:(on off)" "nbmand:value:(on off)" "primarycache:value:(all none metadata)" - "quota:number or 'none':{if [[ -prefix [0-9]## ]]; then _message -e 'number'; elif [[ $PREFIX == quota= ]]; then _wanted none expl 'number or none' compadd none; else _wanted none expl 'quota' compadd none; fi}" + "quota: : _alternative \ + 'sizes: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' \ + 'properties:property:(none)'" "readonly:value:(on off)" "recordsize:value:(512 1K 2K 4K 8K 16K 32K 64K 128K 256K 512K 1M)" - "refquota:number or 'none':{if [[ -prefix [0-9]## ]]; then _message -e 'number'; elif [[ $PREFIX == refquota= ]]; then _wanted none expl 'number or none' compadd none; else _wanted none expl 'refquota' compadd none; fi}" - "refreservation:number or 'none':{if [[ -prefix [0-9]## ]]; then _message -e 'number'; elif [[ $PREFIX == refreservation= ]]; then _wanted none expl 'number or none' compadd none; else _wanted none expl 'refreservation' compadd none; fi}" - "reservation:value:{if [[ -prefix [0-9]## ]]; then _message -e 'number'; elif [[ $PREFIX == reservation= ]]; then _wanted none expl 'number or none' compadd none; else _wanted none expl 'reservation' compadd none; fi}" + "refquota: : _alternative \ + 'sizes: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' \ + 'properties:property:(none)'" + "refreservation: : _alternative \ + 'sizes: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' \ + 'properties:property:(auto none)'" + "reservation: : _alternative \ + 'sizes: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' \ + 'properties:property:(none)'" "rstchown:value:(on off)" "secondarycache:value:(all none metadata)" "setuid:value:(on off)" @@ -238,8 +246,8 @@ _zfs() { ':filesystem:_zfs_dataset -t fs -e "parent dataset"' \ - set2 \ '-s[Create sparse volume]' \ - '-b[Set volblocksize]:blocksize:' \ - '-V[Set size]:size:' \ + '-b+[set volblocksize]: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes blocksize :B {k,M,G,T,P,E,Z}{,B}' \ + '-V+[set size]: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' \ ':volume:_zfs_dataset -t fs -e "parent dataset"' ;; diff --git a/Completion/X/Command/_xset b/Completion/X/Command/_xset index b35a6466b..adda47f01 100644 --- a/Completion/X/Command/_xset +++ b/Completion/X/Command/_xset @@ -91,8 +91,8 @@ _regex_arguments _xset_parse \ \( "/(blank|noblank|expose|noexpose|default|on|activate|reset)$nul/" \ ':option-s:screen saver:(blank noblank expose noexpose default on activate reset off)' \ \| "/off$nul/" \( "/off$nul/" ':option-s-off-period:period off:(off)' \| \) \ - \| "/[0-9]##$nul/" ':option-s-timeout:length:' \ - \( "/[0-9]##$nul/" ':option-s-period:period:' \ + \| "/[0-9]##$nul/" ':option-s-timeout: :_numbers -u seconds length' \ + \( "/[0-9]##$nul/" ':option-s-period: :_numbers -u seconds period' \ \| \) \ \| \) \ \| "/-r$nul/" "$guard" \ diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 8c6bf9c40..40238c4b9 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -4496,8 +4496,22 @@ not contain an explanation string to be displayed above the matches. If tt(_description) is called with more than three arguments, the additional var(spec)s should be of the form `var(char)tt(:)var(str)'. These supply escape sequence replacements for the tt(format) style: -every appearance of `tt(%)var(char)' will be -replaced by var(string). +every appearance of `tt(%)var(char)' will be replaced by var(string). +If no additional var(spec)s are given but the description in var(descr) +conforms to a common form then further escape sequences are set for +elements of that description. These elements correspond to a default +value (`tt(%o)'), the units (`tt(%m)') range of acceptable values +(`tt(%r)') and the remaining initial part of the description (`tt(%h)'). +The form the description takes consists of specifying the units and +range in parentheses and the default value in square brackets, for +example: + +example(_description times expl 'timeout (seconds) (0-60) [20]') + +It is possible to use tt(zformat) conditional expressions when styling +these elements. So, for example, to add `tt(default:)' as a tag but only +when there is a default value to show, the tt(format) style might +include `tt(%(o.default: %o.))'. If the tt(-x) option is given, the description will be passed to tt(compadd) using the tt(-x) option instead of the default tt(-X). This @@ -4773,6 +4787,69 @@ checked. If it is set completion is terminated at that point even if no matches have been found. This is the same effect as in the tt(-first-) context. ) +findex(_numbers) +item(tt(_numbers) [ var(option) ... ] [ var(description) ] [ var(suffix) ... ])( +This can be used where a number is followed by a suffix to indicate the units. +The unit suffixes are completed and can also be included in the description +used when completion is invoked for the preceding number. + +In addition to common tt(compadd) options, tt(_numbers) accepts the following +options: + +startitem() +item(tt(-t) var(tag))( +Specify a tag to use instead of the default of tt(numbers). +) +item(tt(-u) var(units))( +Indicate the default units for the number, e.g. tt(bytes). +) +item(tt(-l) var(min))( +Specify the lowest possible value for the number. +) +item(tt(-m) var(max))( +Specify the highest possible value for the number. +) +item(tt(-d) var(default))( +Specify the default value. +) +item(tt(-N))( +Allow negative numbers. This is implied if the range includes a negative. +) +item(tt(-f))( +Allow decimal numbers. +) +enditem() + +Where a particular suffix represents the default units for a number, it +should be prefixed with a colon. Additionally, suffixes can be followed +by a colon and a description. So for example, the following allows the +age of something to be specified, either in seconds or with an optional +suffix with a longer unit of time: + +example(_numbers -u seconds age :s:seconds m:minutes h:hours d:days) + +It is typically helpful for units to be presented in order of magnitude +when completed. To facilitate this, the order in which they are given +is preserved. + +When the tt(format) style is looked up with the tt(descriptions) tag or +the tag specified with tt(-t), the list of suffixes is available as a +`tt(%x)' escape sequence. This is in addition to the usual sequences +documented under the tt(format) style. The form this list takes can also +be configured. To this end, the tt(format) style is first looked up with +the tag tt(unit-suffixes). The retrieved format is applied to each +suffix in turn and the results are then concatenated to form the +completed list. For the tt(unit-suffixes) format, `tt(%x)' expands to +the individual suffix and `tt(%X)' to its description. tt(%d)' indicates +a default suffix and can be used in a condition. The index and reverse +index are set in `tt(%i)' and `tt(%r)' respectively and are useful for +text included only with the first and last suffixes in the list. So for +example, the following joins the suffixes together as a comma-separated +list: + +example(zstyle ':completion:*:unit-suffixes' format '%x%(r::,)') +) + findex(_options) item(tt(_options))( This can be used to complete the names of shell options. It provides a -- cgit v1.2.3 From 676aaf23c33bf21d492ed9354592d12f1225126e Mon Sep 17 00:00:00 2001 From: Daniel Shahaf <d.s@daniel.shahaf.name> Date: Sun, 26 Sep 2021 08:45:06 +0000 Subject: 49449: _zstat: Don't offer -o after -s, since -s is ignored when both -s and -o are specified. --- ChangeLog | 3 +++ Completion/Unix/Command/_stat | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 9cfc61dd7..d093ffb83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-11-26 Daniel Shahaf <d.s@daniel.shahaf.name> + * 49449: Completion/Unix/Command/_stat: _zstat: Don't offer -o + after -s, since -s is ignored when both -s and -o are specified. + * 47599 (tweaked): New test for '{foo,bar}' in command position 2021-11-24 Oliver Kiddle <opk@zsh.org> diff --git a/Completion/Unix/Command/_stat b/Completion/Unix/Command/_stat index 03b4552de..03abe88a3 100644 --- a/Completion/Unix/Command/_stat +++ b/Completion/Unix/Command/_stat @@ -29,7 +29,7 @@ case $variant in '(-n)-N[never show names of files]' '-o[print file modes in octal rather than decimal]' '-r[print raw data]' - '-s[print mode, UID, GID, and times as strings]' + '(-o)-s[print mode, UID, GID, and times as strings]' '(-T)-t[always show type names]' '(-t)-T[never show type names]' '*: :_files' -- cgit v1.2.3 From 5fe498124d6469fadded7b9ad9eb64649b93f2de Mon Sep 17 00:00:00 2001 From: Paul Seyfert <Paul.Seyfert@sevensense.ch> Date: Fri, 26 Nov 2021 12:29:38 +0100 Subject: github #83: _git-push, _git-send-pack: Make --push-option repeatable. --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 493eabda7..843ca23d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-11-26 Paul Seyfert <Paul.Seyfert@sevensense.ch> + + * github #83: Completion/Unix/Command/_git: _git-push, + _git-send-pack: Make --push-option repeatable. + 2021-11-26 Daniel Shahaf <d.s@daniel.shahaf.name> * 49448: Doc/Zsh/contrib.yo, Doc/Zsh/zle.yo: docs: Fix pointers diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index c757376b0..70940336d 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1465,7 +1465,7 @@ _git-push () { '(--no-signed --sign)--signed[GPG sign the push]' \ "(--sign --signed)--no-signed[don't GPG sign the push]" \ '--atomic[request atomic transaction on remote side]' \ - '(-o --push-option)'{-o+,--push-option=}'[transmit string to server to pass to pre/post-receive hooks]:string' \ + '*'{-o+,--push-option=}'[transmit string to server to pass to pre/post-receive hooks]:string' \ '(-4 --ipv4 -6 --ipv6)'{-4,--ipv4}'[use IPv4 addresses only]' \ '(-4 --ipv4 -6 --ipv6)'{-6,--ipv6}'[use IPv6 addresses only]' \ ': :__git_any_repositories' \ @@ -5664,7 +5664,7 @@ _git-send-pack () { "(--no-signed --signed)--sign=-[GPG sign the push]::signing enabled:(($^^sign))" \ '(--no-signed --sign)--signed[GPG sign the push]' \ "(--sign --signed)--no-signed[don't GPG sign the push]" \ - '--push-option=[specify option to transmit]:option' \ + '*--push-option=[specify option to transmit]:option' \ '--progress[force progress reporting]' \ '--thin[send a thin pack]' \ '--atomic[request atomic transaction on remote side]' \ -- cgit v1.2.3 From 9fc0e319c976c4fe72ba113493a25dde26f68f75 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Thu, 2 Dec 2021 20:57:49 +0100 Subject: 49631: new logger completion --- ChangeLog | 2 ++ Completion/Unix/Command/_logger | 80 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 Completion/Unix/Command/_logger (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index c67911681..f18fe4e94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2021-12-02 Oliver Kiddle <opk@zsh.org> + * 49631: Completion/Unix/Command/_logger: new logger completion + * 49629: Completion/Linux/Command/_perf: new Linux perf completion 2021-12-01 Daniel Shahaf <d.s@daniel.shahaf.name> diff --git a/Completion/Unix/Command/_logger b/Completion/Unix/Command/_logger new file mode 100644 index 000000000..0d47d2f03 --- /dev/null +++ b/Completion/Unix/Command/_logger @@ -0,0 +1,80 @@ +#compdef logger + +local variant ign +local -a args common +local -a priorities + +_pick_variant -r variant linux=util-linux busybox=BusyBox $OSTYPE -V + +priorities=( {kern,user,mail,daemon,auth,syslog,lpr,news,uucp,cron,authpriv,ftp,ntp,security,console,local{0..7}}.{emerg,panic,alert,crit,err,error,warn,warning,notice,info,debug} ) +args=( "(--id)-i[log the logger command's pid]" ) +common=( + '(-f --file --journald *)'{-f+,--file=}'[log contents of specified file]:file:_files' + '(-s --stderr)'{-s,--stderr}'[output message to standard error as well]' + '(-P --port)'{-P+,--port}'[use specified port for UDP or TCP connection]:port [514]:_ports' + '(-p --priority)'{-p+,--priority}'[mark message with specified priority]:priority:_multi_parts . priorities' + '(-t --tag)'{-t+,--tag}"[specify tag to mark log line with]:tag [$USER]" +) + +case $variant in + (net|open)bsd*) + args+=( ${(M)common:#*\)-[fpst]*} + '-c[write the message to the console if unable to use syslogd(8)]' + ) + ;| + dragonfly*|freebsd*) + args+=( + '(-6)-4[use IPv4 addresses only]' + '(-4)-6[use IPv6 addresses only]' + '-A[send the message to all addresses]' + ) + ;| + darwin*|dragonfly*) args+=( ${(M)common:#*\)-[sfpt]*} ) ;| + freebsd*) + args+=( ${common:#*\)--*} + "-H+[set value for hostname in message header]:hostname [${HOST%%.*}]" + '-h+[write to specified remote syslog server or socket]: : _alternative + "hosts\:server\:_hosts" + "sockets\:socket\:_files -g \*\(=\)"' + '-S+[specify source address and port when using -h]: :_bind_addresses -0bh' + ) + ;; + dragonfly*) + args+=( '-h+[write to specified remote syslog server]:server:_hosts' ) + ;; + busybox) args=( ${(M)common:#*\)-[spt]*} ) ;; # no -i + solaris*) args+=( ${(M)common:#*\)-[fpt]*} ) ;; + netbsd*) + args+=( + '-d+[log this in the structured data (SD) field]:sd field' + '-m+[specify message ID used for the message]:message id' + '-n[open log file immediately]' + ) + ;; + linux) + (( $#words > 2 )) && ign='!' + args+=( $common + "(-i)--id=-[log the given id, or otherwise the pid]::id [$$]:_pids" + '(* -e --skip-empty)'{-e,--skip-empty}"[don't log empty lines when processing files]" + '--no-act[do everything except the write the log]' + '--octet-count[use rfc6587 octet counting]' + '(*)--prio-prefix[look for a prefix on every line read from stdin]' + '(-S --size)'{-S+,--size=}'[specify maximum size for a single message]:size [1KiB]' + '(-n --server)'{-n+,--server=}'[write to specified remote syslog server]:server:_hosts' + '(-T --tcp -d --udp)'{-T,--tcp}'[use TCP only]' + '(-d --udp -T --tcp)'{-d,--udp}'[use UDP only]' + '(--rfc5424 --msgid --sd-id --sd-param)--rfc3164[use the obsolete BSD syslog protocol]' + '(--rfc3164)--rfc5424=-[use the syslog protocol (default for remote)]::without:_sequence compadd - notime notq nohost' + '(--rfc3164)*--sd-id=[specify rfc5424 structured data ID]:id' + '(--rfc3164)*--sd-param=[specify rfc5424 structured data name=value]:data' + '(--rfc3164)--msgid=[set rfc5424 message id field]:message id' + '(-u --socket)'{-u,--socket=}'[write to specified Unix socket]:socket:compadd -f -M "r\:|_=* r\:|=*" ${${(M)${(f)"$(</proc/net/unix)"}\:#* /*}##* }' + '--socket-errors=-[print connection errors when using Unix sockets]::state:(on off auto)' + '(* -f --file)--journald=-[write journald entry]::file:_files' + "${ign}(- *)"{-h,--help}'[display usage information]' + "${ign}(- *)"{-V,--version}'[display version information]' + ) + ;; +esac + +_arguments -s -S -A "-*" $args '*: :_guard "^-*" message' -- cgit v1.2.3 From e2ad321c884534d654dc69aa04f70c65a157cf03 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Tue, 7 Dec 2021 07:35:59 +0100 Subject: 49633: update options for git 2.34 --- ChangeLog | 4 + Completion/Unix/Command/_git | 362 ++++++++++++++++++++++++++++--------------- 2 files changed, 242 insertions(+), 124 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 140a3f07c..bb24842f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2021-12-07 Oliver Kiddle <opk@zsh.org> + + * 49633: Completion/Unix/Command/_git: update options for git 2.34 + 2021-12-02 Oliver Kiddle <opk@zsh.org> * 49630: Completion/bashcompinit: allow zsh to quote matches but diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 70940336d..04b5677ce 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -68,7 +68,10 @@ _git-add () { '--refresh[do not add files, but refresh their stat() info in index]' \ '--ignore-errors[continue adding if an error occurs]' \ $ignore_missing \ - '--chmod[override the executable bit of the listed files]:override:(-x +x)' \ + '--sparse[allow updating entries outside of sparse-checkout cone]' \ + '--chmod=[override the executable bit of the listed files]:override:(-x +x)' \ + '(*)--pathspec-from-file=[read pathspec from file]:file:_files' \ + '(*)--pathspec-file-nul[pathspec elements are separated with NUL character]' \ '*:: :->file' && return case $state in @@ -97,11 +100,8 @@ _git-am () { # NOTE: --rebasing and --resolvemsg are only for internal use between git # rebase and git am. - # TODO: --patch-format is undocumented. - # TODO: --rerere-autoupdate and --no-rerere-autoupdate are - # undocumented (and not implemented here). _arguments -s -S $endopt \ - '(-s --signoff)'{-s,--signoff}'[add Signed-off-by: line to the commit message]' \ + '(-s --signoff)'{-s,--signoff}'[add Signed-off-by: trailer to the commit message]' \ '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=-}'[GPG-sign the commit]::key id' \ "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit]" \ '(-k --keep)'{-k,--keep}'[pass -k to git mailinfo]' \ @@ -111,13 +111,14 @@ _git-am () { '(--keep-cr )--no-keep-cr[do not pass --keep-cr to git mailsplit]' \ '(-c --scissors --no-scissors)'{-c,--scissors}'[strip everything before a scissors line]' \ '(-c --scissors --no-scissors)--no-scissors[ignore scissors lines]' \ + '--quoted-cr=[specify action when quoted CR is found]:action [warn]:(nowarn warn strip)' \ '(-q --quiet)'{-q,--quiet}'[only print error messages]' \ '(-u --utf8 --no-utf8)'{-u,--utf8}'[pass -u to git mailinfo]' \ '(-u --utf8 --no-utf8)--no-utf8[pass -n to git mailinfo]' \ '(-3 --3way)'{-3,--3way}'[use 3-way merge if patch does not apply cleanly]' \ $apply_options \ '--quit[abort the patching operation but keep HEAD where it is]' \ - '--show-current-patch[show the patch being applied]' \ + '--show-current-patch=-[show the message being applied]::show [raw]:(diff raw)' \ '(-i --interactive)'{-i,--interactive}'[apply patches interactively]' \ '--committer-date-is-author-date[use author date as committer date]' \ '--ignore-date[use committer date as author date]' \ @@ -160,6 +161,7 @@ _git-archive () { '(- :)'{-l,--list}'[list available archive formats]' \ '(-v --verbose)'{-v,--verbose}'[report progress to stderr]' \ '--prefix=-[prepend the given path prefix to each filename]:path prefix:_directories -r ""' \ + '--add-file=[add untracked file to archive]:file:_files' \ '(-o --output)'{-o+,--output=}'[write archive to specified file]:archive:_files' \ '--worktree-attributes[look for attributes in .gitattributes in working directory too]' \ $backend_args \ @@ -179,8 +181,6 @@ _git-archive () { (( $+functions[_git-bisect] )) || _git-bisect () { - # TODO: next subcommand is undocumented. Git-bisect.sh mentions that the - # subcommand might be removed from the UI level. local curcontext=$curcontext state line ret=1 declare -A opt_args local good bad @@ -226,6 +226,7 @@ _git-bisect () { --term-{good,old}'=[specify alternate term for good revisions]:term' \ --term-{bad,new}'=[specify alternate term for bad revisions]:term' \ '--no-checkout[set BISECT_HEAD reference instead of doing checkout at each iteration]' \ + '--first-parent[follow only the first parent commit upon seeing a merge commit]' \ ':bad revision:__git_commits' \ '*: :->revision-or-path' && ret=0 case $state in @@ -323,7 +324,7 @@ _git-branch () { "($c $m -a)"{-r,--remotes}'[list or delete only remote-tracking branches]' \ "($c $m $d : -r --remotes)-a[list both remote-tracking branches and local branches]" \ "($c $m $d : -v -vv --verbose)"{-v,-vv,--verbose}'[show SHA1 and commit subject line for each head]' \ - "($c $m $d :)--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length" \ + "($c $m $d :)--abbrev=[use specified digits to display object names]:digits" \ "($c $m $d :)--no-abbrev[don't abbreviate sha1s]" \ "(- :)--show-current[show current branch name]" \ "($l $m $d)--create-reflog[create the branch's reflog]" \ @@ -380,6 +381,11 @@ _git-bundle () { (create) if (( CURRENT == 2 )); then _arguments \ + '(-q --quiet)'{-q,--quiet}"[don't show progress]" \ + '--progress[show progress meter]' \ + '--all-progress[show progress meter during object writing phase]' \ + '--all-progress-implied[similar to --all-progress when progress meter is shown]' \ + '--version=[specify bundle format version]:version:(2 3)' \ ':bundle:_files' && ret=0 else local revision_options @@ -393,13 +399,20 @@ _git-bundle () { ;; (verify) _arguments \ + '(-q --quiet)'{-q,--quiet}"[don't show bundle details]" \ ':bundle:_files' && ret=0 ;; - (list-heads|unbundle) + (list-heads) _arguments \ ':bundle:_files' \ '*: :__git_references' && ret=0 - ;; + ;; + (unbundle) + _arguments \ + '--progress[show progress meter]' \ + ':bundle:_files' \ + '*: :__git_references' && ret=0 + ;; esac ;; esac @@ -466,6 +479,8 @@ _git-checkout () { '--no-overlay[remove files from index or working tree that are not in the tree-ish]' \ '(-q --quiet --progress)--no-progress[suppress progress reporting]' \ '--progress[force progress reporting]' \ + '(*)--pathspec-from-file=[read pathspec from file]:file:_files' \ + '(*)--pathspec-file-nul[pathspec elements are separated with NUL character]' \ '(-)--[start file arguments]' \ '*:: :->branch-or-tree-ish-or-file' && ret=0 @@ -527,11 +542,11 @@ _git-cherry-pick () { '(-m --mainline)'{-m+,--mainline=}'[specify mainline when cherry-picking a merge commit]:parent number' \ '--rerere-autoupdate[update index with reused conflict resolution if possible]' \ '(-n --no-commit --ff)'{-n,--no-commit}'[do not make the actual commit]' \ - '(-s --signoff --ff)'{-s,--signoff}'[add Signed-off-by line at the end of the commit message]' \ + '(-s --signoff --ff)'{-s,--signoff}'[add Signed-off-by trailer at the end of the commit message]' \ '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=-}'[GPG-sign the commit]::key id' \ "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit]" \ '*'{-s+,--strategy=}'[use given merge strategy]:merge strategy:__git_merge_strategies' \ - '*'{-X+,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]:option' \ + '*'{-X+,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]: :_git_strategy_options' \ '(-e --edit -x -n --no-commit -s --signoff)--ff[fast forward, if possible]' \ '*: : __git_commit_ranges -O expl:git_commit_opts' } @@ -548,7 +563,7 @@ _git-clean () { _arguments -C -S -s $endopt \ '-d[also remove untracked directories]' \ - '(-f --force)'{-f,--force}'[required when clean.requireForce is true (default)]' \ + \*{-f,--force}'[required by default; twice, removes untracked nested repositories]' \ '(-i --interactive)'{-i,--interactive}'[show what would be done and clean files interactively]' \ '(-n --dry-run)'{-n,--dry-run}'[only show what would and what would not be removed]' \ '(-q --quiet)'{-q,--quiet}"[don't print names of files removed]" \ @@ -618,6 +633,7 @@ _git-clone () { '(-q --quiet)'{-q,--quiet}'[operate quietly]' \ '(-v --verbose)'{-v,--verbose}'[always display the progressbar]' \ '--progress[output progress even if stderr is not a terminal]' \ + "--reject-shallow[don't clone shallow repository]" \ '(-n --no-checkout)'{-n,--no-checkout}'[do not checkout HEAD after clone is complete]' \ '(-o --origin)--bare[make a bare GIT repository]' \ '(--bare)--mirror[clone refs into refs/* instead of refs/remotes/origin/*]' \ @@ -634,7 +650,7 @@ _git-clone () { "--no-tags[don't clone any tags and make later fetches not follow them]" \ '--shallow-submodules[any cloned submodules will be shallow]' \ '--recursive[initialize all contained submodules]' \ - '--recurse-submodules=-[initialize submodules in the clone]::file:__git_files' \ + '(--recursive --recurse-submodules)'{--recursive,--recurse-submodules}'=-[initialize submodules in the clone]::file:__git_files' \ '--separate-git-dir[place .git dir outside worktree]:path to .git dir:_path_files -/' \ \*--server-option='[send specified string to the server when using protocol version 2]:option' \ '(-4 --ipv4 -6 --ipv6)'{-4,--ipv4}'[use IPv4 addresses only]' \ @@ -685,7 +701,7 @@ _git-commit () { # TODO: --interactive isn't explicitly listed in the documentation. _arguments -S -s $endopt \ '(-a --all --interactive -o --only -i --include *)'{-a,--all}'[stage all modified and deleted paths]' \ - '--fixup=[construct a commit message for use with rebase --autosquash]:commit to be amended:__git_recent_commits' \ + '--fixup=[construct a commit message for use with rebase --autosquash]:commit to be amended:_git_fixup' \ '--squash=[construct a commit message for use with rebase --autosquash]:commit to be amended:__git_recent_commits' \ $reset_author_opt \ '( --porcelain --dry-run)--short[dry run with short output format]' \ @@ -697,7 +713,8 @@ _git-commit () { {-p,--patch}'[use the interactive patch selection interface to chose which changes to commit]' \ '(--reset-author)--author[override the author name used in the commit]:author name' \ '--date=[override the author date used in the commit]:date' \ - '(-s --signoff)'{-s,--signoff}'[add Signed-off-by line at the end of the commit message]' \ + '*--trailer=[add custom trailer(s)]:trailer' \ + '(-s --signoff)'{-s,--signoff}'[add Signed-off-by trailer at the end of the commit message]' \ '(-n --no-verify)'{-n,--no-verify}'[bypass pre-commit and commit-msg hooks]' \ '--allow-empty[allow recording an empty commit]' \ '--allow-empty-message[allow recording a commit with an empty message]' \ @@ -710,6 +727,8 @@ _git-commit () { '(-u --untracked-files)'{-u-,--untracked-files=-}'[show files in untracked directories]::mode:((no\:"show no untracked files" normal\:"show untracked files and directories" all\:"show individual files in untracked directories"))' \ + '(*)--pathspec-from-file=[read pathspec from file]:file:_files' \ + '(*)--pathspec-file-nul[pathspec elements are separated with NUL character]' \ '(-q --quiet -v --verbose)'{-v,--verbose}'[show unified diff of all file changes]' \ '(-q --quiet -v --verbose)'{-q,--quiet}'[suppress commit summary message]' \ '--dry-run[only show list of paths that are to be committed or not, and any untracked]' \ @@ -724,7 +743,7 @@ _git-commit () { {-C+,--reuse-message=}'[use existing commit object with same log message]: :__git_commits' \ {-c+,--reedit-message=}'[use existing commit object and edit log message]: :__git_commits' \ {-F+,--file=}'[read commit message from given file]: :_files' \ - {-m+,--message=}'[use the given message as the commit message]:message' \ + \*{-m+,--message=}'[use the given message as the commit message]:message' \ {-t+,--template=}'[use file as a template commit message]:template:_files' } @@ -736,7 +755,7 @@ _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]' \ - '--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length' \ + '--abbrev=[use specified digits to display object names]:digits' \ '( --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]' \ @@ -870,16 +889,17 @@ _git-fetch () { _arguments -C -S -s $endopt \ $fetch_options \ - '--shallow-since=[deepen history of shallow repository based on time]:time' \ - '*--shallow-exclude=[deepen history of shallow clone by excluding revision]:revision' \ - '--deepen[deepen history of shallow clone]:number of commits' \ - '(-n --no-tags -t --tags)'{-n,--no-tags}'[disable automatic tag following]' \ + '--atomic[use atomic transaction to update references]' \ '(--all -m --multiple)'{-m,--multiple}'[fetch from multiple remotes]' \ + '(-n --no-tags -t --tags)'{-n,--no-tags}'[disable automatic tag following]' \ + '--prefetch[modify the refspec to place all refs within refs/prefetch/]' \ '(-P --prune-tags)'{-P,--prune-tags}'[prune local tags no longer on remote and clobber changed tags]' \ - \*{-o+,--server-option=}'[send specified string to the server when using protocol version 2]:option' \ - '--negotiation-tip=[only report refs reachable from specified object to the server]:commit:__git_commits' \ + '--write-fetch-head[write fetched references to the FETCH_HEAD file]' \ + "--negotiate-only[don't fetch a packfile; instead, print ancestors of negotiation tips]" \ '--filter=[object filtering]:filter:_git_rev-list_filters' \ - "--auto-gc[run 'gc --auto' after fetching]" \ + '(--auto-maintenance --auto-gc)'--auto-{maintenance,gc}"[run 'maintenance --auto' after fetching]" \ + '--write-commit-graph[write the commit-graph after fetching]' \ + '--stdin[accept refspecs from stdin]' \ '*:: :->repository-or-group-or-refspec' && ret=0 case $state in @@ -919,7 +939,7 @@ _git-format-patch () { '--start-number=[start numbering patches at given number]: :__git_guard_number "patch number"' \ '--numbered-files[use only number for file name]' \ '(-n --numbered -N --no-numbered -k --keep-subject --rfc --subject-prefix)'{-k,--keep-subject}"[don't strip/add \[PATCH\] from the first line of the commit message]" \ - '(-s --signoff)'{-s,--signoff}'[add Signed-off-by: line to the commit message]' \ + '(-s --signoff)'{-s,--signoff}'[add Signed-off-by: trailer to the commit message]' \ '(-o --output-directory)--stdout[output the generated mbox on standard output (implies --mbox)]' \ '( --no-attach --inline)--attach=-[create attachments instead of inlining patches]::boundary' \ '(--attach --inline)--no-attach[disable creation of attachments]' \ @@ -930,7 +950,9 @@ _git-format-patch () { '--in-reply-to=[make the first mail a reply to the given message]:message id' \ '--ignore-if-in-upstream[do not include a patch that matches a commit in the given range]' \ '(-v --reroll-count)'{-v+,--reroll-count=}'[mark the series as the <n>-th iteration of the topic]: :__git_guard_number iteration' \ + '--filename-max-length=[specify max length of output filename]:length' \ '(-k --keep-subject --subject-prefix)--rfc[use \[RFC PATCH\] instead of \[PATCH\]]' \ + "--cover-from-description=[generate parts of a cover letter based on a branch's description]:mode:(message default subject auto none)" \ '(-k --keep-subject --rfc)--subject-prefix=[use the given prefix instead of \[PATCH\]]:prefix' \ '*--to=[add To: header to email headers]: :_email_addresses' \ '*--cc=[add Cc: header to email headers]: :_email_addresses' \ @@ -1148,6 +1170,8 @@ _git-init () { '--template=[directory to use as a template for the object database]: :_directories' \ '--shared=[share repository amongst several users]:: :__git_repository_permissions' \ '--separate-git-dir=[create git dir elsewhere and link it using the gitdir mechanism]:: :_directories' \ + '(-b --initial-branch)'{-b+,--initial-branch=}'[override the name of the initial branch]:branch name' \ + '--object-format=[specify the hash algorithm to use]:algortithm:(sha1 sha256)' \ ':: :_directories' } @@ -1249,6 +1273,9 @@ _git-maintenance() { "--quiet[don't report progress or other information to stderr]" \ '*--task=[run a specific task]:task:(gc commit-graph prefetch loose-objects incremental-repack pack-refs)' && ret=0 ;; + (start) + _arguments \ + '--scheduler=:scheduler:(auto crontab systemd-timer launchctl schtasks)' esac ;; esac @@ -1287,6 +1314,7 @@ _git-mv () { '(-f --force)'{-f,--force}'[rename/move even if targets exist]' \ '-k[skip rename/move that would lead to errors]' \ '(-n --dry-run)'{-n,--dry-run}'[only show what would happen]' \ + '--sparse[allow updating entries outside of sparse-checkout cone]' \ ':source:__git_cached_files' \ '*:: :->source-or-destination' && ret=0 @@ -1350,7 +1378,6 @@ _git-notes () { ': :__git_commits' && ret=0 ;; (copy) - # TODO: --for-rewrite is undocumented. _arguments -S -s $endopt \ '(-f --force)'{-f,--force}'[replace existing note]' \ '(:)--stdin[read objects from stdin]' \ @@ -1415,7 +1442,6 @@ _git-pull () { interactive\:"allow list of commits to be edited" ))' \ '(-r --rebase )--no-rebase[do not perform a rebase after fetching]' \ - '--autostash[automatically stash/stash pop before and after rebase]' \ $fetch_options \ '(--no-tags -t --tags)--no-tags[disable automatic tag following]' \ ': :__git_any_repositories' \ @@ -1447,6 +1473,7 @@ _git-push () { '(--receive-pack --exec)'{--receive-pack=-,--exec=-}'[path to git-receive-pack on remote]:remote git-receive-pack:_files' \ '(--force-with-lease --no-force-with-lease)*--force-with-lease=-[allow refs that are not ancestors to be updated if current ref matches expected value]::ref and expectation:->lease' \ '(--force-with-lease --no-force-with-lease)--no-force-with-lease[cancel all previous force-with-lease specifications]' \ + '--force-if-includes[require remote updates to be integrated locally]' \ '(-f --force)'{-f,--force}'[allow refs that are not ancestors to be updated]' \ '(:)--repo=[default repository to use]:repository:__git_any_repositories' \ '(-u --set-upstream)'{-u,--set-upstream}'[add upstream reference for each branch that is up to date or pushed]' \ @@ -1493,6 +1520,9 @@ _git-range-diff () { _arguments -s -S $endopt \ '--creation-factor=[specify weighting for creation]:weighting (percent)' \ '--no-dual-color[use simple diff colors]' \ + '(--no-notes)*--notes=[show notes that annotate commit, with optional ref argument show this notes ref instead of the default notes ref(s)]:: :__git_notes_refs' \ + '(--right-only)--left-only[only emit output related to the first range]' \ + '(--left-only)--right-only[only emit output related to the second range]' \ $diff_options \ '1:range 1:__git_commit_ranges' \ '2:range 2:__git_commit_ranges' \ @@ -1518,38 +1548,38 @@ _git-rebase () { '(-)--quit[abort but keep HEAD where it is]' \ '(-)--show-current-patch[show the patch file being applied or merged]' \ - options \ - '(-m --merge)'{-m,--merge}'[use merging strategies to rebase]' \ + '(--onto --root)--keep-base[use the merge-base of upstream and branch as the current base]' \ '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=-}'[GPG-sign the commit]::key id' \ "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit]" \ - '*'{-s+,--strategy=}'[use given merge strategy]:merge strategy:__git_merge_strategies' \ - '*'{-X+,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]:option' \ '(-q --quiet -v --verbose --stat -n --no-stat)'{-q,--quiet}'[suppress all output]' \ '(-q --quiet -v --verbose --stat -n --no-stat)'{-v,--verbose}'[output additional information]' \ '(-n --no-stat)'{-n,--no-stat}"[don't show diffstat of what changed upstream]" \ '--rerere-autoupdate[update the index with reused conflict resolution if possible]' \ '--no-verify[bypass the pre-rebase hook]' \ - '-C-[ensure that given lines of surrounding context match]: :__git_guard_number "lines of context"' \ + '(--apply -m --merge -s --strategy -X --strategy-option --auto-squash --no-auto-squash -r --rebase-merges -i --interactive -x --exec --empty --reapply-cherry-picks --edit-todo --reschedule-failed-exec)-C-[ensure that given lines of surrounding context match]: :__git_guard_number "lines of context"' \ '(-f --force-rebase)'{-f,--force-rebase}'[force rebase even if current branch descends from commit rebasing onto]' \ - '(-i --interactive)--ignore-whitespace[ignore whitespace in context]' \ - '(-i --interactive)--whitespace=-[detect a new or modified line that has whitespace errors]: :__git_apply_whitespace_strategies' \ + '(-i --interactive)--ignore-whitespace[ignore changes in whitespace]' \ + '(--apply -m --merge -s --strategy -X --strategy-option --auto-squash --no-auto-squash -r --rebase-merges -i --interactive -x --exec --empty --reapply-cherry-picks --edit-todo --reschedule-failed-exec)--whitespace=-[detect a new or modified line that has whitespace errors]: :__git_apply_whitespace_strategies' \ '(-i --interactive)--committer-date-is-author-date[use author date as committer date]' \ - '(-i --interactive --ignore-whitespace --whitespace --committer-date-is-author-date)'{-i,--interactive}'[make a list of commits to be rebased and open in $EDITOR]' \ - '(-r --rebase-merges)'{-r-,--rebase-merges=-}'[try to rebase merges instead of skipping them]::option:(rebase-cousins no-rebase-cousins)' \ - '!(-p --preserve-merges --interactive)'{-p,--preserve-merges} \ - {-x+,--exec=}'[with -i\: append "exec <cmd>" after each line]:command:_command_names -e' \ - '(-k --keep-empty)'{-k,--keep-empty}'[keep empty commits in the result]' \ - '--allow-empty-message[allow rebasing commits with empty messages]' \ - '(1)--root[rebase all reachable commits]' \ + '(-f --force-rebase)'{--ignore-date,--reset-author-date}'[ignore author date and use current date]' \ + '(-m --merge -s --strategy -X --strategy-option --auto-squash --no-auto-squash -r --rebase-merges -i --interactive -x --exec --empty --reapply-cherry-picks --edit-todo --reschedule-failed-exec)--apply[use apply strategies to rebase]' \ + '(-m --merge --apply --whitespace -C)'{-m,--merge}'[use merging strategies to rebase]' \ + '(-i --interactive --ignore-whitespace --apply --whitespace -C --committer-date-is-author-date)'{-i,--interactive}'[make a list of commits to be rebased and open in $EDITOR]' \ + '(--apply --whitespace -C)--empty=[specify how to handle commits that become empty]:handling:(drop keep ask)' \ + '(--apply --whitespace -C)'{-x+,--exec=}'[with -i\: append "exec <cmd>" after each line]:command:_command_names -e' \ + '(-r --rebase-merges --apply --whitespace -C)'{-r-,--rebase-merges=-}'[try to rebase merges instead of skipping them]::option:(rebase-cousins no-rebase-cousins)' \ + '(--apply --whitespace -C)*'{-s+,--strategy=}'[use given merge strategy]:merge strategy:__git_merge_strategies' \ + '(--apply --whitespace -C)*'{-X+,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]: :_git_strategy_options' \ + '(1 --keep-base --fork-point)--root[rebase all reachable commits]' \ $autosquash_opts \ '(--autostash --no-autostash)--autostash[stash uncommitted changes before rebasing and apply them afterwards]' \ "(--autostash --no-autostash)--no-autostash[don't stash uncommitted changes before rebasing and apply them afterwards]" \ - '--fork-point[use merge-base --fork-point to refine upstream]' \ - '--ignore-date[use current timestamp for author date]' \ - '--signoff[add Signed-off-by: line to the commit message]' \ + '(--root)--fork-point[use merge-base --fork-point to refine upstream]' \ + '--signoff[add Signed-off-by: trailer to the commit message]' \ '--no-ff[cherry-pick all rebased commits with --interactive, otherwise synonymous to --force-rebase]' \ '(--keep-base)--onto=[start new branch with HEAD equal to given revision]:newbase:__git_revisions' \ - '(--onto)--keep-base[use the merge-base of upstream and branch as the current base]' \ - "--reschedule-failed-exec[automatically re-schedule any 'exec' that fails]" \ + "(--apply --whitespace -C)--reschedule-failed-exec[automatically re-schedule any 'exec' that fails]" \ + '(--apply --whitespace -C)--reapply-cherry-picks[apply all changes, even those already present upstream]' \ ':upstream branch:__git_revisions' \ '::working branch:__git_revisions' } @@ -1569,6 +1599,8 @@ _git-reset () { '--recurse-submodules=-[control recursive updating of submodules]::reset:__git_commits' \ '(-p --patch)'{-p,--patch}'[select diff hunks to remove from the index]' \ '(-q --quiet)'{-q,--quiet}'[suppress all output]' \ + '(*)--pathspec-from-file=[read pathspec from file]:file:_files' \ + '(*)--pathspec-file-nul[pathspec elements are separated with NUL character]' \ '(--soft --mixed --hard --merge --keep):: :__git_commits' \ '(--soft --mixed --hard --merge --keep)*:: :->file' && ret=0 @@ -1611,6 +1643,8 @@ _git-restore() { '(-2 --ours -3 --theirs -m --merge)'{-3,--theirs}'[checkout their version for unmerged files]' \ '(-p --patch)'{-p,--patch}'[select hunks interactively]' \ "--ignore-skip-worktree-bits[don't limit pathspecs to sparse entries only]" \ + '(*)--pathspec-from-file=[read pathspec from file]:file:_files' \ + '(*)--pathspec-file-nul[pathspec elements are separated with NUL character]' \ '*:path spec:->pathspecs' && ret=0 case $state in @@ -1653,7 +1687,7 @@ _git-revert () { '(-n --no-commit)'{-n,--no-commit}'[do not commit the reversion]' \ '(-s --signoff)'{-s,--signoff}'[add Signed-off-by line at the end of the commit message]' \ '--strategy=[use given merge strategy]:merge strategy:__git_merge_strategies' \ - '*'{-X,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]:option' \ + '*'{-X+,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]: :_git_strategy_options' \ '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=-}'[GPG-sign the commit]::key id' \ "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit]" \ ': :__git_recent_commits' @@ -1670,6 +1704,9 @@ _git-rm () { '-r[allow recursive removal when a leading directory-name is given]' \ '--cached[only remove files from the index]' \ '--ignore-unmatch[exit with 0 status even if no files matched]' \ + '--sparse[allow updating entries outside of sparse-checkout cone]' \ + '(*)--pathspec-from-file=[read pathspec from file]:file:_files' \ + '(*)--pathspec-file-nul[pathspec elements are separated with NUL character]' \ '(-q --quiet)'{-q,--quiet}"[don't list removed files]" \ '*:: :->file' && ret=0 @@ -1698,6 +1735,8 @@ _git-shortlog () { '(-s --summary)'{-s,--summary}'[suppress commit description]' \ '(-e --email)'{-e,--email}'[show email address of each author]' \ '-w-[linewrap the output]:: :->wrap' \ + '*--group=[group commits by field]: : _values -S\: field author committer trailer\:trailer' \ + '(-c --committer)'{-c,--committer}'[alias for --group=committer]' \ $revision_options \ '(-)--[start file arguments]' \ '*:: :->commit-range-or-file' && ret=0 @@ -1830,11 +1869,13 @@ _git-stash () { '(-q --quiet)'{-q,--quiet}'[suppress all output]' '(-p --patch -a --all -u --include-untracked)'{-u,--include-untracked}'[include untracked files]' '(-p --patch -a --all -u --include-untracked)'{-a,--all}'[include ignored files]' + '(* -p --patch)--pathspec-from-file=[read pathspec from file]:file:_files' + '(* -p --patch)--pathspec-file-nul[pathspec elements are separated with NUL character]' ) _arguments -C \ '*::: :->args' \ - '(-m --message)'{-m,--message}'[specify stash description]' \ + '(-m --message)'{-m+,--message=}'[specify stash description]:description' \ ${save_arguments//#\(/(* } && ret=0 if [[ -n $state ]]; then @@ -1867,8 +1908,8 @@ _git-stash () { (push) _arguments -S $endopt \ $save_arguments \ - '(-m --message)'{-m,--message}'[specify stash description]' \ - ':: :__git_modified_files' && ret=0 + '(-m --message)'{-m+,--message=}'[specify stash description]:description' \ + '*: : __git_ignore_line __git_modified_files' && ret=0 ;; (--) __git_modified_files @@ -1971,7 +2012,8 @@ _git-submodule () { init:'initialize a submodule' deinit:'unregister a submodule' update:'update a submodule' - set-branch:'set the default remote tracking branch for the submodule' + set-branch:'set default remote tracking branch for the submodule' + set-url:'set URL of the specified submodule' summary:'show commit summary between given commit and working tree/index' foreach:'evaluate shell command in each checked-out submodule' absorbgitdirs:'move the git directory of a submodule into its superprojects' @@ -2027,6 +2069,7 @@ _git-submodule () { '--remote[use the status of the submodule''s remote-tracking branch]' \ '--force[discard local changes by checking out the current up-to-date version]' \ '--init[initialize uninitialized submodules]' \ + '--single-branch[clone only one branch]' \ '*: :__git_ignore_line_inside_arguments __git_submodules' && ret=0 ;; (set-branch) @@ -2035,6 +2078,11 @@ _git-submodule () { '(-b --branch)'{-b,--branch=}'[specify the remote branch]:remote branch' \ '1:path:_directories' ;; + (set-url) + _arguments -C -A '-*' \ + '1:path:_directories' \ + '2:url:_urls' && ret=0 + ;; (summary) _arguments -C -A '-*' \ '(-q --quiet)'{-q,--quiet}'[suppress all output]' \ @@ -2385,17 +2433,20 @@ _git-config () { '(--global --system --local -f --file --blob)--worktree[use per-worktree config file]' \ '(--global --system --local --worktree --blob)'{-f+,--file=}'[use given config file]:config file:_files' \ '(--global --system --local --worktree -f --file)--blob=[read config from given blob object]:blob:__git_blobs' \ - '(-t --type --bool --int --bool-or-int --path --expiry-date)'{-t+,--type=}'[ensure that incoming and outgoing values are canonicalize-able as the given type]:type:(bool int bool-or-int path expiry-date color)' \ - '(-t --type --int --bool-or-int --path --expiry-date)--bool[setting is a boolean]' \ - '(-t --type --bool --bool-or-int --path --expiry-date)--int[setting is an integer]' \ - '(-t --type --bool --int --path --expiry-date)--bool-or-int[setting is an integer]' \ - '(-t --type --bool --int --bool-or-int --expiry-date)--path[setting is a path]' \ - '(-t --type --bool --int --bool-or-int --path)--expiry-date[setting is an expiry date]' \ + '(-t --type --bool --int --bool-or-int --bool-or-str --path --expiry-date)'{-t+,--type=}'[ensure that incoming and outgoing values are canonicalize-able as the given type]:type:(bool int bool-or-int bool-or-str path expiry-date color)' \ + '(-t --type --int --bool-or-int --bool-or-str --path --expiry-date)--bool[setting is a boolean]' \ + '(-t --type --bool --bool-or-int --bool-or-str --path --expiry-date)--int[setting is an integer]' \ + '(-t --type --bool --int --bool-or-str --path --expiry-date)--bool-or-int[setting is a boolean or integer]' \ + '(-t --type --bool --int --bool-or-int --path --expiry-date)--bool-or-str[setting is a boolean or string]' \ + '(-t --type --bool --int --bool-or-int --bool-or-str --expiry-date)--path[setting is a path]' \ + '(-t --type --bool --int --bool-or-int --bool-or-str --path)--expiry-date[setting is an expiry date]' \ '(-z --null)'{-z,--null}'[end values with NUL and newline between key and value]' \ + '--fixed-value[use string equality when comparing values]' \ '(--get --get-all --get-urlmatch --replace-all --add --unset --unset-all --rename-section --remove-section -e --edit --get-color --get-colorbool)--name-only[show variable names only]' \ '(--includes)'--no-includes"[don't respect \"include.*\" directives]" \ '(--no-includes)'--includes'[respect "include.*" directives in config files when looking up values]' \ - '(--global --system --local -f --file --blob --get-urlmatch --replace-all --add --unset --unset-all --rename-section --remove-section -e --edit --get-color --get-colorbool)--show-origin[show origin of config]' \ + '(--global --system --local -f --file --blob --get-urlmatch --replace-all --add --unset --unset-all --rename-section --remove-section -e --edit --get-color --get-colorbool --show-scope)--show-origin[show origin of config]' \ + '(--global --system --local -f --file --blob --get-urlmatch --replace-all --add --unset --unset-all --rename-section --remove-section -e --edit --get-color --get-colorbool --show-origin)--show-scope[show scope of config (worktree, local, global, system, command)]' \ '(2 --add -e --edit -l --list --name-only --rename-section --remove-section --replace-all --unset --unset-all)--default=[with --get, use specified default value when entry is missing]:default' \ $name_arg \ $value_arg \ @@ -2407,14 +2458,14 @@ _git-config () { '(--name-only --show-origin)--get-urlmatch[get value specific for the URL]' \ '(-z --null --name-only --show-origin)--replace-all[replace all values of the given key]' \ '(3 -z --null --name-only --show-origin)--add[add new value without altering any existing ones]' \ - '(2 --bool --int --bool-or-int --path -z --null --name-only --show-origin)--unset[remove the first matching value of the key]' \ - '(2 --bool --int --bool-or-int --path -z --null --name-only --show-origin)--unset-all[remove all matching values of the key]' \ - '(3 --bool --int --bool-or-int --path -z --null --name-only --show-origin)--rename-section[rename the given section]' \ - '(3 --bool --int --bool-or-int --path -z --null --name-only --show-origin)--remove-section[remove the given section]' \ - '(: --bool --int --bool-or-int --path)'{-l,--list}'[list all variables set in config file]' \ - '(-e --edit --bool --int --bool-or-int --path -z --null --name-only --show-origin)'{-e,--edit}'[open config file for editing]' \ - '(2 3 --bool --int --bool-or-int --path -z --null --name-only --show-origin)--get-color[find color setting]: :->gettable-color-option' \ - '(2 3 --bool --int --bool-or-int --path -z --null --name-only --show-origin)--get-colorbool[check if color should be used]: :->gettable-colorbool-option' && ret=0 + '(2 --bool --int --bool-or-int --bool-or-str --path -z --null --name-only --show-origin)--unset[remove the first matching value of the key]' \ + '(2 --bool --int --bool-or-int --bool-or-str --path -z --null --name-only --show-origin)--unset-all[remove all matching values of the key]' \ + '(3 --bool --int --bool-or-int --bool-or-str --path -z --null --name-only --show-origin)--rename-section[rename the given section]' \ + '(3 --bool --int --bool-or-int --bool-or-str --path -z --null --name-only --show-origin)--remove-section[remove the given section]' \ + '(: --bool --int --bool-or-int --bool-or-str --path)'{-l,--list}'[list all variables set in config file]' \ + '(-e --edit --bool --int --bool-or-int --bool-or-str --path -z --null --name-only --show-origin)'{-e,--edit}'[open config file for editing]' \ + '(2 3 --bool --int --bool-or-int --bool-or-str --path -z --null --name-only --show-origin)--get-color[find color setting]: :->gettable-color-option' \ + '(2 3 --bool --int --bool-or-int --bool-or-str --path -z --null --name-only --show-origin)--get-colorbool[check if color should be used]: :->gettable-colorbool-option' && ret=0 __git_config_option-or-value "$@" && ret=0 return ret } @@ -3700,11 +3751,12 @@ _git-fast-export () { '--import-marks-if-exists=[load marks from file if it exists]: :_files' \ '--fake-missing-tagger=[fake a tagger when tags lack them]' \ '--use-done-feature[start with a "feature done" stanza, and terminate with a "done" command]' \ - '--no-data[do not output blocb objects, instead referring to them via their SHA-1 hash]' \ + "--no-data[skip output of blob objects, instead referring to them via their SHA-1 hash]" \ '--full-tree[output full tree for each commit]' \ '(--get --get-all)--name-only[show variable names only]' \ '*--refspec=[apply refspec to exported refs]:refspec' \ '--anonymize[anonymize output]' \ + '*--anonymize-map[apply conversion in anonymized output]:from\:to' \ '--reference-excluded-parents[reference parents not in fast-export stream by object id]' \ '--show-original-ids[show original object ids of blobs/commits]' \ '--mark-tags[label tags with mark ids]' \ @@ -3831,10 +3883,9 @@ _git-reflog () { case $line[1] in (expire) - # TODO: -n, --dry-run is undocumented. _arguments -S \ - '(-n --dry-run)'{-n,--dry-run}'[undocumented]' \ - '--stale-fix[TODO\: provide a decent description for this option]' \ + '(-n --dry-run)'{-n,--dry-run}"[don't actually prune any entries; show what would be pruned]" \ + '--stale-fix[prune any reflog entries that point to "broken commits"]' \ '--expire=-[prune entries older than given time]: :__git_datetimes' \ '--expire-unreachable=-[prune entries older than given time and unreachable]: :__git_datetimes' \ '--all[prune all refs]' \ @@ -3843,9 +3894,8 @@ _git-reflog () { '--verbose[output additional information]' && ret=0 ;; (delete) - # TODO: -n, --dry-run is undocumented. _arguments -C -S \ - '(-n --dry-run)'{-n,--dry-run}'[undocumented]' \ + '(-n --dry-run)'{-n,--dry-run}"[dpn't update entries; show what would be done]" \ '--updateref[update ref with SHA-1 of top reflog entry after expiring or deleting]' \ '--rewrite[adjust reflog entries to ensure old SHA-1 points to new SHA-1 of previous entry after expiring or deleting]' \ '--verbose[output additional information]' \ @@ -3980,7 +4030,6 @@ _git-remote () { (( $+functions[_git-repack] )) || _git-repack () { - # TODO: --quiet is undocumented. _arguments -s \ '(-A --unpack-unreachable)-a[pack all objects into a single pack]' \ '(-a -k --keep-unreachable)-A[pack all objects into a single pack, but unreachable objects become loose]' \ @@ -4001,7 +4050,9 @@ _git-repack () { '--threads=[limit maximum number of threads]:threads' \ '--max-pack-size=-[maximum size of each output packfile]: : __git_guard_bytes "maximum pack size"' \ '--pack-kept-objects[repack objects in packs marked with .keep]' \ - '--keep-pack=[ignore named pack]:pack' + '--keep-pack=[ignore named pack]:pack' \ + '(-g --geometric)'{-g+,--geometric=}'[find a geometric progression with specified factor]:factor' \ + '(-m --write-midx)'{-m,--write-midx}'[write a multi-pack index of the resulting packs]' } (( $+functions[_git-replace] )) || @@ -4063,7 +4114,6 @@ _git-blame () { '--ignore-revs-file=[ignore revisions from file]:file:_files' \ '(--color-by-age)--color-lines[color redundant metadata from previous line differently]' \ '(--color-lines)--color-by-age[color lines by age]' \ - '--indent-heuristic[use indent-based heuristic to improve diffs]' \ $revision_options \ ':: :__git_revisions' \ ': :__git_cached_files' && ret=0 @@ -4095,10 +4145,9 @@ _git-bugreport() { (( $+functions[_git-cherry] )) || _git-cherry () { - # TODO: --abbrev is undocumented. _arguments -S $endopt \ '(-v --verbose)'{-v,--verbose}'[output additional information]' \ - '--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length' \ + '--abbrev=[use specified digits to display object names]:digits' \ ':upstream commit:__git_commits' \ '::head commit:__git_commits' \ '::limit commit:__git_commits' @@ -4210,7 +4259,6 @@ _git-rerere () { local curcontext=$curcontext state line ret=1 declare -A opt_args - # TODO: --rerere-autoupdate is undocumented. _arguments -C -S -s $endopt \ '--rerere-autoupdate[register clean resolutions in index]' \ ': :->command' && ret=0 @@ -4499,7 +4547,8 @@ _git-send-email () { '--8bit-encoding=[encoding to use for non-ASCII messages]: :__git_encodings' \ '--compose-encoding=[encoding to use for compose messages]: :__git_encodings' \ '--transfer-encoding=[specify transfer encoding to use]:transfer encoding:(quoted-printable 8bit base64)' \ - '--envelope-sender[specify the envelope sender used to send the emails]: :_email_addresses' \ + '--envelope-sender=[specify the envelope sender used to send the emails]: :_email_addresses' \ + '--sendmail-cmd=[specify command to run to send email]:command:_cmdstring' \ '--smtp-encryption=[specify encryption method to use]: :__git_sendemail_smtpencryption_values' \ '--smtp-domain=[specify FQDN used in HELO/EHLO]: :_domains' \ '--smtp-pass=[specify password to use for SMTP-AUTH]::password' \ @@ -4588,7 +4637,6 @@ _git-svn () { case $line[1] in (clone|dcommit|fetch|init|migrate|rebase|set-tree) - # TODO: --ignore-refs is undocumented. # TODO: --no-auth-cache is undocumented. # TODO: --config-dir is undocumented. opts+=( @@ -4791,8 +4839,9 @@ _git-svn () { ;; (rebase) opts+=( - '(-l --local)'{-l,--local}"[don't fetch remotely, rebase against the last fetched commit from SVN]" - '(--preserve-merges -p)'{--preserve-merges,-p}'[try to recreate merges instead of ignoring them]' + '(-l --local)'{-l,--local}"[don't fetch remotely, rebase against the last fetched commit from SVN]" + '!--preserve-merges' + '(--rebase-merges -p)'{--rebase-merges,-p}'[try to recreate merges instead of ignoring them]' ) ;; (reset) @@ -4891,13 +4940,15 @@ _git-commit-graph() { if [[ $words[2] = write ]]; then args=( $progress '(--split --size-multiple --max-commits --expire-time)--append[include all commits present in existing commit-graph file]' - '(--append)--split[write the commit-graph as a chain of multiple commit-graph files]' + '--changed-paths[enable computation for changed paths]' + '(--append)--split=-[write the commit-graph as a chain of multiple commit-graph files]::strategy:(no-merge replace)' '(--stdin-packs --stdin-commits)--reachable[walk commits starting at all refs]' '(--reachable --stdin-commits)--stdin-packs[only walk objects in pack-indexes read from input]' '(--reachable --stdin-packs)--stdin-commits[walk commits starting at commits read from input]' '(--append)--size-multiple=:commits [2]' '(--append)--max-commits=:commits' '(--append)--expire-time=:date/time:__git_datetimes' + '--max-new-filters=[specify maximum number of changed-path bloom filters to compute]:' ) elif [[ $words[2] = verify ]]; then args=( $progress @@ -4907,7 +4958,7 @@ _git-commit-graph() { _arguments -S $endopt $args \ '--object-dir=[specify location of packfiles and commit-graph file]:directory:_directories' \ - '(-h)1:verb:(read verify write)' + '(-h)1:verb:(verify write)' } (( $+functions[_git-commit-tree] )) || @@ -4953,6 +5004,8 @@ _git-index-pack () { _arguments \ '-v[display progress on stderr]' \ '-o[write generated pack index into specified file]: :_files' \ + '(--no-rev-index)--rev-index[generate a reverse index corresponding to the given pack]' \ + "(--rev-index)--no-rev-index[don't generate a reverse index corresponding to the given pack]" \ '--stdin[read pack from stdin and instead write to specified file]' \ $stdin_opts \ '--strict[die if the pack contains broken objects or links]' \ @@ -4973,8 +5026,6 @@ _git-merge-file () { label_opt="*-L[label to use for the $ordinals[n_labels+1] file]:label" fi - # TODO: --marker-size in undocumented. - # TODO: --diff3 is undocumented. _arguments \ $label_opt \ '(-p --stdout)'{-p,--stdout}'[send merged file to standard output instead of overwriting first file]' \ @@ -5023,6 +5074,9 @@ _git-mktree () { _git-multi-pack-index() { _arguments \ '--object-dir=[specify location of git objects]:directory:_directories' \ + '(--progress)--no-progress[turn progress off]' '!(--no-progress)--progress' \ + '--stdin-packs[write a multi-pack index containing only pack index basenames provided on stdin]' \ + '--refs-snapshot=[specify a file which contains a "refs snapshot" taken prior to repacking]:file:_files' \ '--batch-size=[during repack, select packs so as to have pack files of at least the specified size]:size' \ '1:verb:(write verify expire repack)' } @@ -5052,16 +5106,17 @@ _git-pack-objects () { '--delta-base-offset[use delta-base-offset packing]' \ '--threads=-[specify number of threads for searching for best delta matches]: :__git_guard_number "number of threads"' \ '--non-empty[only create a package if it contains at least one object]' \ - '--revs[read revision arguments from standard input]' \ + '(--stdin-packs)--revs[read revision arguments from standard input]' \ '(--revs)--unpacked[limit objects to pack to those not already packed]' \ - '(--revs)--all[include all refs as well as revisions already specified]' \ + '(--revs --stdin-packs)--all[include all refs as well as revisions already specified]' \ '--reflog[include objects referred by reflog entries]' \ '--indexed-objects[include objects referred to by the index]' \ + '(--revs --all --keep-unreachable --pack-loose-unreachable --unpack-unreachable)--stdin-packs[read packs from stdin]' \ '(: --max-pack-size)--stdout[output pack to stdout]' \ '--include-tag[include unasked-for annotated tags if object they reference is included]' \ - '(--unpack-unreachable)--keep-unreachable[keep unreachable ]' \ - '--pack-loose-unreachable[pack loose unreachable objects]' \ - '(--keep-unreachable)--unpack-unreachable=-[unpack unreachable objects newer than specified time]::time' \ + '(--revs --stdin-packs --unpack-unreachable)--keep-unreachable[add objects unreachable from refs in packs named with --unpacked to resulting pack]' \ + '(--revs --stdin-packs)--pack-loose-unreachable[pack unreachable loose objects]' \ + '(--revs --stdin-packs --keep-unreachable)--unpack-unreachable=-[keep unreachable objects in loose form]::time' \ '--sparse[use sparse reachability algorithm]' \ '--include-tag[include tag objects that refer to objects to be packed]' \ $thin_opt \ @@ -5076,6 +5131,7 @@ _git-pack-objects () { '--missing=[specify how missing objects are handled]:action:(error allow-any allow-promisor print)' \ "--exclude-promisor-objects[don't pack objects in promisor packfiles]" \ '--delta-islands[respect islands during delta compression]' \ + '--uri-protocol=[exclude any configured uploadpack.blobpackfileuri with given protocol]:protocol' \ ':base-name:_files' } @@ -5176,6 +5232,7 @@ _git-update-index () { '(-q --unmerged --ignore-missing --refresh)--really-refresh[refresh index, unconditionally checking stat information]' \ '( --no-skip-worktree)--skip-worktree[set "skip-worktree" bit for given paths]' \ '(--skip-worktree )--no-skip-worktree[unset "skip-worktree" bit for given paths]' \ + "--ignore-skip-worktree-entries[don't touch index-only entries]" \ '(-)'{-g,--again}'[run git-update-index on differing index entries]' \ '(-)--unresolve[restore "unmerged" or "needs updating" state of files]' \ '--info-only[only insert files object-IDs into index]' \ @@ -5372,7 +5429,6 @@ _git-ls-files () { no_empty_directory_opt="--no-empty-directory[don't list empty directories]" fi - # TODO: --resolve-undo is undocumented. # TODO: Replace _files with something more intelligent based on seen options. # TODO: Apply excludes like we do for git-clean. _arguments -S -s $endopt \ @@ -5386,8 +5442,9 @@ _git-ls-files () { '--eol[show line endings of files]' \ $no_empty_directory_opt \ '(-s --stage -u --unmerged --with-tree)'{-u,--unmerged}'[show unmerged files in output]' \ + '--resolve-undo[show resolve-undo information]' \ '(-k --killed)'{-k,--killed}'[show killed files in output]' \ - '-z[use NUL termination on output]' \ + '-z[separate paths with the NUL character]' \ '*'{-x,--exclude=-}'[skip files matching given pattern]:file pattern' \ '*'{-X,--exclude-from=-}'[skip files matching patterns in given file]: :_files' \ '*--exclude-per-directory=-[skip directories matching patterns in given file]: :_files' \ @@ -5398,8 +5455,9 @@ _git-ls-files () { '(-v)-f[indicate status of each file using lowercase for fsmonitor clean files]' \ '--full-name[force paths to be output relative to the project top directory]' \ '--recurse-submodules[recurse through submodules]' \ - '--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length' \ + '--abbrev=[use specified digits to display object names]:digits' \ '--debug[show debugging data]' \ + '--deduplicate[suppress duplicate entries]' \ '*:: :_files' } @@ -5430,10 +5488,10 @@ _git-ls-tree () { '(-t)-d[do not show children of given tree (implies -t)]' \ '-r[recurse into subdirectories]' \ '-t[show tree entries even when going to recurse them]' \ - '(-l --long)'{-l,--long}'[show object size of blob entries]' \ + '(-l --long --name-only --name-status)'{-l,--long}'[show object size of blob entries]' \ '-z[use NUL termination on output]' \ - '(--name-only --name-status)'{--name-only,--name-status}'[list only filenames, one per line]' \ - '--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length' \ + '(--name-only --name-status --abbrev)'{--name-only,--name-status}'[list only filenames, one per line]' \ + '(--name-only --name-status)--abbrev=[use specified digits to display object names]:digits' \ '--full-name[output full path-names]' \ '(--full-name)--full-tree[do not limit listing to current working-directory]' \ ': :__git_tree_ishs' \ @@ -5536,8 +5594,9 @@ _git_rev-list_filters() { } (( $+functions[_git-show-index] )) || -_git-show-index () { - _message 'no arguments allowed; accepts index file on standard input' +_git-show-index() { + _arguments \ + '--object-format=[specify the hash algorithm to use]:algortithm:(sha1 sha256)' } (( $+functions[_git-show-ref] )) || @@ -5550,7 +5609,7 @@ _git-show-ref () { '(-d --dereference)'{-d,--dereference}'[dereference tags into object IDs as well]' \ '(-s --hash)'{-s+,--hash=-}'[only show the SHA-1 hash, not the reference name]:: :__git_guard_number length' \ '--verify[enable stricter reference checking]' \ - '--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length' \ + '--abbrev=[use specified digits to display object names]:digits' \ '(-q --quiet)'{-q,--quiet}'[do not print any results]' \ '*: :_guard "([^-]?#|)" pattern' \ - exclude \ @@ -5579,6 +5638,7 @@ _git-verify-pack () { _arguments -S -s $endopt \ '(-v --verbose)'{-v,--verbose}'[show objects contained in pack]' \ '(-s --stat-only)'{-s,--stat-only}'[do not verify pack contents; only display histogram of delta chain length]' \ + '--object-format=[specify the hash algorithm to use]:algortithm:(sha1 sha256)' \ '*:index file:_files -g "*.idx(-.)"' } @@ -5657,7 +5717,7 @@ _git-send-pack () { '(-q --quiet)'{-q,--quiet}'[be more quiet]' \ '(--receive-pack --exec)'{--receive-pack=-,--exec=-}'[specify path to git-receive-pack on remote side]:remote path' \ '--remote[specify remote name]:remote' \ - '--all[update all refs that exist locally]' \ + '(*)--all[update all refs that exist locally]' \ '(-n --dry-run)'{-n,--dry-run}'[do everything except actually sending the updates]' \ '--mirror[mirror all refs]' \ '(-f --force)'{-f,--force}'[update remote orphaned refs]' \ @@ -5672,6 +5732,7 @@ _git-send-pack () { '--stdin[read refs from stdin]' \ '--helper-status[print status from remote helper]' \ '--force-with-lease=[require old value of ref to be at specified value]:refname\:expect' \ + '--force-if-includes[require remote updates to be integrated locally]' \ ': :__git_any_repositories' \ '*: :__git_remote_references' } @@ -5691,8 +5752,10 @@ _git-http-fetch () { '-v[report what is downloaded]' \ '-w[write commit-id into the filename under "$GIT_DIR/refs/<filename>"]:filename' \ '--recover[recover from a failed fetch]' \ - '(1)--stdin[read commit ids and refs from standard input]' \ - ': :__git_commits' \ + '(1 --packfile)--stdin[read commit ids and refs from standard input]' \ + '!(1 --stdin)--packfile=:hash' \ + '!--index-pack-args=:args' \ + '1: :__git_commits' \ ': :_urls' } @@ -5713,12 +5776,9 @@ _git-http-push () { (( $+functions[_git-receive-pack] )) || _git-receive-pack () { - # TODO: --advertise-refs is undocumented. - # TODO: --stateless-rpc is undocumented. _arguments -S -A '-*' $endopt \ '(-q --quiet)'{-q,--quiet}'[be quiet]' \ - '--advertise-refs[undocumented]' \ - '--stateless-rpc[undocumented]' \ + '--stateless-rpc[quit after a single request/response exchange]' \ ':directory to sync into:_directories' } @@ -5863,8 +5923,10 @@ _git-mailinfo () { '(-u --encoding)--encoding=-[encode commit information in given encoding]: :__git_encodings' \ '-n[disable all charset re-coding of metadata]' \ '(-m --message-id)'{-m,--message-id}'[copy the Message-ID header at the end of the commit message]' \ + '-n[disable charset re-coding of metadata]' \ '( --no-scissors)--scissors[remove everything in body before a scissors line]' \ '(--scissors )--no-scissors[do not remove everything in body before a scissors line]' \ + '--quoted-cr=[specify action when quoted CR is found]:action [warn]:(nowarn warn strip)' \ '--no-inbody-headers[undocumented]' \ ':message file:_files' \ ':patch file:_files' @@ -6366,6 +6428,16 @@ __git_merge_strategies () { "git merge -s '' 2>&1")"}:#[Aa]vailable (custom )#strategies are: *}#[Aa]vailable (custom )#strategies are: }%.}:-octopus ours recursive resolve subtree} } +(( $+functions[_git_strategy_options] )) || +_git_strategy_options() { + _values "strategy option" ours theirs ignore-space-change \ + ignore-all-space ignore-space-at-eol ignore-cr-at-eol \ + renormalize no-renormalize \ + 'find-renames::similarity threshold' \ + subtree:path \ + 'diff-algorithm:algorithm:(patience minimal histogram myers)' +} + (( $+functions[__git_encodings] )) || __git_encodings () { # TODO: Use better algorithm, as shown in iconv completer (separate it to a @@ -6518,6 +6590,31 @@ __git_daemon_service () { _describe -t services service services $* } +(( $+functions[_git_log_line_ranges] )) || +_git_log_line_ranges() { + local sep pos=start op=( / : ) + if compset -P '*[^,^]:'; then + __git_tree_files ${PREFIX:-.} HEAD + else + compset -P 1 '*,' && pos=end + if compset -P '(^|):'; then + _message -e functions function + elif compset -P '(^|)/'; then + _message -e patterns regex + else + zstyle -s ":completion:${curcontext}:forms" list-separator sep || sep=-- + sep=' -- ' + sep="${(q)sep}" + _guard "[0-9]#" "$pos line number" && return + compset -P \^ || op+=( \^ ) + _wanted forms expl form compadd -S '' -d "( + /\ $sep\ regex + :\ $sep\ function + ^\ $sep\ search\ from\ start\ of\ file )" $op + fi + fi +} + (( $+functions[__git_log_decorate_formats] )) || __git_log_decorate_formats () { declare -a log_decorate_formats @@ -7004,6 +7101,16 @@ __git_recent_commits () { return ret } +(( $+functions[_git_fixup] )) || +_git_fixup() { + local alts + alts=( 'commits: :__git_recent_commits' ) + if ! compset -P '(amend|reword):'; then + alts+=( 'actions:action:compadd -S: amend reword' ) + fi + _alternative $alts +} + (( $+functions[__git_blob_objects] )) || __git_blob_objects () { _guard '[[:xdigit:]](#c,40)' 'blob object name' @@ -7539,7 +7646,7 @@ __git_setup_log_options () { '( --no-follow)--follow[follow renames]' '(--follow )--no-follow[do not follow renames]' '--source[show which ref each commit is reached from]' - '-L+[trace the evolution of a line range or regex within a file]:range' + '*-L+[trace evolution of line range, function or regex within a file]: :_git_log_line_ranges' ) } @@ -7622,7 +7729,7 @@ __git_setup_diff_options () { '--full-index[show full object name of pre- and post-image blob]' '(--full-index)--binary[in addition to --full-index, output binary diffs for git-apply]' '--ws-error-highlight=[specify where to highlight whitespace errors]: :__git_ws_error_highlight' - '--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length' + '--abbrev=[use specified digits to display object names]:digits' '(-B --break-rewrites)'{-B-,--break-rewrites=-}'[break complete rewrite changes into pairs of given size]:: :__git_guard_number size' '(-M --find-renames)'{-M-,--find-renames=-}'[detect renames with given scope]:: :__git_guard_number size' '(-C --find-copies)'{-C-,--find-copies=-}'[detect copies as well as renames with given scope]:: :__git_guard_number size' @@ -7634,10 +7741,12 @@ __git_setup_diff_options () { '--diff-filter=-[select certain kinds of files for diff]: :_git_diff_filters' '-S-[look for differences that add or remove the given string]:string' '-G-[look for differences whose added or removed line matches the given regex]:pattern' - '--find-object=[look for differences that change the number of occurrences of the specified object]:object:__git_blobs' '--pickaxe-all[when -S finds a change, show all changes in that changeset]' '--pickaxe-regex[treat argument of -S as regular expression]' '-O-[output patch in the order of glob-pattern lines in given file]: :_files' + '--rotate-to=[show the change in specified path first]:path:_directories' + '--skip-to=[skip the output to the specified path]:path:_directories' + '--find-object=[look for differences that change the number of occurrences of specified object]:object:__git_blobs' '-R[do a reverse diff]' '--relative=-[exclude changes outside and output relative to given directory]:: :_directories' '(-a --text)'{-a,--text}'[treat all files as text]' @@ -7645,7 +7754,8 @@ __git_setup_diff_options () { '--ignore-cr-at-eol[ignore carriage-return at end of line]' '(-b --ignore-space-change -w --ignore-all-space)'{-b,--ignore-space-change}'[ignore changes in amount of white space]' '(-b --ignore-space-change -w --ignore-all-space)'{-w,--ignore-all-space}'[ignore white space when comparing lines]' - '--ignore-blank-lines[do not show hunks that add or remove blank lines]' + '--ignore-blank-lines[ignore changes whose lines are all blank]' + \*{-I+,--ignore-matching-lines=}'[ignore changes whose lines all match regex]:regex' '--no-indent-heuristic[disable heuristic that shifts diff hunk boundaries to make patches easier to read]' '--inter-hunk-context=[combine hunks closer than N lines]:number of lines' '--output-indicator-new=[specify the character to indicate a new line]:character [+]' @@ -7661,11 +7771,8 @@ __git_setup_diff_options () { '(--no-prefix)--dst-prefix=[use given prefix for destination]:prefix' '--line-prefix=[prepend additional prefix to every line of output]:prefix' '(--src-prefix --dst-prefix)--no-prefix[do not show any source or destination prefix]' - '(-c --cc)'{-c,--cc}'[combined diff format for merge commits]' - - # TODO: --output is undocumented. - '--output[undocumented]:undocumented') + '--output=[output to a specific file]: :_files') } (( $+functions[__git_setup_diff_stage_options] )) || @@ -7856,7 +7963,7 @@ __git_setup_revision_options () { '(--left-only --right-only --cherry-pick --cherry-mark --no-merges --merges --max-parents)--cherry[synonym for --right-only --cherry-mark --no-merges]' '(-c --cc )--full-diff[show full commit diffs when using log -p, not only those affecting the given path]' '--log-size[print log message size in bytes before the message]' - '--use-mailmap[use mailmap file to map author and committer names and email]' + --{use-,}mailmap'[use mailmap file to map author and committer names and email]' '--reflog[show all commits from reflogs]' '--single-worktree[examine the current working tree only]' @@ -7886,13 +7993,14 @@ __git_setup_merge_options () { '(-n --no-stat)--stat[show a diffstat at the end of the merge]' '(--stat -n --no-stat)'{-n,--no-stat}'[do not show diffstat at the end of the merge]' '( --no-squash)--squash[merge, but do not commit]' - '--signoff[add Signed-off-by:]' + '--autostash[automatically stash/stash pop before and after]' + '--signoff[add Signed-off-by: trailer]' '(--squash )--no-squash[merge and commit]' '--ff-only[refuse to merge unless HEAD is up to date or merge can be resolved as a fast-forward]' '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=-}'[GPG-sign the commit]::key id' "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit]" - '*'{-s,--strategy=}'[use given merge strategy]:merge strategy:__git_merge_strategies' - '*'{-X,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]:option' + '*'{-s+,--strategy=}'[use given merge strategy]:merge strategy:__git_merge_strategies' + '*'{-X+,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]: :_git_strategy_options' '(--verify-signatures)--verify-signatures[verify the commits being merged or abort]' '(--no-verify-signatures)--no-verify-signatures[do not verify the commits being merged]' '(-q --quiet -v --verbose)'{-q,--quiet}'[suppress all output]' @@ -7932,6 +8040,11 @@ __git_setup_fetch_options () { '(-q --quiet)--progress[force progress reporting]' '--show-forced-updates[check for forced-updates on all updated branches]' '--set-upstream[set upstream for git pull/fetch]' + '--shallow-since=[deepen history of shallow repository based on time]:time' \ + '*--shallow-exclude=[deepen history of shallow clone by excluding revision]:revision' \ + '--deepen[deepen history of shallow clone]:number of commits' \ + \*{-o+,--server-option=}'[send specified string to the server when using protocol version 2]:option' + '--negotiation-tip=[only report refs reachable from specified object to the server]:commit:__git_commits' \ ) } @@ -8305,16 +8418,17 @@ _git() { '(- :)--version[display version information]' \ '(- :)--help[display help message]' \ '-C[run as if git was started in given path]: :_directories' \ - '*-c[pass configuration parameter to command]: :->configuration' \ + \*{-c,--config-env=}'[pass configuration parameter to command]: :->configuration' \ '--exec-path=-[path containing core git-programs]:: :_directories' \ '(: -)--man-path[print the manpath for the man pages for this version of Git and exit]' \ '(: -)--info-path[print the path where the info files are installed and exit]' \ '(: -)--html-path[display path to HTML documentation and exit]' \ '(-p --paginate -P --no-pager)'{-p,--paginate}'[pipe output into a pager]' \ '(-p --paginate -P --no-pager)'{-P,--no-pager}"[don't pipe git output into a pager]" \ - '--git-dir=-[path to repository]: :_directories' \ - '--work-tree=-[path to working tree]: :_directories' \ - '--namespace=-[set the Git namespace]:namespace' \ + '--git-dir=[path to repository]: :_directories' \ + '--work-tree=[path to working tree]: :_directories' \ + '--namespace=[set the Git namespace]:namespace' \ + '--super-prefix=[set a prefix which gives a path from above a repository down to its root]:path:_directories' \ '--bare[use $PWD as repository]' \ '--no-replace-objects[do not use replacement refs to replace git objects]' \ '--literal-pathspecs[treat pathspecs literally, rather than as glob patterns]' \ -- cgit v1.2.3 From 702d773e8657d1f8ea161d65d5dfce238a67c204 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Thu, 16 Dec 2021 14:19:48 +0100 Subject: 49648 based on github #80 (Vincent Bernat): invert before/since for date glob qualifiers completion --- ChangeLog | 6 ++++++ Completion/Unix/Command/_find | 4 ++-- Completion/Zsh/Type/_globquals | 8 +++----- 3 files changed, 11 insertions(+), 7 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 676a2584c..12809f662 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2021-12-16 Oliver Kiddle <opk@zsh.org> + + * 49648 based on github #80 (Vincent Bernat): + Completion/Unix/Command/_find, Completion/Zsh/Type/_globquals: + invert before/since for date glob qualifiers completion + 2021-12-14 Oliver Kiddle <opk@zsh.org> * 49518: Src/Zle/computil.c, Etc/BUGS, Test/Y03arguments.ztst: diff --git a/Completion/Unix/Command/_find b/Completion/Unix/Command/_find index 8ff60baf2..74111f92b 100644 --- a/Completion/Unix/Command/_find +++ b/Completion/Unix/Command/_find @@ -156,11 +156,11 @@ if [[ $state = times ]]; then if zstyle -t ":completion:${curcontext}:senses" verbose; then zstyle -s ":completion:${curcontext}:senses" list-separator sep || sep=-- default=" [default exactly]" - disp=( "- $sep before" "+ $sep since" ) + disp=( "+ $sep before (older files)" "- $sep since (newer files)" ) smatch=( - + ) else disp=( before exactly since ) - smatch=( - '' + ) + smatch=( + '' - ) fi alts=( "senses:sense${default}:compadd -V times -S '' -d disp -a smatch" ) fi diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals index 915f97c1c..bc3165eba 100644 --- a/Completion/Zsh/Type/_globquals +++ b/Completion/Zsh/Type/_globquals @@ -127,16 +127,14 @@ while [[ -n $PREFIX ]]; do alts+=( "time-specifiers:time specifier:compadd -E 0 -d tdisp -S '' -a tmatch" ) fi if ! compset -P '[-+]' && [[ -z $PREFIX ]]; then - sdisp=( before exactly since ) - smatch=( - '' + ) if zstyle -t ":completion:${curcontext}:senses" verbose; then zstyle -s ":completion:${curcontext}:senses" list-separator sep || sep=-- default=" [default exactly]" - sdisp=( "- $sep before" "+ $sep since" ) - smatch=( - + ) + sdisp=( "+ $sep before (older files)" "- $sep since (newer files)" ) + smatch=( + - ) else sdisp=( before exactly since ) - smatch=( - '' + ) + smatch=( + '' - ) fi alts+=( "senses:sense${default}:compadd -E 0 -d sdisp -S '' -a smatch" ) fi -- cgit v1.2.3 From b7490d337676b212be881bf692cb0db78ed42bc2 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Tue, 21 Dec 2021 01:20:01 +0100 Subject: 49655 based on 34928 (Daniel Hahler): new pip completion --- ChangeLog | 5 + Completion/Unix/Command/_pip | 213 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 218 insertions(+) create mode 100644 Completion/Unix/Command/_pip (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 4e1af7445..17d6cbc96 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-12-21 Oliver Kiddle <opk@zsh.org> + + * 49655 based on 34928 (Daniel Hahler): + Completion/Unix/Command/_pip: new pip completion + 2021-12-16 Oliver Kiddle <opk@zsh.org> * 49653: Src/Zle/computil.c: fix array indexing issue introduced diff --git a/Completion/Unix/Command/_pip b/Completion/Unix/Command/_pip new file mode 100644 index 000000000..bafc7f9e9 --- /dev/null +++ b/Completion/Unix/Command/_pip @@ -0,0 +1,213 @@ +#compdef -P pip[0-9.]# + +# To get completion of installable packages, do: +# pip install pip-cache +# and then run: +# pip-cache update + +local curcontext="$curcontext" ret=1 +local -a state state_descr line +local -A opt_args +local python pip +local -a args subcommands packages + +pip=${words[1]} +python=${${pip}/pip/python} +[[ $python == $pip ]] && python=python + +args=( + '(* : -)'{-h,--help}'[display usage information]' + '--isolated[ignore environment variables and user configuration]' + \*{-v,--verbose}'[give more output]' + \*{-q,--quiet}"[give less output]" + '--log=[specify log file where a complete record will be kept]:file:_files' + '--proxy=[specify a proxy]:proxy ([user\:passwd@]proxy.server\:port)' + '--retries=[specify maximum number of retries each connection should attempt]:retries [5]' + '--timeout=[set the socket timeout]:timeout (seconds) [15]' + '--exists-action=[specify action when a path already exists]:action:((s\:switch i\:ignore w\:wipe b\:backup a\:abort))' + '--cert=[specify path to alternate CA bundle]:path:_files' + '--client-cert=[specify path to SSL client certificate]:certificate file:_files' + '(--no-cache-dir)--cache-dir=[specify location to store the cache data]: :_directories' + '(--cache-dir)--no-cache-dir[disable the cache]' + "--disable-pip-version-check[don't check whether a new version of pip is available]" +) + +subcommands=( + 'install:install packages' + 'download:download packages' + 'uninstall:uninstall packages' + 'freeze:output installed packages in requirements format' + 'list:list installed packages' + 'show:show information about installed packages' + 'check:verify installed packages have compatible dependencies' + 'search:search PyPI for packages' + 'wheel:build wheels from your requirements' + 'hash:compute hashes of package archives' + 'help:show available commands' +) + +_arguments -C $args \ + '(* : -)'{-V,--version}'[display version information]' \ + ':subcommand:->subcommand' \ + '*::options:->options' && ret=0 + +case $state in + subcommand) + _describe -t subcommands 'pip subcommand' subcommands && ret=0 + ;; + + options) + curcontext="${curcontext%:*}-$words[2]:" + + case $words[1] in + download|install|list|wheel) + args+=( + '--pre[include pre-release and development versions]' + '(-i --index-url)'{-i+,--index-url=}'[base URL of Python Package Index]:url:_urls' + '--extra-index-url=[extra URLs of package indexes to use in addition to --index-url]:url:_urls' + '--no-index[ignore package index (only looking at --find-links URLs instead)]' + '(-f --find-links)'{-f+,--find-links=}'[parse specified URL or HTML file for links to packages]:URL or file:_files -g "*.htm(|l)(-.)"' + '--process-dependency-links[enable the processing of dependency links]' + ) + ;| + download|(un|)install|freeze|wheel) + args+=( + '(-r --requirement)'{-r+,--requirement=}'[all the packages listed in the given requirements file]:requirements file:_files -g "(requirement*|*.txt)(-.)"' + ) + ;| + download|install|wheel) + args+=( + '!--use-wheel' '!--no-use-wheel' + "*--no-binary=[don't use binary packages]: :->package_list" + "*--only-binary=[don't use source packages]: :->package_list" + \*{-c+,--constraint=}'[constrain versions using the given constraints file]:constraints file:_files' + '(-e --editable)'{-e+,--editable=}'[install a package directly from a checkout]:directory or VCS+REPOS_URL[@REV]#egg=PACKAGE:_files -/' + '--src=[check out --editable packages into given directory]: :_directories' + '--ignore-requires-python[ignore the Requires-Python information]' + "--no-deps[don't install package dependencies]" + '(-b --build)'{-https://cloud.kiddleb+,--build=}'[specify directory to unpack packages into]: :_directories' + '--global-option=[extra global options to be supplied to the setup.py call before the install command]:options' + "--no-clean[don't clean up build directories]" + '--require-hashes[require a hash to check each requirement against]' + ) + ;| + + download) + args+=( + '(-d --dest)'{-d+,--dest=}'[download packages into given directory]: :_directories' + '--platform=[only download wheels compatible with platform]::platform' + '--python-version=[only download wheels compatible with specified Python interpreter version]:version' + '--implementation=[only download wheels compatible with specified Python implementation]:implementation:(pp jy cp ip py)' + ) + ;; + + install) + args+=( + '(-t --target)'{-t+,--target=}'[specify directory to install packages into]: :_directories' + '(-d --download)'{-d+,--download=}'[download packages into directory instead of installing them]: :_directories' + '(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' + '--upgrade-strategy=[determine how dependency upgrading should be handled]:strategy:(eager only-if-needed)' + '--force-reinstall[when upgrading, reinstall all packages even if they are already up-to-date]' + '(-I --ignore-installed)'{-I,--ignore-installed}'[ignore installed packages]' + "--no-install[download and unpack all packages, but don't actually install them]" + "--no-download[don't download any packages, just install the ones already downloaded]" + '--install-option=[extra arguments to be supplied to the setup.py install command]:options' + '--user[install to the user install directory, typically ~/.local]' + '--egg[install as self contained egg file, like easy_install does]' + '--root=[install everything relative to this alternate root directory]: :_directories' + '--strip-file-prefix=[strip given prefix from script paths in wheel RECORD]:prefix' + '--prefix=[specify installation prefix where lib, bin and other top-level folders are placed]: :_directories' + '(--no-compile)--compile[compile py files to pyc]' + "(--compile)--no-compile[don't compile py files to pyc]" + '*:package name:->packages_or_dirs' + ) + ;; + + uninstall) + args+=( + '(-y --yes)'{-y,--yes}"[don't ask for confirmation of uninstall deletions]" + ':installed package:->installed_packages' + ) + ;; + + freeze) + args+=( + '(-f --find-links)'{-f+,--find-links=}'[specify URL to look for packages at]:url:_urls' + '(-l --local)'{-l,--local}"[if in a virtualenv that has global access, don't list globally-installed packages]" + '--user[only output packages installed in user-site]' + '--all[include pip, setuptools, distribute and wheel in output]' + ) + ;; + + hash) + args+=( + '(-a --algorithm)'{-a+,--algorithm=}'[specify hash algorithm]:algorithm:(sha256 sha384 sha512)' + '*: :_files' + ) + ;; + + list) + args+=( + '(-o --outdated -u --uptodate)'{-o,--outdated}'[list outdated packages (excluding editables)]' + '(-u --uptodate -o --outdated)'{-u,--uptodate}'[list uptodated packages (excluding editables)]' + '(-e --editable)'{-e,--editable}'[list editable projects]' + '(-l --local)'{-l,--local}"[if in a virtualenv that has global access, don't list globally-installed packages]" + '--user[only output packages installed in user-site]' + '--format=[select the output format]:format [legacy]:(legacy columns freeze json)' + '--not-required[list packages that are not dependencies of installed packages]' + ) + ;; + + show) + args+=( + '(-f --files)'{-f,--files}'[show the full list of installed files for each package]' + ':installed package:->installed_packages' + ) + ;; + + search) + args+=( + '(-i --index)'{-i+,--index=}'[specify base URL of Python Package Index]:URL:_urls' + ) + ;; + + wheel) + args+=( + '(-w --wheel-dir)'{-w+,--wheel-dir=}"[build wheels into given directory]: :_directories" + "--build-option=[extra arguments to be supplied to 'setup.py bdist_wheel']:options" + ) + ;; + + help) + _describe -t subcommands 'pip subcommand' subcommands + return + ;; + + *) args+=( '*: :_default' ) ;; + esac + + _arguments -s -S $args && ret=0 + + case $state in + package_list) + packages=( ${(f)"$(_call_program packages pip-cache pkgnames)"} ) + _sequence _wanted packages expl package compadd - -a packages && ret=0 + ;; + + packages_or_dirs) + [[ -prefix - ]] || packages=( ${(f)"$(_call_program packages pip-cache pkgnames)"} ) + _alternative \ + 'all-packages:package:compadd -a packages' \ + 'directories:directory with setup.py:_directories' && ret=0 + ;; + + installed_packages) + packages=( $(_call_program fetch-installed \ + "env COMP_WORDS='pip uninstall' COMP_CWORD=2 PIP_AUTO_COMPLETE=1 $pip") ) + _wanted installed-packages expl 'installed package' compadd -a packages && ret=0 + ;; + esac + ;; +esac + +return ret -- cgit v1.2.3 From 85bf9740a01e168b7b814469892d97fdabc67144 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle <opk@zsh.org> Date: Wed, 29 Dec 2021 00:22:33 +0100 Subject: 49668: update zfs completion --- ChangeLog | 7 +- Completion/Unix/Command/_zfs | 1911 ++++++++++++++++++++--------- Completion/Unix/Command/_zpool | 311 ----- Completion/Unix/Type/_zfs_dataset | 15 +- Completion/Unix/Type/_zfs_keysource_props | 15 - 5 files changed, 1365 insertions(+), 894 deletions(-) delete mode 100644 Completion/Unix/Command/_zpool delete mode 100644 Completion/Unix/Type/_zfs_keysource_props (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index f65822e88..9a79ff2d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ - 2021-12-24 Bart Schaefer <schaefer@zsh.org> +2021-12-29 Oliver Kiddle <opk@zsh.org> + + * 49668: Completion/Unix/Command/_zfs, + Completion/Unix/Type/_zfs_dataset: update zfs completion + +2021-12-24 Bart Schaefer <schaefer@zsh.org> * m0viefreak: 38150: Src/Zle/compmatch.c: fix off-by-one error in matcher spec parsing diff --git a/Completion/Unix/Command/_zfs b/Completion/Unix/Command/_zfs index 51da9170b..be4a64b33 100644 --- a/Completion/Unix/Command/_zfs +++ b/Completion/Unix/Command/_zfs @@ -1,561 +1,1350 @@ -#compdef zfs -# Synced with the S11U1 man page - -_zfs() { - local context state line expl implementation - typeset -A opt_args - local -a subcmds rw_properties rw_propnames ro_properties create_properties - local -a share_nfs_ro_properties share_nfs_rw_properties - local -a share_smb_ro_properties share_smb_rw_properties - local -a share_ro_properties share_rw_properties - local -a difffields delegatable_perms - - _pick_variant -r implementation -c 'zpool upgrade -v' openzfs='This system supports ZFS pool feature flags' solaris - - subcmds=( - "create" "destroy" "clone" "promote" "rename" "snapshot" - "rollback" "list" "set" "get" "inherit" "mount" "unmount" - "share" "unshare" "send" "receive" "allow" "unallow" - "upgrade" "userspace" "groupspace" "hold" "holds" "release" - "diff" "key" "help" - ) - - [[ $OSTYPE == freebsd<7->.* ]] && subcmds+=(jail unjail) - - share_nfs_ro_properties=( - "share.nfs.all" - ) - - share_nfs_rw_properties=( - "share.nfs:value:(on off)" - "share.nfs.aclok:value:(on off)" - "share.nfs.acflfab:value:(on off)" - "share.nfs.anon:uid:" - "share.nfs.charset.euc-cn:access-list:" - "share.nfs.charset.euc-jpms:access-list:" - "share.nfs.charset.euc-kr:access-list:" - "share.nfs.charset.euc-tw:access-list:" - "share.nfs.charset.iso8859-1:access-list:" - "share.nfs.charset.iso8859-2:access-list:" - "share.nfs.charset.iso8859-5:access-list:" - "share.nfs.charset.iso8859-6:access-list:" - "share.nfs.charset.iso8859-7:access-list:" - "share.nfs.charset.iso8859-8:access-list:" - "share.nfs.charset.iso8859-9:access-list:" - "share.nfs.charset.iso8859-13:access-list:" - "share.nfs.charset.iso8859-15:access-list:" - "share.nfs.charset.koi8-r:access-list:" - "share.nfs.index:file:_files" - "share.nfs.log:nfslog.conf tag:" - "share.nfs.nosub:value:(on off)" - "share.nfs.nosuid:value:(on off)" - "share.nfs.public:value:(on off)" - "share.nfs.sec:security-mode-list:" - "share.nfs.sec.default.none:access-list:" - "share.nfs.sec.default.ro:access-list:" - "share.nfs.sec.default.root:access-list:" - "share.nfs.sec.default.root_mapping:uid:" - "share.nfs.sec.default.rw:access-list:" - "share.nfs.sec.default.window:seconds" - "share.nfs.sec.dh.none:access-list:" - "share.nfs.sec.dh.ro:access-list:" - "share.nfs.sec.dh.root:access-list:" - "share.nfs.sec.dh.root_mapping:uid:" - "share.nfs.sec.dh.rw:access-list:" - "share.nfs.sec.dh.window:seconds" - "share.nfs.sec.krb5.none:access-list:" - "share.nfs.sec.krb5.ro:access-list:" - "share.nfs.sec.krb5.root:access-list:" - "share.nfs.sec.krb5.root_mapping:uid:" - "share.nfs.sec.krb5.rw:access-list:" - "share.nfs.sec.krb5.window:seconds" - "share.nfs.sec.krb5i.none:access-list:" - "share.nfs.sec.krb5i.ro:access-list:" - "share.nfs.sec.krb5i.root:access-list:" - "share.nfs.sec.krb5i.root_mapping:uid:" - "share.nfs.sec.krb5i.rw:access-list:" - "share.nfs.sec.krb5i.window:seconds" - "share.nfs.sec.krb5p.none:access-list:" - "share.nfs.sec.krb5p.ro:access-list:" - "share.nfs.sec.krb5p.root:access-list:" - "share.nfs.sec.krb5p.root_mapping:uid:" - "share.nfs.sec.krb5p.rw:access-list:" - "share.nfs.sec.krb5p.window:seconds" - "share.nfs.sec.none.none:access-list:" - "share.nfs.sec.none.ro:access-list:" - "share.nfs.sec.none.root:access-list:" - "share.nfs.sec.none.root_mapping:uid:" - "share.nfs.sec.none.rw:access-list:" - "share.nfs.sec.none.window:seconds" - "share.nfs.sec.sys.none:access-list:" - "share.nfs.sec.sys.ro:access-list:" - "share.nfs.sec.sys.root:access-list:" - "share.nfs.sec.sys.root_mapping:uid:" - "share.nfs.sec.sys.rw:access-list:" - "share.nfs.sec.sys.window:seconds" - ) - - share_smb_ro_properties=( - "share.smb.all" - ) - - share_smb_rw_properties=( - "share.smb:value:(on off)" - "share.smb.ad-container" - "share.smb.abe" - "share.smb.csc:value:(disabled manual auto vdo)" - "share.smb.catia:value:(on off)" - "share.smb.dfsroot:value:(on off)" - "share.smb.guestok:value:(on off)" - "share.smb.ro:access-list:" - "share.smb.rw:access-list:" - "share.smb.none:access-list:" - ) - - share_ro_properties=( - "share.all" - "share.fs" - "share.name" - "share.point" - "share.protocols" - "share.state" - $share_nfs_ro_properties - $share_smb_ro_properties - ) - - share_rw_properties=( - "share.desc:description:" - "share.noauto:value:(on off)" - "share.path:path:" - $share_nfs_rw_properties - $share_smb_rw_properties - ) - - # TODO: userused@ and groupused@ could have more extensive handling - ro_properties=( - "name" "type" "creation" "space" "used" "available" "referenced" - "compressratio" "mounted" "origin" "usedbychildren" - "usedbydataset" "usedbyrefreservation" "usedbysnapshots" - "defer_destroy" "userused@" "userrefs" "groupused@" - "keychangedate" "keystatus" "rekeydate" - $share_ro_properties - ) - - # TODO: Be cleverer about what values can be set. Is there any way to - # set the sorting for *size properties to false by default? - rw_properties=( - "aclinherit:value:(discard noallow restricted passthrough passthrough-x)" - "atime:value:(on off)" - "canmount:value:(on off noauto)" - "checksum:value:(on off fletcher2 fletcher4 sha256 sha256+mac)" - "compression:value:(on off lzjb lz4 gzip gzip-{1..9} zle)" - "copies:value:(1 2 3)" - "dedup:value:(on off verify sha256 sha256,verify)" - "devices:value:(on off)" - "encryption:value:(off on aes128-ccm aes-192-ccm aes-256-ccm aes-128-gcm aes-192-gcm aes-256-gcm)" - "exec:value:(on off)" - "groupquota@:value:" # TODO: complete group=size|none - "keysource:value:_zfs_keysource_props" - "logbias:value:(latency throughput)" - "mlslabel:value:(none)" # TODO: list sensitivity labels - "mountpoint:path, 'legacy', or 'none':{if [[ -prefix /* ]]; then _path_files -/; else _wanted mountpoints expl 'mountpoint (type \"/\" to start completing paths)' compadd legacy none; fi}" - "multilevel:value:(on off)" - "nbmand:value:(on off)" - "primarycache:value:(all none metadata)" - "quota: : _alternative \ - 'sizes: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' \ - 'properties:property:(none)'" - "readonly:value:(on off)" - "recordsize:value:(512 1K 2K 4K 8K 16K 32K 64K 128K 256K 512K 1M)" - "refquota: : _alternative \ - 'sizes: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' \ - 'properties:property:(none)'" - "refreservation: : _alternative \ - 'sizes: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' \ - 'properties:property:(auto none)'" - "reservation: : _alternative \ - 'sizes: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' \ - 'properties:property:(none)'" - "rstchown:value:(on off)" - "secondarycache:value:(all none metadata)" - "setuid:value:(on off)" - "shadow:value:" # TODO: complete URI|none - "share:share properties:" - "snapdir:value:(hidden visible)" - "sync:value:(standard always disabled)" - "userquota@:value:" # TODO: complete user=size|none - "version:value:(1 2 3 4 current)" - "volsize:value:" # <size> - "vscan:value:(on off)" - "xattr:value:(on off)" - "zoned:value:(on off)" - $share_rw_properties - ) - - if [[ "$OSTYPE" == "linux-gnu" ]]; then - rw_properties+=("acltype:value:(off noacl posixacl)") - elif [[ "$implementation" == "solaris" ]]; then - rw_properties+=("aclmode:value:(discard mask passthrough)") - else - rw_properties+=("aclmode:value:(discard groupmask passthrough restricted)") - fi - - - create_properties=( - $rw_properties - "casesensitivity:value:(sensitive insensitive mixed)" - "normalization:value:(none formC formD formKC formKD)" - "utf8only:value:(on off)" - "volblocksize:value:(512 1K 2K 4K 8K 16K 32K 64K 128K 256K 512K 1M)" - ) - - delegatable_perms=( - "allow" "clone" "create" "destroy" "diff" "hold" "key" - "keychange" "mount" "promote" "receive" "release" "rename" - "rollback" "send" "share" "snapshot" - "groupused" "userused" "userprop" - ${create_properties%%:*} - ) - - rw_propnames=( ${rw_properties%%:*} ) - - difffields=( - object parent size links linkschange name oldname user group - ctime mtime atime crtime - ) - - if [[ $service == "zfs" ]]; then - _arguments -C -A "-*" \ - '-\?[Help]' \ - '*::command:->subcmd' && return 0 - - if (( CURRENT == 1 )); then - _wanted commands expl "zfs subcommand" compadd -a subcmds - return - fi - service="$words[1]" - curcontext="${curcontext%:*}=$service:" - fi - - case $service in - ("create") - _arguments -A "-*" \ - '-p[Create parent datasets]' \ - '*-o[Set initial properties]:property:_values -s , "property" $create_properties' \ - - set1 \ - ':filesystem:_zfs_dataset -t fs -e "parent dataset"' \ - - set2 \ - '-s[Create sparse volume]' \ - '-b+[set volblocksize]: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes blocksize :B {k,M,G,T,P,E,Z}{,B}' \ - '-V+[set size]: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' \ - ':volume:_zfs_dataset -t fs -e "parent dataset"' - ;; - - ("destroy") - _arguments -A "-*" \ - '-r[Recursively destroy all children]' \ - '-R[Recursively destroy all dependents]' \ - - set1 \ - '-d[delete or mark deferred]' \ - ':snapshot:_zfs_dataset -t snap' \ - - set2 \ - '-f[Force unmounts]' \ - ':filesystem/volume/snapshot:_zfs_dataset -t fs -t vol' - ;; - - (snap(|shot)) - _arguments -A "-*" \ - '-r[Recursively snapshot all descendant datasets]' \ - '*-o[Set property]:property:_values -s , "property" $create_properties' \ - ':filesystem/volume:_zfs_dataset -t fs -t vol -S@' - ;; - - ("rollback") - _arguments -A "-*" \ - '-r[Recursively destroy more recent snapshots]' \ - '-R[Recursively destroy more recent snapshots and clones]' \ - '-f[Force unmounts]' \ - ':snapshot:_zfs_dataset -t snap' - ;; - - ("clone") - # XXX needs to bail if there are no snapshots - _arguments -A "-*" \ - '-p[Create parent datasets]' \ - '-K[Create encryption key]' \ - '*-o[Set property]:property:_values -s , "property" $create_properties' \ - ':snapshot:_zfs_dataset -t snap' \ - ':filesystem/volume:_zfs_dataset -t fs -e "parent dataset"' - ;; - - ("promote") - _arguments \ - ':filesystem:_zfs_dataset -t clone' \ - ;; - - ("rename") - _arguments -A "-*" \ - '(-r)-p[Create parent datasets]' \ - '(-p)-r[Recursively rename snapshots of all descendent datasets]' \ - ':dataset:_zfs_dataset -r1' \ - ':dataset:_zfs_dataset -r2' - ;; - - ("list") - _arguments -A "-*" \ - '-r[Recursively display children]' \ - '-H[Scripting mode]' \ - '-d[Depth]:value:' \ - '-o[Properties to list]:property:_values -s , "property" $ro_properties $rw_propnames' \ - '*-s[Sort key (ascending)]:property:_values "property" $ro_properties $rw_propnames' \ - '*-S[Sort key (descending)]:property:_values "property" $ro_properties $rw_propnames' \ - '-t[Dataset types to list]:dataset type:_values -s , "dataset type" all filesystem snapshot volume' \ - '*:filesystem/volume/snapshot/path:_zfs_dataset -p' - ;; - - ("set") - _arguments \ - '-r[Recursively apply value]' \ - ':property:_values -s , "property" $rw_properties' \ - '*:filesystem/volume:_zfs_dataset -t fs -t vol' - ;; - - ("get") - _arguments -A "-*" \ - "-r[Recursively display children's properties]" \ - '-d[Depth]:value:' \ - '-H[Scripting mode]' \ - '-p[Display numbers exactly]' \ - '-s[Specify sources]:source:_values -s , "source" local default inherited temporary none' \ - '-o[Specify fields]:field:_values -s , "field" name property value source' \ - ':property:_values -s , "property" $ro_properties $rw_propnames all' \ - '*:filesystem/volume/snapshot:_zfs_dataset' - ;; - - ("inherit") - _arguments -A "-*" \ - '-r[Recursively inherit property for all children]' \ - '-S[Revert to received property value]' \ - ':property:_values -s , "property" $ro_properties $rw_properties' \ - '*:filesystem/volume:_zfs_dataset -t fs -t vol' - ;; - - ("userspace"|"groupspace") - _arguments -A "-*" \ - '-n[Print numeric ID]' \ - '-i[Translate SID to POSIX ID]' \ - '-H[Tab-delimited output with no headers]' \ - '-p[Parseable mode]' \ - '-o[Properties to list]:property:_values -s , "property" type name used quota' \ - '*-s[Sort key (ascending)]:property:_values "property" type name used quota' \ - '*-S[Sort key (descending)]:property:_values "property" type name used quota' \ - '-t[Types to list]:type:_values -s , "type" all posixuser smbuser posixgroup smbgroup' \ - '*:filesystem/volume/snapshot:_zfs_dataset' - ;; - - ("mount") - _arguments -A "-*" \ - '-o[Mount options]:mount options:_values -s , "option" {,no}{devices,exec,setuid} ro rw' \ - '-O[Overlay mount]' \ - '-v[Report mount progress]' \ - - set1 \ - ':filesystem:_zfs_dataset -t fs' \ - - set2 \ - '-a[Mount all available ZFS filesystems]' - ;; - - ("unmount") - _arguments -A "-*" \ - - set1 \ - '-f[Force unmount]' \ - ':filesystem:_zfs_dataset -t fs -t mtpt' \ - - set2 \ - '-a[Unmount all ZFS filesystems]' - ;; - - ("share") - _arguments -A "-*" \ - - set1 \ - '-a[Share all available ZFS filesystems]' \ - - set2 \ - '-r[Share filesystems recursively]' \ - ':filesystem:_zfs_dataset -t fs' \ - - set3 \ - '*-o[Create a share with these properties]:property:_values -w "share properties" $share_rw_properties' \ - '-u[Create a share without sharing it]' \ - ':filesystem:_zfs_dataset -t fs' \ - - set4 \ - ':filesystem:_zfs_dataset -t fs -t mtpt -t share' - ;; - - ("unshare") - _arguments -A "-*" \ - - set1 \ - '-a[Unshare all shared ZFS filesystems]' \ - - set2 \ - '-r[Unshare filesystems recursively]' \ - ':filesystem:_zfs_dataset -t fs' \ - - set3 \ - ':filesystem:_zfs_dataset -t fs -t mtpt -t share' - ;; - - ("send") - _arguments -A "-*" \ - '-b' \ - '-i[Generate an incremental stream]:snapshot:_zfs_dataset -t snap' \ - '-D[Perform dedup processing]' \ - '-p[Send properties]' \ - '-v[Verbose]' \ - - set1 \ - '-I[Generate an incremental stream with intermediary snapshots]:snapshot:_zfs_dataset -t snap' \ - '-R[Generate a replication stream package]' \ - ':snapshot:_zfs_dataset -t snap' \ - - set2 \ - '-c[Create a self-contained stream]' \ - '-r[Generate a recursive stream package]' \ - ':snapshot:_zfs_dataset -t snap' - ;; - - ("receive") - _arguments -A "-*" \ - '-v[Verbose]' \ - '-n[Do not receive the stream]' \ - '-F[Force a rollback if necessary]' \ - '-u[Filesystem is not mounted]' \ - '-o[Include property change in the stream]::' \ - '-x[Exclude property change from the stream]:property:' \ - - set1 \ - ':filesystem/volume/snapshot:_zfs_dataset' \ - - set2 \ - '(-e)-d[Set path prefix from stream, excluding only pool name]' \ - '(-d)-e[Set path prefix from stream, using last path element]' \ - '-:filesystem:_zfs_dataset -t fs' - ;; - - ("allow") - _arguments -A "-*" \ - '(1 -g -e -c -s)-u[delegate to user]:user:_users' \ - '(1 -u -e -c -s)-g[delegate to group]:group:_groups' \ - '(1 -g -u -c -s)-e[delegate to everyone]' \ - '(1 -u -g -e -l -d -s)-c[set permissions for newly-created descendant filesystems]' \ - '(1 -u -g -e -l -d -c)-s[define or modify permission sets]:permission set' \ - '(1 -c -s)-l[allow for named dataset]' \ - '(1 -c -s)-d[allow for descendent datasets]' \ - '1::filesystem/volume:_zfs_dataset -t fs -t vol' \ - ':permissions or sets:_values -s , "permission or set" $delegatable_perms' \ - ':filesystem/volume:_zfs_dataset -t fs -t vol' \ - ;; - - ("unallow") - _arguments -A "-*" \ - '-r[Recursive removal]' \ - - set1 \ - '-s[Remove permissions from or delete a permission set]:permission set:' \ - ':permissions or sets:_values -s , "permission or set" $delegatable_perms' \ - ':filesystem/volume:_zfs_dataset -t fs -t vol' \ - - set2 \ - '(-g)-u[User]:user:_users' \ - '(-u)-g[Group]:group:_groups' \ - '-l[Allow for named dataset]' \ - '-d[Allow for descendent datasets]' \ - ':permissions or sets:_values -s , "permission or set" $delegatable_perms' \ - ':filesystem/volume:_zfs_dataset -t fs -t vol' \ - - set3 \ - '-e[Everyone]' \ - '-l[Allow for named dataset]' \ - '-d[Allow for descendent datasets]' \ - ':permissions or sets:_values -s , "permission or set" $delegatable_perms' \ - ':filesystem/volume:_zfs_dataset -t fs -t vol' \ - - set4 \ - '-c[Create-time permissions]' \ - ':permissions or sets:_values -s , "permission or set" $delegatable_perms' \ - ':filesystem/volume:_zfs_dataset -t fs -t vol' - ;; - - ("upgrade") - _arguments -A "-*" \ - - set1 \ - '-v[Verbose]' \ - - set2 \ - '-a[Upgrade all filesystems on all pools]' \ - '-r[Upgrade descendent filesystems, too]' \ - '-V[Upgrade to specified version]:version:(1 2)' \ - - set3 \ - '-r[Upgrade descendent filesystems, too]' \ - '-V[Upgrade to specified version]:version:(1 2)' \ - ':filesystem:_zfs_dataset -t fs' - ;; - - ("hold") - _arguments -A "-*" \ - '-r[Apply hold recursively]' \ - ':tag:' \ - ':snapshot:_zfs_dataset -t snap' - ;; - - ("holds") - _arguments -A "-*" \ - '-r[List holds recursively]' \ - ':snapshot:_zfs_dataset -t snap' - ;; - - ("release") - _arguments -A "-*" \ - '-r[Release holds recursively]' \ - ':tag:' \ - ':snapshot:_zfs_dataset -t snap' - ;; - - ("diff") - _arguments -A "-*" \ - '-F[Add column for filetype character]' \ - '-H[Parseable output]' \ - '-e[Only show new and changed files]' \ - '*-o[Show fields]:field:_values "field" $difffields' \ - '-t[Add column for ctime]' \ - - set1 \ - ':snapshot:_zfs_dataset -t snap' \ - ':snapshot or filesystem:_zfs_dataset -t snap -t fs' \ - - set2 \ - '-E[Show difference from empty]' \ - ':snapshot or filesystem:_zfs_dataset -t snap -t fs' - ;; - - ("key") - _arguments -A "-*" \ - - set1 \ - '-a[Apply to all datasets in all pools]' \ - '(-u -K -f)-l[Load the encryption key]' \ - '(-l -K)-u[Unload the encryption key]' \ - '(-l -u -f)-K[Create a new data encryption key]' \ - '(-l -K)-f[Unmount the dataset before unloading the encryption key]' \ - '-r[Apply recursively]' \ - ':filesystem or volume:_zfs_dataset -t fs -t vol' \ - - set2 \ - '-c[Change the encryption key]' \ - '-o[Change a property]:property:_zfs_keysource_props' \ - ':filesystem or volume:_zfs_dataset -t fs -t vol' - ;; - - ("jail"|"unjail") - _arguments \ - '1: : _jails' \ - '2:filesystem:_zfs_dataset -t fs' - ;; - - ("help") - _arguments -A "-*" \ - - set1 \ - ':command:($subcmds $delegatable_perms $ro_properties ${rw_properties%%:*} properties)' \ - - set2 \ - '-l[Display property information]' \ - ': :(properties)' - ;; - - (*) - _message "unknown zfs subcommand: $service" - ;; - esac -} - -_zfs "$@" +#compdef zfs zdb zpool + +local curcontext="$curcontext" implementation nm="$compstate[nmatches]" +local -a state curstate line state_descr expl alts args +typeset -A opt_args val_args +local MATCH MBEGIN MEND +local -a subcmds +local -a share_nfs_ro_properties share_nfs_rw_properties +local -a share_smb_ro_properties share_smb_rw_properties +local -a share_ro_properties share_rw_properties +local -a difffields delegatable_perms key_properties +local -a ds_types sum_algorithms comp_algorithms dedup_algorithms + +local -a ds_propnames ro_ds_props rw_ds_props ci_ds_props # dataset properties +local -a po_propnames ro_po_props rw_po_props ci_po_props # pool properties + +_pick_variant -r implementation -c 'zpool upgrade -v' openzfs='This system supports ZFS pool feature flags' solaris + +ds_types=( filesystem snapshot volume all ) +sum_algorithms=( on off fletcher2 fletcher4 sha256 ) +comp_algorithms=( on off lzjb lz4 gzip gzip-{1..9} zle ) +dedup_algorithms=( on off verify sha256 sha256,verify ) + +ro_po_props=( # readonly + 'all[all properties]' + 'allocated[space allocated]' + 'capacity[space used (percentage)]' + 'dedupratio[deduplication ratio]' + 'free[space unallocated]' + 'health[health status]' + 'size[total size]' +) +ci_po_props=( # only set at create or import + 'altroot[alternate root directory]:path:_directories' + 'guid[unique identifier]:identifier' + 'readonly[whether the pool can be modified]:value:(on off)' +) +rw_po_props=( + 'autoexpand[automatic pool expansion]:value:(on off)' + 'autoreplace[automatic device replacement]:value:(on off)' + 'bootfs[default bootable dataset]:dataset:_zfs_dataset' + 'cachefile[pool configuration cache file location]:value' + 'dedupditto[threshold for number of copies]:value [0]' + 'delegation[delegated administration]:value:(on off)' + 'failmode[failure-mode behavior]:value:(wait continue panic)' + "listshares[show shares in 'zfs list']:value:(on off)" + "listsnaps[show snapshots in 'zfs list']:value:(on off)" + 'version[pool version]:version' +) + +# TODO: userused@ and groupused@ could have more extensive handling +ro_ds_props=( + name type creation space used available referenced compressratio mounted + origin usedbychildren usedbydataset usedbyrefreservation usedbysnapshots + defer_destroy userused@ userrefs groupused@ keystatus +) +ci_ds_props=( + 'casesensitivity:value:(sensitive insensitive mixed)' + 'normalization:value:(none formC formD formKC formKD)' + 'utf8only:value:(on off)' +) +rw_ds_props=( + 'aclinherit:value:(discard noallow restricted passthrough passthrough-x)' + 'atime:value:(on off)' + 'canmount:value:(on off noauto)' + "checksum:value:($sum_algorithms)" + "compression:value:($comp_algorithms)" + 'copies:value:(1 2 3)' + "dedup:value:($dedup_algorithms)" + 'devices:value:(on off)' + 'encryption:value:(off on aes128-ccm aes-192-ccm aes-256-ccm aes-128-gcm aes-192-gcm aes-256-gcm)' + 'exec:value:(on off)' + 'groupquota@' + 'logbias:value:(latency throughput)' + "mountpoint: : _alternative \ + 'properties:property:(none legacy)' \ + 'paths:mountpoint:_directories -W / -P /'" + 'multilevel:value:(on off)' + 'nbmand:value:(on off)' + 'primarycache:value:(all none metadata)' + 'quota: :->quotas' + 'readonly:value:(on off)' + 'recordsize:value:(512 1K 2K 4K 8K 16K 32K 64K 128K 256K 512K 1M)' + 'refquota: :->quotas' + "refreservation: : _alternative \ + 'sizes: :_numbers -M \"m:{a-zA-Z}={A-Za-z}\" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' \ + 'properties:property:(auto none)'" + 'reservation: :->quotas' + 'rstchown:value:(on off)' + 'secondarycache:value:(all none metadata)' + 'setuid:value:(on off)' + 'shadow:value' # TODO: complete URI|none + 'share:share properties' + 'snapdir:value:(hidden visible)' + 'sync:value:(standard always disabled)' + 'userquota@' + 'version:value' + 'volsize:size:_numbers -M "m:{a-zA-Z}={A-Za-z}" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' +) + +case $service:$implementation in + *:openzfs) + ds_types+=( bookmark ) + sum_algorithms+=( noparity sha512 skein edonr ) + comp_algorithms+=( zstd zstd-{1..19} zstd-fast zstd-fast-{{1..9}{,0},100,500,1000} ) + dedup_algorithms+=( {sha512,skein}{,\,verify} edonr,verify ) + share_rw_properties=( sharesmb:option sharenfs:option ) + ro_po_props+=( + 'expandsize[uninitialized space within the pool]' + 'fragmentation[amount of fragmentation in the pool]' + 'freeing[amount of space remaining to be reclaimed]' + 'used[amount of storage space used within the pool]' + 'load_guid[unique identifier generated when pool is loaded]' + ) + ci_po_props+=( + 'ashift[pool sector size exponent]:exponent:((9\:512 10\:1024 11\:2048 12\:4096 13\:8192 14\:16384 15\:32768 16\:65536))' + ) + rw_po_props+=( + 'autotrim[periodically trim recently freed space]:value:(on off)' + 'comment[text string that is available even if the pool becomes faulted]:value' + 'multihost[perform pool activity check during import]:value:(on off)' + ) + rw_ds_props+=( + 'aclmode:value:(discard groupmask passthrough restricted)' + 'acltype:value:(off noacl nfsv4 posix posixacl)' + 'mlslabel:value:(none)' # TODO: list sensitivity labels + 'redundant_metadata:value:(all most)' + 'vscan:value:(on off)' + 'xattr:value:(on off dir sa)' + "filesystem_limit: :{if [[ -prefix [0-9]## ]]; then _message -e 'number'; elif [[ -prefix n ]]; then compadd none; else _message -e limits 'number or none'; fi}" + "snapshot_limit: :{if [[ -prefix [0-9]## ]]; then _message -e 'number'; elif [[ -prefix n ]]; then compadd none; else _message -e limits 'number or none'; fi}" + 'volmode:mode:(( + default\:use\ system-wide\ tunable + full\:expose\ as\ block\ devices + geom\:expose\ as\ block\ devices + dev\:hide\ partitions + none\:not\ exposed\ outside\ zfs + ))' + ) + ro_ds_props+=( + createtxg clones filesystem_count guid logicalreferenced logicalused + receive_resume_token refcompressratio snapshot_count volblocksize written + ) + delegatable_perms=( + bookmark load-key change-key userobjquota userobjused groupobjquota + groupobjused projectused projectquota projectobjused projectobjquota + ) + ;| + *:solaris) + ds_types+=( share ) + sum_algorithms+=( sha256+mac ) + share_nfs_ro_properties=( share.nfs.all ) + share_nfs_rw_properties=( + 'share.nfs:value:(on off)' + 'share.nfs.aclok:value:(on off)' + 'share.nfs.aclfab:value:(on off)' + 'share.nfs.anon:uid' + 'share.nfs.charset.'{cp932,euc-{cn,jpns,kr,tw},iso8859-{1,2,5,6,7,8,9,13,15},koi8-r,shift_jis}':access-list' + 'share.nfs.index:file:_files' + 'share.nfs.labeled:value:(on off)' + 'share.nfs.noaclfab:value:(on off)' + 'share.nfs.log:nfslog.conf tag' + 'share.nfs.nosub:value:(on off)' + 'share.nfs.nosuid:value:(on off)' + 'share.nfs.public:value:(on off)' + 'share.nfs.sec:security-mode-list' + 'share.nfs.sec.'{default,dh,krb5{,i,p},none,sys}.{ro,root,rw}':access-list' + 'share.nfs.sec.'{default,dh,krb5{,i,p},none,sys}.root_mapping':uid' + 'share.nfs.sec.'{default,dh,krb5{,i,p},none,sys}.window':credential lifetime (seconds)' + 'share.nfs.sec.sys.resvport:value:(on off)' + ) + share_smb_ro_properties=( share.smb.all ) + share_smb_rw_properties=( + 'share.smb:value:(on off)' + 'share.smb.abe' + 'share.smb.ad-container' + 'share.smb.catia:value:(on off)' + 'share.smb.csc:value:(disabled manual auto vdo)' + 'share.smb.dfsroot:value:(on off)' + 'share.smb.encrypt:value:(on off)' + 'share.smb.guestok:value:(on off)' + 'share.smb.oplocks:value:(disabled enabled)' + 'share.smb.cont_avail:value:(on off)' + 'share.smb.'{none,ro,rw}':access-list' + ) + share_ro_properties=( + share.all share.fs share.name share.point share.protocols share.state + $share_nfs_ro_properties $share_smb_ro_properties + ) + share_rw_properties=( + 'share.desc:description' + 'share.auto:value:(on off)' + 'share.autoname:value' + 'share.nfs.cksum:value' + 'share.path:path' + $share_nfs_rw_properties $share_smb_rw_properties + ) + ro_po_props+=( + 'lastscrub[start time of the last successful scrub]' + ) + rw_po_props+=( + 'clustered[pool is imported as a global pool in Oracle Solaris Cluster]:value:(on off)' + 'scrubinternal[time interval between scheduled scrubs]:interval' + ) + ro_ds_props+=( keychangedate rekeydate effective{read,write}limit ) + rw_ds_props+=( + 'aclmode:value:(discard mask passthrough)' + "defaultreadlimit: : _alternative \ + 'sizes: :_guard \[0-9\]\#\(\|\[BKMGTPEZ\]\) size\ \(bytes\ per\ second\)' \ + 'properties:property:(none)'" + "defaultwritelimit: : _alternative \ + 'sizes: :_guard \[0-9\]\#\(\|\[BKMGTPEZ\]\) size\ \(bytes\ per\ second\)' \ + 'properties:property:(none)'" + 'defaultuserquota:->quotas' + 'defaultgroupquota: :->quotas' + 'keysource:value:->keysources' + ) + ci_ds_props+=( + 'volblocksize:value:compadd -o nosort 512 1K 2K 4K 8K 16K 32K 64K 128K 256K 512K 1M' + ) + difffields=( + object parent size links linkschange name oldname user group + ctime mtime atime crtime mountpoint dataset_name + ) + delegatable_perms=( key keychange ) + ;| + zfs:openzfs) + subcmds+=( + bookmark change-key load-key program project projectspace redact + unload-key wait + ) + ;| + zpool:openzfs) + subcmds+=( + checkpoint events labelclear initialize reopen resilver sync trim wait + version + ) + ;| + zfs:solaris) + subcmds+=( key help ) + ;| + zpool:solaris) + subcmds+=( help label monitor ) + ;| + + zfs:*) + subcmds+=( + create destroy clone promote rename snapshot rollback list set get + inherit mount unmount share unshare send receive allow unallow upgrade + userspace groupspace hold holds release diff + ) + [[ $OSTYPE = freebsd<7->.* ]] && subcmds+=( jail unjail ) + ;; + zpool:*) + subcmds+=( + add attach clear create destroy detach export get history import iostat + list offline online reguid remove replace scrub set split status upgrade + ) + ;; +esac + +case $OSTYPE in + solaris*) + rw_ds_props+=( 'zoned:value:(on off)' ) + ;; + freebsd*) + [[ $OSTYPE = freebsd<-12>.* ]] && subcmds+=( remap ) + rw_ds_props+=( 'jailed:value:(on off)' ) + ;; + linux-gnu) + rw_ds_props+=( 'relatime:value:(on off)' ) + ci_ds_props+=( + {,fs,def,root}'context:SELinux context:_selinux_contexts' + ) + ;; +esac + +delegatable_perms+=( + allow clone create destroy diff hold key keychange mount promote receive + release rename rollback send share snapshot groupquota groupused userprop + userused ${ci_ds_props%%:*} +) + +key_properties=( + 'keylocation:location [prompt]:_files -P file\:// -W /' + 'keyformat:format:(raw hex passphrase)' + 'pbkdf2iters:iterations [350000]' +) + +ro_ds_props+=( $share_ro_properties ) +rw_ds_props+=( $share_rw_properties ) +ci_ds_props+=( $rw_ds_props ) + +ds_propnames=( ${rw_ds_props%%:*} ) +po_propnames=( ${ro_po_props%%:*} ${ci_po_props%%:*} ${rw_po_props%%:*} ) + + +case $service in + zfs|zpool) + _arguments -C -A "-*" \ + '-?[display usage information]' \ + '*::command:->subcmd' && return 0 + + if (( CURRENT == 1 )); then + _wanted commands expl "subcommand" compadd -a subcmds + return + fi + curcontext="${curcontext%:*}-$words[1]:" + ;; + zdb) + if [[ $implementation = openzfs ]]; then + args=( + '-mm[also display free space histogram associated with each metaslab]' + {-mmm,-MM}'[display more free space information]' + {-mmmm,-MMM}'[display every spacemap record]' + '-DD[display a histogram of deduplication statistics]' + '-DDD[display deduplication statistics independently for each table]' + '-DDDD[dump the contents of the deduplication tables describing duplicate blocks]' + '-DDDDD[also dump the contents of the deduplication tables describing unique blocks]' + '-E+[decode and display block from a given embedded block pointer]:word' + '(-l)-ll+[like -l but display L2ARC log blocks]:device:_files' + '(-l -ll)-lll+[like -l but display every configuration, unique or not]:device:_files' + "-q[don't print labels (with -l)]" + '-k[examine the checkpointed state of the pool]' + '-M[display the offset, spacemap, and free space of each metaslab]' \ + '-O+[look up the specified path inside of the dataset]:dataset:_zfs_dataset:path:_files' + '-o+[set the given global libzpool variable]:variable' + '-r+[copy the specified path inside of the dataset to the specified destination]:dataset:_zfs_dataset:path:_files:destination:_files' + '-x+[copy all blocks accessed to files in the specified directory]:directory:_directories' + '-V[attempt verbatim import]' + '-Y[attempt all possible combinations when reconstructing indirect split blocks]' + '-y[perform validation for livelists that are being deleted]' + ) + else + args=( + '-?[display usage information]' + '-M+[dump MOS contents]:contents: _values -s , raw_config all objset dir pool_props metaslab sync_bplist dtl config spares l2cache history errlog_scrub errlog_last bpmap-vdev bpmap_defer_obj dtl-scan ddt2' + '-r[dump datasets recursively]' + '-z[report zombies only]' + '-V[verify DDT xtree block data]' + "-a[don't import l2arc cache data]" + '-f[attempt to force import (with -e)]' + '-w+[specify directory to save shadow copy of all accessed disk locations]: :_directories' + '-x+[set kernel tunable]:tunable' + '-G[dump the contents of the zfs_dbgmsg buffer before exiting]' + '-I[limit the number of outstanding checksum I/Os to the specified value]' + ) + fi + _arguments -A "-*" -S $args \ + '(-C)-b[display block statistics]' \ + '(-C)*-c[verify checksum of metadata blocks]' \ + '(-b -c -d)-C[display configuration information]' \ + '(-C)*-d[display dataset information]' \ + '-h[display pool history]' \ + '-i[display intent log (ZIL) information]' \ + '-l+[read the vdev labels from the specified device]:device:_files' \ + '-m[display the offset, spacemap, and free space of each metaslab]' \ + '-s[report statistics on zdb I/O]' \ + '*-u[also display the uberblocks on the device (with -l)]' \ + '*-v[enable verbose output]' \ + '-D[display deduplication statistics]' \ + '-S[simulate the effects of deduplication, displaying constructed DDT as with -DD]' \ + '-L[disable leak detection and the loading of space maps]' \ + '-R+[read and display a block from the specified device]:device' \ + "-A[don't abort should any assertion fail]" \ + "-AA[enable panic recovery]" \ + '-F[try progressively older transactions until pool is readable]' \ + '-U+[specify cache file to use]:cache file [/etc/zfs/zpool.cache]:_files' \ + '-X[attempt "extreme" transaction rewind]' \ + '-e[operate on an exported pool]' \ + '-p[specify path under which to search for devices (with -e)]:path:_files' \ + '-P[use exact (parsable) numeric output]' \ + '-t+[specify the highest transaction to use when searching for uberblocks]:transaction' \ + '1:pool:_zfs_pool' + return + ;; +esac + +case $service:$words[1] in + zfs:create) + [[ $implementation = openzfs ]] && args=( + '-P[print machine-parsable verbose information about the created dataset]' + '-n[do a dry-run, no dataset will be created]' + '-v[print verbose information about the created dataset]' + ) + _arguments -C -A "-*" -S $args \ + '-p[create parent datasets]' \ + '*-o+[set initial propertyvalue]:property:->create-properties' \ + - set1 \ + ':filesystem:_zfs_dataset -t fs -e "parent dataset"' \ + - set2 \ + '-s[create sparse volume]' \ + '-b+[set volblocksize]: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes blocksize \:B {k,M,G,T,P,E,Z}{,B}' \ + '-V+[set size]: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size \:B {k,M,G,T,P,E,Z}{,B}' \ + ':volume:_zfs_dataset -t fs -e "parent dataset"' + ;; + + zfs:destroy) + if [[ $implementation = openzfs ]]; then + args=( + '-n[do a dry-run, no data will be deleted]' + '-p[print machine-parsable verbose information about the deleted data]' + '-v[print verbose information about the deleted data]' + ) + else + args=( '-s[destroy snapshots synchronously - only return when blocks freed]' ) + fi + _arguments -A "-*" -S $args \ + '-r[recursively destroy all children]' \ + '-R[recursively destroy all dependents]' \ + '(-f)-d[delete or mark deferred]' \ + '(-d)-f[force unmounts]' \ + ':dataset:_zfs_dataset -t fs -t vol ${=${opt_args[(i)-f]:--t snap}:/-f/} ${=${opt_args[(i)-*]:--t bookmark}:/-?/}' + ;; + + zfs:snap(|shot)) + _arguments -C -A "-*" -S \ + '-r[recursively snapshot all descendant datasets]' \ + '*-o+[set property]:property:->create-properties' \ + ':filesystem/volume:_zfs_dataset -t fs -t vol -S@' + ;; + + zfs:rollback) + _arguments -A "-*" -S \ + '-r[recursively destroy more recent snapshots]' \ + '-R[recursively destroy more recent snapshots and clones]' \ + '-f[force unmounts]' \ + ':snapshot:_zfs_dataset -t snap' + ;; + + zfs:clone) + [[ $implementation = solaris ]] && args+=( + '-K[create encryption key]' + ) + _arguments -C -A "-*" -S $args \ + '-p[create parent datasets]' \ + '*-o+[set property]:property:->create-properties' \ + ':snapshot:_zfs_dataset -t snap' \ + ':filesystem/volume:_zfs_dataset -t fs -e "parent dataset"' + ;; + + zfs:promote) + _arguments \ + ':filesystem:_zfs_dataset -t clone' \ + ;; + + zfs:rename) + [[ $implementation = openzfs ]] && args=( + '(-r -u)-f[force unmount any filesystems]' + "(-r -f)-u[don't remount file systems during rename]" + ) + _arguments -A "-*" -S $args \ + '(-r)-p[create parent datasets]' \ + '(-p -u -f)-r[recursively rename snapshots of all descendent datasets]' \ + ':dataset:_zfs_dataset -r1' \ + ':dataset:_zfs_dataset -r2' + ;; + + zfs:bookmark) + _arguments \ + ':snapshot or bookmark:_zfs_dataset -t snap -t bookmark' \ + ':bookmark' + ;; + + zfs:program) + _arguments -A "-*" -S \ + '-j[display channel program output in JSON format]' \ + '-n[execute a read-only channel program]' \ + '-t+[limit the number of Lua instructions to execute]:instruction limit' \ + '-m+[specify memory limit]:memory limit (bytes) [10MB]' \ + ':pool:_zfs_pool' \ + ':script:_files' \ + '*: :_default' + ;; + + zfs:list) + if [[ $implementation = solaris ]]; then + args=( '-I+[specify dataset states to display instead of normal datasets]:dataset state:_sequence compadd - receiving resumable hidden all' ) + else + args=( '-p[use exact (parsable) numeric output]' ) + fi + _arguments -A "-*" -S $args \ + '(-d)-r[recursively display children]' \ + '-H[suppress printing of headers]' \ + '(-r)-d+[depth]:value' \ + '-o+[specify properties to list]: :_values -s , "property" $ro_ds_props $ds_propnames' \ + '*-s+[specify sort key (ascending)]: :_values "property" $ro_ds_props $ds_propnames' \ + '*-S+[specify sort key (descending)]: :_values "property" $ro_ds_props $ds_propnames' \ + '-t+[specify dataset types to list]: :_values -s , "dataset type" $ds_types' \ + '*:filesystem/volume/snapshot/path:_zfs_dataset -p' + ;; + + zfs:set) + [[ $implementation = solaris ]] && args=( + '-r[recursively apply value]' \ + ) + _arguments -C -A "-*" -S $args \ + ':property:->set-properties' \ + '*:filesystem/volume:_zfs_dataset -t fs -t vol' + ;; + + zfs:get) + if [[ $implementation == openzfs ]]; then + args=( '-t+[specify dataset types to display]: :_values -s , "dataset type" $ds_types' ) + else + args=( '-e[expand property sublists to any depth]' ) + fi + _arguments -A "-*" -S $args \ + "(-d)-r[recursively display children's properties]" \ + '(-r)-d+[depth]:value' \ + '-H[suppress printing of headers]' \ + '-p[use exact (parsable) numeric output]' \ + '-s+[specify sources]: :_values -s , "source" local default inherited received temporary none' \ + '-o+[specify fields]: :_values -s , "field" name property received value source' \ + ':property:_values -s , "property" $ro_ds_props $ds_propnames all' \ + '*:filesystem/volume/snapshot:_zfs_dataset' + ;; + + zfs:inherit) + _arguments -C -A "-*" -S \ + '-r[recursively inherit property for all children]' \ + '-S[revert to received property value]' \ + ':property:_values "property" $ro_ds_props ${rw_ds_props%%:*}' \ + '*:filesystem/volume:_zfs_dataset -t fs -t vol' + ;; + + zfs:remap) + _arguments \ + ':filesystem or volume:_zfs_dataset -t fs -t vol' + ;; + + zfs:upgrade) + _arguments -A "-*" -S \ + '(- :)-v[display supported ZFS versions]' \ + '(-v :)-a[upgrade all filesystems on all pools]' \ + '(-v)-r[upgrade descendent filesystems, too]' \ + '(-v)-V+[upgrade to specified version]:version' \ + '(-a -v):filesystem:_zfs_dataset -t fs' + ;; + + zfs:(user|group)space) + args=( + '-n[print numeric ID]' + '-i[translate SID to POSIX ID]' + ) + ;& # fall-through + zfs:projectspace) + [[ $implementation = solaris ]] && args+=( + '(- *)'{-h,--help}'[display usage information]' + ) + _arguments -A "-*" -S $args \ + '-H[suppress printing of headers, tab-delimit columns]' \ + '-p[use exact (parsable) numeric output]' \ + '-o+[specify properties to list]:property:_values -s , "property" type name used quota' \ + '*-s+[specify sort key (ascending)]: :_values "property" type name used quota' \ + '*-S+[specify sort key (descending)]: :_values "property" type name used quota' \ + '-t+[specify types to list]:type:_values -s , "type" all posixuser smbuser posixgroup smbgroup' \ + '*:filesystem/volume/snapshot:_zfs_dataset' + ;; + + zfs:project) + _arguments -A "-*" -S \ + '(-r -C -k -p -s)-d[act on the directory project ID and inherit flag, not its children]' \ + '(-d)-r[act on subdirectories recursively]' \ + '(-0 -c -d -s)-C[clear project inherit flag and/or ID on the file(s) or directories]' \ + '(-0 -c -d -p -s)-k[keep the project ID unchanged]' \ + '(-k -C -s)-c[check project ID and inherit flag on the file(s) or directories]' \ + '(-k -C -s)-0[print file name with a trailing NUL instead of newline]' \ + '(-k)-p+[specify project ID]:project ID' \ + '(-0 -c -k -C)-s[set project inherit flag on the given file(s) or directories]' \ + '*:file:_files' + ;; + + zfs:mount) + [[ $OSTYPE != freebsd* ]] && args=( '-O[overlay mount]' ) + [[ $implementation = openzfs ]] && args+=( + '-l[load keys for encrypted filesystems as they are being mounted]' + ) + _arguments -A "-*" -S $args \ + '-o+[specify temporary file system options]: :_values -s , "option" {,no}{atime,dev,exec,relatime,suid,xattr} ro rw' \ + '-v[report mount progress]' \ + '-f[force mount]' \ + '(:)-a[mount all available ZFS filesystems]' \ + '(-a):filesystem:_zfs_dataset -t fs' + ;; + + zfs:u(|n)mount) + [[ $implementation = openzfs ]] && args+=( + '-u[unload keys for any unmounted encryption roots]' + ) + _arguments -A "-*" -S $args \ + '-f[force unmount]' \ + '(:)-a[unmount all ZFS filesystems]' \ + '(-a):dataset or mountpoint:_zfs_dataset -t fs -t mtpt' + ;; + + zfs:share) + [[ $implementation = solaris ]] && args=( + - set2 \ + '-r[share filesystems recursively]' \ + ':dataset:_zfs_dataset -t fs' \ + - set3 \ + '*-o+[create a share with specified properties]: :_values -w "share properties" $share_rw_properties' \ + '-u[create a share without sharing it]' \ + ':dataset:_zfs_dataset -t fs' \ + ) + _arguments -A "-*" -S \ + - set1 \ + '-a[share all available ZFS filesystems]' \ + $args \ + - set4 \ + ':dataset or mountpoint:_zfs_dataset -t fs -t mtpt -t share' + ;; + + zfs:unshare) + [[ $implementation = solaris ]] && args=( + - set2 + '-r[unshare filesystems recursively]' + ':filesystem:_zfs_dataset -t fs' + ) + _arguments -A "-*" -S $args \ + - set1 \ + '-a[unshare all shared ZFS filesystems]' \ + - set3 \ + ':filesystem:_zfs_dataset -t fs -t mtpt -t share' + ;; + + zfs:send) + if [[ $implementation = openzfs ]]; then + args=( + '(-L --large-block)'{-L,--large-block}'[generate a stream which may contain blocks larger than 128KB]' + '(-P --parsable)'{-P,--parsable}'[print machine-parsable verbose information about the stream generated]' + '(-e --embed)'{-e,--embed}'[more compact stream for blocks stored with the embedded_data feature]' + '(-c --compressed)'{-c,--compressed}'[more compact stream for compressed blocks]' + '(-h --holds)'{-h,--holds}'[send snapshot holds]' + '-V[set the process title to a per-second report of how much data has been send]' + '-t[create a send stream that resumes an interrupted receive]:resume token' + '(-w --raw)'{-w,--raw}'[keep encrypted data exactly as it exists on disk]' + - redact + '(-h -V -t -w --raw)--redact[generate a redacted send stream]' + - saved + '(-S --saved)'{-S,--saved}'[generate stream from partially received dataset]' + ) + else + args=( + '-w+[send compressed filesystem blocks as compressed in the stream]:compression:(compress none)' + '-m+[limit amount of memory used by deduplication processing]: :_numbers -u bytes "memory size" K M G' + '-s+[set stream options]:token:(streamsize check nocheck memsize)' + '-C[read a receive checkpoint from stdin]' + '-c[create a self-contained stream]' + '(-R)-r[generate a recursive stream package]' + ) + fi + _arguments -A "-*" -S \ + '-b[send only received property values]' \ + '(-I)-i[generate an incremental stream]:snapshot:_zfs_dataset -t snap' \ + '-D[perform dedup processing]' \ + "-n[don't send the stream]" \ + '-p[send properties]' \ + '-v[verbose]' \ + '(-i)-I[generate an incremental stream with intermediary snapshots]:snapshot:_zfs_dataset -t snap' \ + '(-r)-R[generate a replication stream package]' \ + ':snapshot:_zfs_dataset -t snap -t bookmark' \ + $args + ;; + + zfs:redact) + _arguments \ + ':snapshot:_zfs_dataset -t snap' \ + ':bookmark:_zfs_dataset -t bookmark' \ + ':redaction snapshot:_zfs_dataset -t snap' + ;; + + zfs:(receive|recv)) + if [[ $implementation = openzfs ]]; then + args=( + '-h[skip the receive of holds]' + '-s[if the receive is interrupted, save the partially received state]' + '(- set2)-A[abort an interrupted zfs recv -s, deleting its saved partially received state]' + ) + [[ $OSTYPE != linux* ]] && args+=( + '-M[force an unmount of the file system while receiving a snapshot]' + ) + else + args=( '(-)-C[write a receive checkpoint to stdout]' ) + fi + _arguments -A "-*" -S $args \ + '-v[verbose]' \ + "-n[don't receive the stream]" \ + '-F[force a rollback if necessary]' \ + '-u[filesystem is not mounted]' \ + '-o[include property change in the stream]:property' \ + '-x[exclude property change from the stream]:property' \ + - set1 \ + ':filesystem/volume/snapshot:_zfs_dataset' \ + - set2 \ + '(-e)-d[set path prefix from stream, excluding only pool name]' \ + '(-d)-e[set path prefix from stream, using last path element]' \ + ':filesystem:_zfs_dataset -t fs' + ;; + + zfs:allow) + _arguments -C -A "-*" -S \ + '(-g -e -c -s)-u[delegate to user]' \ + '(-u -e -c -s)-g[delegate to group]' \ + '(1 -g -u -c -s)-e[delegate to everyone]' \ + '(1 -u -g -e -l -d -s)-c[set permissions for newly-created descendant filesystems]' \ + '(-u -g -e -l -d -c)-s[define or modify permission sets]:permission set' \ + '(-c -s)-l[allow for named dataset]' \ + '(-c -s)-d[allow for descendent datasets]' \ + '1: :->first' \ + ':permission list:_values -s , "permission or set" $delegatable_perms' \ + ':filesystem/volume:_zfs_dataset -t fs -t vol' + + if [[ -n $state ]]; then + case $opt_args[(I)-[ugs]] in + ^-[ug]) alts+=( 'permission-sets: :_guard "(|@*)" "permission set"' ) ;| + ^-[gs]) alts+=( 'users:user:_users' ) ;| + ^-[us]) alts+=( 'groups:group:_groups' ) ;| + '') + alts+=( + 'all:everyone:(everyone)' + 'filesystems:filesystem/volume:_zfs_dataset -t fs -t vol' + ) + ;; + esac + _alternative $alts + fi + ;; + + zfs:unallow) + _arguments -A "-*" -S \ + '-r[recursive removal]' \ + '(-e -g -s -c)-u[user]' \ + '(-e -u -s -c)-g[group]' \ + '(1 -g -u -s -c)-e[everyone]' \ + '(1 -u -g -e -s -l -d)-c[create-time permissions]' \ + '(-e -u -g -c)-s[remove permissions from or delete a permission set]:permission set' \ + '(-c -s)-l[allow for named dataset]' \ + '(-c -s)-d[allow for descendent datasets]' \ + '1: :->first' \ + '::permissions or sets:_values -s , "permission or set" $delegatable_perms' \ + ':filesystem/volume:_zfs_dataset -t fs -t vol' + + if [[ -n $state ]]; then + case $opt_args[(I)-[ugs]] in + ^-[ug]) alts+=( 'permission-sets: :_guard "(|@*)" "permission set"' ) ;| + ^-[gs]) alts+=( 'users:user:_users' ) ;| + ^-[us]) alts+=( 'groups:group:_groups' ) ;| + '') alts+=( 'all:everyone:(everyone)' ) ;; + esac + _alternative $alts + fi + ;; + + zfs:hold) + _arguments -A "-*" -S \ + '-r[apply hold recursively]' \ + ':tag' \ + ':snapshot:_zfs_dataset -t snap' + ;; + + zfs:holds) + [[ $implementation = openzfs ]] && args=( + '-H[suppress printing of headers, tab-delimit columns]' + ) + [[ $OSTYPE = freebsd<-12>.* ]] && args+=( + # features were lost with the openzfs rebase + '-p[use exact (parsable) numeric output]' + '(-r)-d+[depth]:value' + ) + _arguments -A "-*" -S $args \ + '(-d)-r[list holds recursively]' \ + ':snapshot:_zfs_dataset -t snap' + ;; + + zfs:release) + _arguments -A "-*" -S \ + '-r[release holds recursively]' \ + ':tag' \ + ':snapshot:_zfs_dataset -t snap' + ;; + + zfs:diff) + [[ $implementation = solaris ]] && args=( + '(-E)-e[only show new and changed files, no deleted]' + '*-o+[show specified fields]:field:_values "field" $difffields' + '-q[silence warnings for missing snapshots on recursive datasets]' + '-N[enumerate new child datasets (with -r)]' + '(1 -e)-E[show difference from empty]' + ) + _arguments -A "-*" -S $args \ + '-F[add column for filetype character, similar to ls(1)]' \ + '-H[suppress printing of headers and arrows, tab-delimit columns]' \ + '-t[add column for ctime]' \ + '(-E)1:snapshot:_zfs_dataset -t snap' \ + '2:snapshot or filesystem:_zfs_dataset -t snap -t fs' + ;; + + zfs:wait) + _arguments -A "-*" -S \ + '-t[specify background activity]:activity:(deleteq)' \ + ':filesystem:_zfs_dataset' + ;; + + zfs:key) + _arguments -C -A "-*" -S \ + '-t+[only apply to given dataset type]: :_values -s , "dataset type" $ds_types' \ + '(-u -c -K -f -o)-l[load the encryption key]' \ + "(-u -c -K -f -o)-M[don't mount file systems after loading their keys]" \ + "(-u -c -K -f -o)-S[don't share file systems after loading their keys]" \ + '(-l -c -K -o -M -S)-u[unload the encryption key]' \ + '(-l -c -K -o -M -S)-f[force unmount the dataset before unloading the encryption key]' \ + '(-l -u -K -f -M -S)-c[change the encryption key]' \ + '(-l -u -K -f -M -S)-o+[change a property]:property:->keysources' \ + '(-l -c -u -f -o -M -S)-K[create a new data encryption key]' \ + '(1 -r)-a[apply to all datasets in all pools]' \ + '(-a)-r[apply recursively]' \ + ':filesystem or volume:_zfs_dataset -t fs -t vol' + ;; + + zfs:load-key) + _arguments -A "-*" -S \ + "-L+[specify location of user's encryption key]:key location [prompt]:_files -P file\:// -W /" \ + '(:)-a[load keys for all encryption roots in all imported pools]' \ + '-n[do a dry-run, simply check that the provided key is correct]' \ + '-r[load keys for datasets recursively]' \ + '(-a):filesystem or volume:_zfs_dataset -t fs -t vol' + ;; + + zfs:unload-key) + _arguments -A "-*" -S \ + '(:)-a[unload keys for all encryption roots in all imported pools]' \ + '-r[unload keys for datasets recursively]' \ + '(-a):filesystem or volume:_zfs_dataset -t fs -t vol' + ;; + + zfs:change-key) + _arguments -A "-*" -S \ + '(-o)-i[make filesystem inherit key from its parent]' \ + '-l[ensure key is loaded before attempting to change it]' \ + '(-i)*-o+[change encryption key property]: :_values -s , "property" $key_properties' \ + ':filesystem or volume:_zfs_dataset -t fs -t vol' + ;; + + zfs:jail|zfs:unjail) + _arguments \ + '1: : _jails' \ + '2:filesystem:_zfs_dataset -t fs' + ;; + + zfs:help) + _arguments -A "-*" -S \ + - set1 \ + ':command:($subcmds $delegatable_perms $ro_ds_props ${rw_ds_props%%:*} properties)' \ + - set2 \ + '(2)-l[display property information]' \ + ':help topic:(property)' \ + ':property:($delegatable_perms $ro_ds_props ${rw_ds_props%%:*})' + ;; + + zpool:help) + _arguments -A "-*" -S \ + - commands \ + ':command:($subcmds)' \ + - properties \ + '(2)-l[display property information]' \ + ':help topic:(property)' \ + ':property:(${po_propnames%%\[*})' + ;; + + zpool:add) + if [[ $implementation = openzfs ]]; then + args=( + '-g[display vdev, GUIDs instead of the normal device names]' + '-L[display real paths for vdevs resolving all symbolic links]' + '-o+[set given pool properties]: :_values -s , "property" "${(@M)ci_po_props\:#ashift*}"' \ + '-P[display real paths for vdevs instead of only the last component of the path]' + ) + elif [[ $implementation = solaris ]]; then + args=( '-l[display configuration in /dev/chassis location form]' ) + fi + _arguments -A "-*" -S $args \ + '-f[force use of in-use devices]' \ + '-n[display configuration without modifying pool]' \ + ':pool:_zfs_pool' \ + '*:virtual device:->virtual-devices' + ;; + + zpool:attach) + if [[ $implementation = openzfs ]]; then + args=( + '-w[wait until new device has finished resilvering before returning]' + '-s[reconstruct sequentially to restore redundancy as quickly as possible]' + '-o+[set given pool properties]: :_values -s , "property" "${(@M)ci_po_props\:#ashift*}"' + ) + fi + _arguments -A "-*" -S $args \ + '-f[force attach, even if in use]' \ + ':pool:_zfs_pool' \ + ':virtual device:->pool-devices' \ + ':virtual device:->disk-devices' + ;; + + zpool:checkpoint) + _arguments -A "-*" -S \ + '(-d --discard)'{-d,--discard}'[discard an existing checkpoint from the pool]' \ + '(-w --wait)'{-w,--wait}'[wait until the checkpoint has finished being discarded before returning]' \ + ':pool:_zfs_pool' + ;; + + zpool:clear) + [[ $implementation = solaris ]] && args=( + '-f[ignore fmadm acquit and fmadm repair failures]' + ) + _arguments -C -A "-*" -S $args \ + '-F[discard transactions to allow pool opening]' \ + '-n[with -F, check if discarding transactions would work]' \ + '-X[(undocumented) extreme rewind of transactions]' \ + ':pool:_zfs_pool' \ + '*:virtual device:->pool-devices' + ;; + + zpool:create) + if [[ $implementation = openzfs ]]; then + args=( + "-d[don't enable any features on the new pool]" + ) + else + args=( + '-B[create EFI boot partition on whole disks]' + '-l[display configuration in /dev/chassis location form]' + "-N[create pool but don't mount or share]" + ) + fi + _arguments -C -A "-*" -S $args \ + '-o+[set pool property at creation time]:property:->newpool-properties' \ + '-O+[set dataset property at creation time]:property:->create-properties' \ + '-f[force use of in-use devices]' \ + '-n[display configuration without creating pool]' \ + '-R+[use alternate root]:alternate root:_directories' \ + '-m+[set mountpoint for root dataset]:mountpoint' \ + '-t+[use a temporary pool name]:pool name' \ + ':pool :_guard "^-*" "pool name"' \ + '*: :->virtual-devices' + ;; + + zpool:destroy) + _arguments -A "-*" -S \ + '-f[force active datasets to be unmounted]' \ + ':pool:_zfs_pool' + ;; + + zpool:detach) + _arguments -C \ + ':pool:_zfs_pool' \ + ':virtual device:->pool-devices' + ;; + + zpool:events) + _arguments -A "-*" -S \ + '(- 1)-c[clear all previous events]' \ + '-f[follow mode - continue running, showing new events]' \ + '-H[suppress headers and tab-delimit fields]' \ + '-v[print the entire payload for each event]' \ + '(-c)1:pool:_zfs_pool' + ;; + + zpool:export) + [[ $implementation = openzfs ]] && args=( '(*)-a[export all pools]' ) + _arguments -A "-*" -S $args \ + '-f[forcefully unmount all datasets]' \ + '*:pool:_zfs_pool' + ;; + + zpool:get) + [[ $implementation = solaris ]] && args=( + '-s+[specify sources to display]: :_values -s "source" local default none' + ) + _arguments -A "-*" -S $args \ + '-H[suppress headers and tab-delimit fields]' \ + '-p[display numbers in parseable (exact) values]' \ + '-o+[specify fields to display]: : _values -s , field name property value source' \ + ':property:_values -s , "property" $po_propnames' \ + '*:pool:_zfs_pool' + ;; + + zpool:history) + _arguments -A "-*" -S \ + '-i[display internal events]' \ + '-l[long format]' \ + '*:pool:_zfs_pool' + ;; + + zpool:import) + # TODO: -o should complete mount options, too + if [[ $implementation = openzfs ]]; then + args=( + '-t[new pool name is temporary]' + '-l[request encryption keys for all encrypted datasets]' + '--rewind-to-checkpoint[rewind pool to the checkpointed state]' + '-s[scan using the default search path]' + '(-F -X)-T[specify the txg to use for rollback]' + ) + else + args=( + '(-a)-t+[use a temporary pool name]:pool name' + '-l[display configuration in /dev/chassis location form]' + ) + fi + _arguments -C -A "-*" -S $args \ + '(1 2 -t)-a[search for and import all pools found]' \ + '-D[destroyed pools only]' \ + '(-d)*-c+[use cache file]:cache file:_files' \ + '(-c -D)*-d+[search for devices or files in directory]:directory:_files -/' \ + '-F[recovery mode: discard transactions if required]' \ + '-X[(undocumented) extreme rewind of transactions]' \ + '!-V' \ + '-f[force import]' \ + '-m[ignore missing log devices]' \ + '-N[import pool without mounting any filesystems]' \ + "-n[with -F; don't perform input]" \ + '-R+[specify alternate root]:alternate root:_files -/' \ + '-o+[set pool or dataset property]:property:->import-properties' \ + '1:pool name or id:_zfs_pool' \ + '2::new pool name' + ;; + + zpool:initialize) + _arguments -A "-*" -S \ + '(-s --suspend -c --cancel)'{-c,--cancel}'[cancel initializing on specified devices]' \ + '(-s --suspend -c --cancel)'{-s,--suspend}'[suspend initializing on specified devices]' \ + '(-w --wait)'{-w,--wait}'[wait until devices have finished initializing before returning]' \ + ':pool:_zfs_pool' \ + '*:device:pool-devices' + ;; + + zpool:iostat) + if [[ $implementation = openzfs ]]; then + args=( + '-c[run scripts on each vdev]:script:_files -W "($ZPOOL_SCRIPTS_PATH /etc/zfs/zpool.d ~/.zpool.d)"' + '-g[display vdev GUIDs instead of normal device names]' + '-H[suppress headers and tab-delimit fields]' + '-L[display real paths for vdevs resolving all symbolic links]' + '-n[print headers only once]' + '-p[display numbers in parsable (exact) values and times in nanoseconds]' + '-P[display full paths for vdevs instead of only the last component of the path]' + "-r[print request size histograms for the leaf vdev's IO]" + '-y[omit statistics since boot]' + '-w[display latency histograms]' + '-l[include average latency statistics]' + '-q[include active queue statistics]' + ) + else + args=( '-l[display configuration in /dev/chassis location form]' ) + fi + _arguments -A "-*" -S $args \ + '-T+[display a timestamp]:format:((d\:standard u\:internal))' \ + '-v[verbose statistics]' \ + '*::pool:_zfs_pool' \ + '::interval' \ + '::count' + ;; + + zpool:label) + _arguments -C -A "-*" -S \ + '(-c)*-d+[specify path in which to search for devices or files]:path:_directories' \ + '(-d)-c+[read configuration from specified cache file]:cache file:_files' \ + '(-R)-C[clear ZFS metadata on an inactive pool or device]' \ + '(-C)-R[recover ZFS metadata for a pool]' \ + '1::pool:_zfs_pool' \ + '2:device:->pool-devices' + ;; + + zpool:labelclear) + _arguments -A "-*" -S \ + '-f[treat exported or foreign devices as inactive]' \ + '*:virtual device:_files' + ;; + + zpool:list) + [[ $implementation = openzfs ]] && args=( + '-g[display vdev GUIDs instead of normal device names]' + '-L[display real paths for vdevs resolving all symbolic links]' + '-p[display numbers in parsable (exact) values]' + '-P[display full paths for vdevs instead of only the last component of the path]' + '-v[report usage statistics for individual vdevs within the pool]' + ) + _arguments -A "-*" -S $args \ + '-H[suppress headers and tab-delimit fields]' \ + '-T+[display a timestamp]:format:((d\:standard u\:internal))' \ + '-o+[specify fields to list]: :_values -s , "field" $po_propnames' \ + '::pool:_zfs_pool' + ;; + + zpool:monitor) + _arguments -A "-*" -S \ + '-t+[specify provider]:provider:(send receive scrub resilver ddtmigrate destroy)' \ + '-o+[specify fields]: :_values -s , field done other pctdone pool provider speed starttime tag timeleft timestmp total' \ + '-T+[display a timestamp]:format:((d\:standard u\:internal))' \ + '-p[use machine-parseable output format]' \ + '1:pool:_zfs_pool' \ + '2:interval' \ + '3:count' + ;; + + zpool:offline) + [[ $implementation = openzfs ]] && args=( + '-f[force disk into faulted state]' + ) + _arguments -C -A "-*" -S $args \ + '-t[offline until next reboot]' \ + ':pool:_zfs_pool' \ + '*:virtual device:->pool-devices' + ;; + + zpool:online) + _arguments -C -A "-*" -S \ + '-e[expand device to use all available space]' \ + ':pool:_zfs_pool' \ + '*:virtual device:->pool-devices' + ;; + + zpool:reopen) + _arguments -A "-*" -S \ + "-n[don't restart an in-progress scrub operation]" \ + '1:pool:_zfs_pool' + ;; + + zpool:reguid) + _zfs_pool + ;; + + zpool:remove) + [[ $implementation = openzfs ]] && args=( + '(-s)-w[wait until removal has completed before returning]' + ) + _arguments -C -A "-*" -S $args \ + "(-s)-n[don't perform the removal, display mapping table memory use]" \ + '(-s)-p[with -n, display numbers in parseable (exact) values]' \ + '(- *)-s[stop and cancel an in-progress removal]' \ + '1:pool:_zfs_pool' \ + '*:device:->pool-devices' + ;; + + zpool:replace) + [[ $implementation = openzfs ]] && args=( + '-w[wait until replacement has completed before returning]' + '-s[reconstruct sequentially to restore redundancy as quickly as possible]' + '-o+[set given pool properties]: :_values -s , "property" "${(@M)ci_po_props\:#ashift*}"' + ) + _arguments -A "-*" -S $args \ + '-f[force attach, even if in use]' \ + ':pool:_zfs_pool' \ + ':virtual device:_files' \ + '::virtual device:_files' + ;; + + zpool:(resilver|sync)) + _arguments \ + '*:pool:_zfs_pool' + ;; + + zpool:scrub) + [[ $implementation = openzfs ]] && args=( + '(-s)-p[pause scrubbing]' + '-w[wait until scrub has completed before returning]' + ) + _arguments -A "-*" -S $args \ + '(-p)-s[stop scrubbing]' \ + '*:pool:_zfs_pool' + ;; + + zpool:set) + _arguments -C -A "-*" -S \ + ':property:->set-pool-properties' \ + '*:pool:_zfs_pool' + ;; + + zpool:split) + if [[ $implementation = solaris ]]; then + args=( '-l[display configuration in /dev/chassis location form]' ) + else + args=( + '-g[display vdev GUIDs instead of normal device names]' + '-L[display real paths for vdevs resolving all symbolic links]' + '-l[request encryption keys for encrypted datasets]' + '-P[display full paths for vdevs instead of only the last component of the path]' + ) + fi + _arguments -C -A "-*" -S $args \ + '-R+[specify alternate root]:alternate root:_files -/' \ + '-n[display configuration without splitting]' \ + '-o+[set pool or dataset property]:property:->import-properties' \ + ':pool name or id:_zfs_pool' \ + ':new pool name' \ + '*:virtual device:->pool-devices' + ;; + + zpool:status) + if [[ $implementation = openzfs ]]; then + args=( + '-D[display a histogram of deduplication statistics]' + '-c[run scripts on each vdev]:script:_files -W "($ZPOOL_SCRIPTS_PATH /etc/zfs/zpool.d ~/.zpool.d)"' + '-i[display vdev initialization status]' + '-g[display vdev GUIDs instead of the normal device names]' + '-L[display real paths for vdevs resolving all symbolic links]' + '-p[display numbers in parsable (exact) values and times in nanoseconds]' + '-P[display full paths for vdevs instead of only the last component of the path]' + '-s[display the number of leaf VDEV slow IOs]' + '-t[display vdev TRIM status]' + ) + else + args=( '-l[display configuration in /dev/chassis location form]' ) + fi + _arguments -A "-*" -S $args\ + '-v[verbose information]' \ + '-x[show only unhealthy pools]' \ + '-T+[display a timestamp]:format:((d\:standard u\:internal))' \ + '*::pool:_zfs_pool' \ + ':: :_guard "[0-9]#" interval' \ + ':: :_guard "[0-9]#" count' + ;; + + zpool:trim) + _arguments -C -A "-*" -S \ + '(-d --secure)'{-d,--secure}'[initiate a secure TRIM]' \ + '(-r --rate)'{-r,--rate}'[set rate at which the TRIM operation progresses]:rate (bytes per second)' \ + '(-c --cancel)'{-c,--cancel}'[cancel trimming]' \ + '(-s --suspend)'{-s,--suspend}'[suspend trimming]' \ + '(-w --wait)'{-w,--wait}'[wait until devices are done being trimmed]' \ + '1:pool:_zfs_pool' \ + '*:device:->pool-devices' + ;; + + zpool:upgrade) + _arguments -A "-*" -S \ + '(- *)-v[display ZFS versions and descriptions]' + "(-v)-V+[upgrade to given version]:version" \ + '(-v *)-a[upgrade all pools]' \ + '(-a -v)*:pool:_zfs_pool' + ;; + + zpool:wait) + _arguments -A "-*" -S \ + '-H[suppress printing of headers, tab-delimit columns]' \ + '-P[use exact (parsable) numeric output]' \ + '-t+[specify background activity]: : _values -s , activity discard free initialize replace remove resilver scrub trim' \ + '-T+[display a timestamp]:format:((d\:standard u\:internal))' \ + ':pool:_zfs_pool' \ + ':interval' + ;; + + *) + _default + ;; +esac + +while (( $#state )); do + curstate=$state + state=() + case $curstate in + virtual-devices) + local -a vdevtypes + vdevtypes=( mirror raidz{,1,2,3} spare log cache ) + if [[ $implementation = openzfs ]]; then + vdevtypes+=( draid{,1,2,3} dedup special ) + else + vdevtypes+=( meta ) + fi + # cache can't be a mirror + [[ $words[CURRENT-1] != cache ]] && alts=( + 'vdev-types:vdev type:compadd -a vdevtypes' + ) + [[ -prefix / ]] || alts+=( + 'disk-vdevs:disk vdev:_files -g "*(-%)" -W /dev' + ) + _alternative $alts 'file-vdevs:file vdev:_files -W / -P /' + ;; + + pool-devices) + local -a devices + devices=( ${${${(M)${(f)"$(_call_program devices zpool status $line[1])"}:#$'\t' *}##[[:blank:]]#}%%[[:blank:]]*} ) + if (( $#devices )); then + _description devices expl "$state_descr" + compadd "$expl[@]" -a devices + break + fi + ;& # fall-through if we found none + + disk-devices) + [[ -prefix / ]] || alts=( + 'disk-vdevs:disk vdev:_files -g "*(-%)" -W /dev' + ) + _alternative $alts 'file-vdevs:file vdev:_files -W / -P /' + ;; + + keysources) + local -a suf + + compset -S ",*" || suf=(-S ,) + if compset -P 1 "*,"; then + _alternative \ + 'zfs-keylocator-prompt:"prompt" locator:(prompt)' \ + 'zfs-keylocator-file:file locator:_files' \ + 'zfs-keylocator-pkcs11: : _message -e zfs-keylocator-pkcs11 "PKCS#11 locator"' \ + 'zfs-keylocator-https: : _message -e zfs-keylocator-https "HTTPS URL locator"' + else + _description keysource-formats expl "keysource format" + compadd $suf -q "$expl[@]" "$@" raw hex passphrase + fi + ;; + + quotas) + _alternative \ + 'sizes: :_numbers -M "m:{a-zA-Z}={A-Za-z}" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' \ + 'properties:property:(none)' + ;; + + import-properties) args=( $ci_ds_props $rw_ds_props $ci_po_props ) ;| + create-properties) args=( $ci_ds_props ) ;| + set-properties) args=( $rw_ds_props ) ;| + newpool-properties) args=( $rw_po_props $ci_po_props ) ;| + set-pool-properties) args=( $rw_po_props ) ;| + + *-properties) + if compset -P 1 '(#m)*@'; then + if compset -P 1 '*='; then + case $MATCH in + *quota@) _alternative \ + 'sizes: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size \:B {k,M,G,T,P,E,Z}{,B}' \ + 'properties:property:(none)' + ;; + esac + else + case $MATCH in + user*@) _users -S = ;; + group*@) _groups -S = ;; + project*@) _message -e projects project ;; + esac + fi + else + _wanted values expl "$state_descr" compadd -S@ ${${(M)args:#*@}%@} + _values -C "$state_descr" ${args:#*@} + fi + ;; + esac +done + +[[ nm -ne "$compstate[nmatches]" ]] diff --git a/Completion/Unix/Command/_zpool b/Completion/Unix/Command/_zpool deleted file mode 100644 index d9c2caa52..000000000 --- a/Completion/Unix/Command/_zpool +++ /dev/null @@ -1,311 +0,0 @@ -#compdef zpool -# Synced with the S11U1 man page - -_zpool() { - local context state line expl implementation - local -a subcmds fields ro_props rw_props versions create_properties_dataset - - _pick_variant -r implementation -c 'zpool upgrade -v' openzfs='This system supports ZFS pool feature flags' solaris - - subcmds=( - create destroy add remove list iostat status online - offline clear attach detach replace scrub import export - upgrade history get set split help - ) - - if [[ $implementation = openzfs ]] && [[ $OSTYPE != solaris* ]]; then - subcmds+=( labelclear initialize ) - fi - - versions=( - ${${${(M)"${(f)$(_call_program versions zpool upgrade -v)}":#[[:space:]]#<->*}##[[:space:]]}%%[[:space:]]*} - ) - - ro_props=( - "all[All properties]" - "allocated[Space allocated]" - "capacity[Space used (percentage)]" - "dedupratio[Deduplication ratio]" - "free[Space unallocated]" - "guid[Unique identifier]" - "health[Health status]" - "size[Total size]" - ) - - rw_props=( - "altroot[Alternate root directory]:value:" - "autoexpand[Automatic pool expansion]:value:(on off)" - "autoreplace[Automatic device replacement]:value:(on off)" - "bootfs[Default bootable dataset]:value:" - "cachefile[Pool configuration cache file location]:value:" - "dedupditto[Threshold for number of copies]:value:" - "delegation[Delegated administration]:value:(on off)" - "failmode[Failure-mode behavior]:value:(wait continue panic)" - "listshares[Show shares in 'zfs list']:value:(on off)" - "listsnaps[Show snapshots in 'zfs list']:value:(on off)" - "readonly[Controls whether the pool can be modified]:value:(on off)" - "version[Pool version]:version:($versions)" - ) - - fields=( ${ro_props%%:*} ${rw_props%%:*} ) - - create_properties_dataset=( - "aclinherit:value:(discard noallow restricted passthrough passthrough-x)" - "aclmode:value:(discard mask passthrough)" - "atime:value:(on off)" - "canmount:value:(on off noauto)" - "checksum:value:(on off fletcher2 fletcher4 sha256 sha256+mac)" - "compression:value:(on off lzjb gzip gzip-{1..9} zle)" - "copies:value:(1 2 3)" - "dedup:value:(on off verify sha256 sha256,verify)" - "devices:value:(on off)" - "encryption:value:(off on aes128-ccm aes-192-ccm aes-256-ccm aes-128-gcm aes-192-gcm aes-256-gcm)" - "exec:value:(on off)" - "groupquota@:value:" # TODO: complete group=size|none - "keysource:value:_zfs_keysource_props" - "logbias:value:(latency throughput)" - "mlslabel:value:(none)" # TODO: list sensitivity labels - "mountpoint:path, 'legacy', or 'none':{if [[ -prefix /* ]]; then _path_files -/; else _wanted mountpoints expl 'mountpoint (type \"/\" to start completing paths)' compadd legacy none; fi}" - "nbmand:value:(on off)" - "primarycache:value:(all none metadata)" - "quota:number or 'none':{if [[ -prefix [0-9]## ]]; then _message -e 'number'; elif [[ $PREFIX == quota= ]]; then _wanted none expl 'number or none' compadd none; else _wanted none expl 'quota' compadd none; fi}" - "readonly:value:(on off)" - "recordsize:value:(512 1K 2K 4K 8K 16K 32K 64K 128K 256K 512K 1M)" - "refquota:number or 'none':{if [[ -prefix [0-9]## ]]; then _message -e 'number'; elif [[ $PREFIX == refquota= ]]; then _wanted none expl 'number or none' compadd none; else _wanted none expl 'refquota' compadd none; fi}" - "refreservation:number or 'none':{if [[ -prefix [0-9]## ]]; then _message -e 'number'; elif [[ $PREFIX == refreservation= ]]; then _wanted none expl 'number or none' compadd none; else _wanted none expl 'refreservation' compadd none; fi}" - "reservation:value:{if [[ -prefix [0-9]## ]]; then _message -e 'number'; elif [[ $PREFIX == reservation= ]]; then _wanted none expl 'number or none' compadd none; else _wanted none expl 'reservation' compadd none; fi}" - "rstchown:value:(on off)" - "secondarycache:value:(all none metadata)" - "setuid:value:(on off)" - "shadow:value:" # TODO: complete URI|none - "share:share properties:" - "sharenfs:value:(on off)" - "sharesmb:value:(on off)" - "snapdir:value:(hidden visible)" - "sync:value:(standard always disabled)" - "userquota@:value:" # TODO: complete user=size|none - "version:value:(1 2 3 4 current)" - "volsize:value:" # <size> - "vscan:value:(on off)" - "xattr:value:(on off)" - "zoned:value:(on off)" - ) - - if [[ $service == "zpool" ]]; then - _arguments -C \ - '-\?[show help information]' \ - '1:subcommand:compadd -a subcmds' \ - '*:: :->subcmd' && return - - service="$words[1]" - curcontext="${curcontext%:*}-$service:" - fi - - case $service in - (help) - _arguments -A "-*" \ - - set1 \ - ':command/property:($subcmds ${fields%%\[*} properties)' \ - - set2 \ - '-l[Display property information]' \ - ': :(properties)' - ;; - - (clear) - _arguments -A "-*" \ - '-F[Discard transactions to allow pool opening]' \ - '-f[Ignore fmadm acquit and fmadm repair failures]' \ - '-n[With -F, check if discarding transactions would work]' \ - ':pool name:_zfs_pool' \ - '*:virtual device:_files' - ;; - - (create) - # TODO: investigate better vdev handling - _arguments -A "-*" \ - '-B[Create EFI boot partition on whole disks]' \ - '-o[Set pool property at creation time]:property:_values -s , "property" $rw_props' \ - '-O[Set dataset property at creation time]:property:_values -s , "property" $create_properties_dataset' \ - '-f[Force use of in-use devices]' \ - '-l[Display configuration in /dev/chassis location form]' \ - '-n[Display configuration without creating pool]' \ - '-R[Use alternate root]:alternate root:_files -/' \ - '-m[Set mountpoint for root dataset]:mountpoint:' \ - ':pool name:' \ - '*:virtual device:_files' - ;; - - (destroy) - _arguments -A "-*" \ - '-f[Force active datasets to be unmounted]' \ - ':pool name:_zfs_pool' - ;; - - (add) - _arguments -A "-*" \ - '-f[Force use of in-use devices]' \ - '-l[Display configuration in /dev/chassis location form]' \ - '-n[Display configuration without modifying pool]' \ - ':pool name:_zfs_pool' \ - '*:virtual device:_files' - ;; - - (list) - _arguments \ - '-H[Scripted mode]' \ - '-T[timestamp]:value:(u d)' \ - '-o[Fields to list]:field:_values -s , "field" $fields' \ - '::pool name:_zfs_pool' - ;; - - (initialize) - _arguments -A "-*" \ - '(-c --cancel)'{-c,--cancel}'[cancel initializing on specified devices]' \ - '(-s --suspend)'{-s,--suspend}'[suspend initializing on specified devices]' \ - ':pool name:_zfs_pool' \ - '*:device:_files' - ;; - - (iostat) - _arguments -A "-*" \ - '-l[Display configuration in /dev/chassis location form]' \ - '-T[timestamp]:value:(u d)' \ - '-v[Verbose statistics]' \ - '*::pool name:_zfs_pool' \ - '::interval:' \ - '::count:' - ;; - - (labelclear) - _arguments -A "-*" \ - '-f[treat exported or foreign devices as inactive]' \ - '*:virtual device:_files' - ;; - - (status) - _arguments -A "-*" \ - '-l[Display configuration in /dev/chassis location form]' \ - '-v[Verbose information]' \ - '-x[Show only unhealthy pools]' \ - '-T[timestamp]:value:(u d)' \ - '*::pool name:_zfs_pool' - ;; - - (offline) - _arguments -A "-*" \ - '-t[Offline until next reboot]' \ - ':pool name:_zfs_pool' \ - '*:virtual device:_files' - ;; - - (online) - _arguments \ - '-e[Expand device to use all available space]' \ - ':pool name:_zfs_pool' \ - '*:virtual device:_files' - ;; - - (attach) - # TODO: first device should choose first from existing. - _arguments \ - '-f[Force attach, even if in use]' \ - ':pool name:_zfs_pool' \ - ':virtual device:_files' \ - ':virtual device:_files' - ;; - - (detach) - _arguments \ - ':pool name:_zfs_pool' \ - ':virtual device:_files' - ;; - - (replace) - _arguments -A "-*" \ - '-f[Force attach, even if in use]' \ - ':pool name:_zfs_pool' \ - ':virtual device:_files' \ - '::virtual device:_files' - ;; - - (scrub) - _arguments -A "-*" \ - '-s[Stop scrubbing]' \ - '*:pool name:_zfs_pool' - ;; - - (export) - _arguments -A "-*" \ - '-f[Forcefully unmount all datasets]' \ - '*:pool name:_zfs_pool' - ;; - - (import) - # TODO: -o should complete mount options, too - _arguments -A "-*" \ - '-D[Destroyed pools]' \ - '(-d)*-c[Use cache file]:cache file:_files' \ - '(-c -D)*-d[Search for devices or files in directory]:directory:_files -/' \ - '-F[Recovery mode: discard transactions if required]' \ - '-f[Force import]' \ - '-l[Display configuration in /dev/chassis location form]' \ - '-m[Ignore missing log devices]' \ - '-N[Import pool without mounting any filesystems]' \ - '-n[With -F; do not perform input]' \ - '-R[Alternate root]:alternate root:_files -/' \ - '-o[Set pool or dataset property]:property:_values -s , "property" $create_properties_dataset $rw_props' \ - - set1 \ - '*:pool name or id:_zfs_pool' \ - '::new pool name:' \ - - set2 \ - '-N[Do not mount any filesystems]' \ - '-a[All pools]' - ;; - - (get) - _arguments -A "-*" \ - ':property:_values -s , "property" $fields' \ - '*:pool name:_zfs_pool' - ;; - - (set) - _arguments -A "-*" \ - ':property:_values -s , "property" $rw_props' \ - '*:pool name:_zfs_pool' - ;; - - (split) - _arguments -A "-*" \ - '-R[Alternate root]:alternate root:_files -/' \ - '-l[Display configuration in /dev/chassis location form]' \ - '-n[Display configuration without splitting]' \ - '-o[Set pool or dataset property]:property:_values -s , "property" $create_properties_dataset $rw_props' \ - ':pool name or id:_zfs_pool' \ - ':new pool name:' \ - '*::virtual device:_files -/' - ;; - - (upgrade) - _arguments -A "-*" \ - - set1 \ - '-v[Display ZFS versions and descriptions]' \ - - set2 \ - "-V[Upgrade to given version]:version:($versions)" \ - '-a[Upgrade all pools]' \ - '*:pool name:_zfs_pool' - ;; - - (history) - _arguments -A "-*" \ - '-i[Display internal events]' \ - '-l[Long format]' \ - '*:pool name:_zfs_pool' - ;; - - (*) - _message "unknown zpool subcommand: $service" - ;; - esac -} - -_zpool "$@" diff --git a/Completion/Unix/Type/_zfs_dataset b/Completion/Unix/Type/_zfs_dataset index 63384afc6..7edcfd5d7 100644 --- a/Completion/Unix/Type/_zfs_dataset +++ b/Completion/Unix/Type/_zfs_dataset @@ -11,10 +11,12 @@ local expl_type # -t takes arguments (what kinds of datasets) and can appear multiple times zparseopts -D -E e:=expl_type_arr p=paths_allowed r1=rsrc r2=rdst t+:=type -[[ -n $type[(r)fs] ]] && typearg=( filesystem ) -[[ -n $type[(r)vol] ]] && typearg=( $typearg volume ) -[[ -n $type[(r)snap] ]] && typearg=( $typearg snapshot ) -[[ -n $type[(r)share] ]] && typearg=( $typearg share ) +[[ -n $type[(r)fs] ]] && typearg=( filesystem ) +[[ -n $type[(r)vol] ]] && typearg+=( volume ) +[[ -n $type[(r)snap] ]] && typearg+=( snapshot ) +[[ -n $type[(r)share] && $implementation = solaris ]] && typearg+=( share ) +[[ -n $type[(r)bookmark] && $implementation = openzfs ]] && + typearg+=( bookmark ) if [[ -n $typearg ]]; then typearg=( -t ${(j:,:)typearg} ) # We know we're in zfs list if paths_allowed is non-empty. @@ -58,7 +60,7 @@ if [[ ${#rdst} -gt 0 ]]; then fi if [[ -n $type[(r)clone] ]]; then - datasetlist=( ${(f)"$(zfs list -H -o name,origin -t filesystem 2>/dev/null | awk -F $'\t' "\$2 != \"-\" {print \$1}")":#no cloned filesystems available} ) + datasetlist=( ${(f)"$(zfs list -H -o name,origin -t filesystem 2>/dev/null | awk -F$'\t' "\$2 != \"-\" {print \$1}")":#no cloned filesystems available} ) else datasetlist=( ${(f)"$(zfs list -H -o name $typearg 2>/dev/null)":#no datasets available} ) fi @@ -74,4 +76,5 @@ if [[ -n $expl_type_arr[2] ]]; then expl_type=$expl_type_arr[2] fi -_wanted dataset expl "$expl_type" _multi_parts "$@" -q / datasetlist +_description datasets expl "$expl_type" +_multi_parts "$@" "$expl[@]" -q / datasetlist diff --git a/Completion/Unix/Type/_zfs_keysource_props b/Completion/Unix/Type/_zfs_keysource_props deleted file mode 100644 index 01f63257a..000000000 --- a/Completion/Unix/Type/_zfs_keysource_props +++ /dev/null @@ -1,15 +0,0 @@ -#autoload - -local -a suf -local expl - -compset -S ",*" || suf=(-S ,) -if compset -P 1 "*,"; then - _alternative "zfs-keylocator-prompt:\"prompt\" locator:(prompt)" \ - "zfs-keylocator-file:file locator:_path_files" \ - "zfs-keylocator-pkcs11:PKCS#11 locator: " \ - "zfs-keylocator-https:HTTPS URL locator: " -else - _description format expl "keysource format" - compadd $suf -q "$expl[@]" "$@" raw hex passphrase -fi -- cgit v1.2.3 From 92c80e72aa70ee4b3cc15271136f136e081a7ede Mon Sep 17 00:00:00 2001 From: Aaron Schrab <aaron@schrab.com> Date: Thu, 23 Dec 2021 21:05:21 -0500 Subject: 49664: Use associative array for third-party completion --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 9a79ff2d9..2a1db9cc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-12-29 Oliver Kiddle <opk@zsh.org> + * Aaron Schrab: 49664: Completion/Unix/Command/_git: + Use associative array for third-party completion + * 49668: Completion/Unix/Command/_zfs, Completion/Unix/Type/_zfs_dataset: update zfs completion diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 04b5677ce..cecb80ac3 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -6267,8 +6267,8 @@ _git_commands () { zstyle -a :completion:$curcontext: user-commands user_commands local command - for command in $_git_third_party_commands; do - (( $+commands[git-${command%%:*}] )) && third_party_commands+=$command + for command in ${(k)_git_third_party_commands}; do + (( $+commands[git-${command}] )) && third_party_commands+=$command$_git_third_party_commands[$command] done local -a aliases @@ -8475,7 +8475,7 @@ _git() { } # Load any _git-* definitions so that they may be completed as commands. -declare -gUa _git_third_party_commands +declare -gA _git_third_party_commands _git_third_party_commands=() local file input @@ -8497,7 +8497,7 @@ for file in ${^fpath}/_git-*~(*~|*.zwc)(-.N); do (( i++ )) done < $file - _git_third_party_commands+=$name$desc + _git_third_party_commands+=([$name]=$desc) done _git -- cgit v1.2.3 From af0f497247150f55963e908097d04e543da55a4b Mon Sep 17 00:00:00 2001 From: Andreas Schneider <asn@cryptomilk.org> Date: Thu, 23 Dec 2021 10:18:19 +0100 Subject: gitlab !17: Add missing options for quilt setup command --- ChangeLog | 5 +++++ Completion/Unix/Command/_quilt | 2 ++ 2 files changed, 7 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index c7b2cb59c..1bc824b4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-01-23 Andreas Schneider <asn@cryptomilk.org> + + * gitlab !17: Completion/Unix/Command/_quilt: Add missing + options for quilt setup command + 2022-01-01 Bart Schaefer <schaefer@zsh.org> * Matt Alexander: 49667: Functions/Misc/colors: include "gray" diff --git a/Completion/Unix/Command/_quilt b/Completion/Unix/Command/_quilt index 8f39dadac..01f8cfb83 100644 --- a/Completion/Unix/Command/_quilt +++ b/Completion/Unix/Command/_quilt @@ -261,6 +261,8 @@ case $words[1] in '-d[specify path prefix for resulting source tree]:prefix:_files -W / -P /' \ '--sourcedir[specify location of package sources]:directory:_directories' \ '--fuzz=[set the maximum fuzz factor]:factor' \ + '(--fast)--slow[use the original, slow method to process the spec file]' \ + '(--slow)--fast[use an alternative, faster method to process the spec file]' \ ':file:_files' && return ;; snapshot) _arguments $help '-d[only remove current snapshot]' && return ;; -- cgit v1.2.3 From 63425124835ec6c5cccdb17b50ac2a4cb8a0e90f Mon Sep 17 00:00:00 2001 From: Daniel Shahaf <d.s@daniel.shahaf.name> Date: Wed, 26 Jan 2022 14:18:43 +0000 Subject: 49711: _subversion: _svn_status: Don't offer unversioned files This function is used only by revert, diff, and commit, none of which can run on unversioned files (those with status '?'). --- ChangeLog | 5 +++++ Completion/Unix/Command/_subversion | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 11166e6bb..3636b8e65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-01-29 Daniel Shahaf <d.s@daniel.shahaf.name> + + * 49711: Completion/Unix/Command/_subversion: _svn_status: + Don't offer unversioned files + 2022-01-27 Daniel Shahaf <d.s@daniel.shahaf.name> * unposted: Doc/Zsh/contrib.yo: vcs_info quilt docs: Fix diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index 26eef500f..2f66c3522 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -390,7 +390,7 @@ _svn_status() { local mtime="$(zstat +mtime $dir/.svn/entries)" if (( ! $+_cache_svn_status[$key] || _cache_svn_mtime[$key] != mtime )); then - _cache_svn_status[$key]="$(_call_program files svn status -N $dir)" + _cache_svn_status[$key]="$(_call_program files svn status -q -N -- $dir)" _cache_svn_mtime[$key]="$mtime" fi -- cgit v1.2.3 From cb2b0e7c6cdd851f79b6856335e8ab7a3d3d1935 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf <d.s@daniel.shahaf.name> Date: Wed, 26 Jan 2022 14:18:44 +0000 Subject: 49712: _subversion: svn rm: Complete all svn-controlled files, not only missing/deleted files Note that currently, _svn_controlled matches all files. --- ChangeLog | 3 +++ Completion/Unix/Command/_subversion | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 3636b8e65..9d308258a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2022-01-29 Daniel Shahaf <d.s@daniel.shahaf.name> + * 49712: Completion/Unix/Command/_subversion: svn rm: Complete + all svn-controlled files, not only missing/deleted files + * 49711: Completion/Unix/Command/_subversion: _svn_status: Don't offer unversioned files diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index 2f66c3522..9ef3077f6 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -146,7 +146,7 @@ _svn () { ;; (delete) args+=( - '*:file:_files -g ".svn(/e:_svn_deletedfiles:)"' + '*:file:_files -g "*(e:_svn_controlled:)"' ) ;; (diff) -- cgit v1.2.3 From a803a5f4c46629c18c05a9ee09d5ae34407e35c4 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf <d.s@daniel.shahaf.name> Date: Wed, 26 Jan 2022 14:18:45 +0000 Subject: 49713: _subversion: commit, diff, revert: Update completions for svn 1.7 and newer * _svn_deletedfiles: Remove. The last version of svn(1) under which that function could possibly complete anything, svn 1.6.x, was EOLed in 2013. Newer versions don't have a "text-base" directory, so $controlled is set to an empty array, so this function returned false for all files, so in 'svn rm' (up to the previous commit) all files were completed (because that's what '_files -g "*(e:false:)"' does). * _svn_status: Remove. Versions of svn newer than the aforementioned 1.6.x have an entries file but never modify it, so the "mtime has changed" check would false negative. Therefore, sequences such as: . svn <TAB> echo >> some/versioned/file svn ci <TAB> . wouldn't offer some/versioned/file. . Furthermore, completion would offer directories with no changed files in them, and even unversioned directories. Now only changed files/directories are offered. * _cache_svn_status, _cache_svn_mtime: Remove. If these hadn't been removed, I would have moved their declarations to file scope so _svn_status could be used from outside this file, too. The replacement function, _svn_modified, doesn't have cache support, but does honour the 'verbose' style to inhibit recursion to subdirectories. --- ChangeLog | 3 ++ Completion/Unix/Command/_subversion | 69 +++++++++++++++++++++++-------------- 2 files changed, 46 insertions(+), 26 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 9d308258a..15e3a9999 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2022-01-29 Daniel Shahaf <d.s@daniel.shahaf.name> + * 49713: Completion/Unix/Command/_subversion: commit, diff, + revert: Update completions for svn 1.7 and newer + * 49712: Completion/Unix/Command/_subversion: svn rm: Complete all svn-controlled files, not only missing/deleted files diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index 9ef3077f6..cb5cbd374 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -68,7 +68,6 @@ _svn () { ;; args) local cmd args usage idx - typeset -gHA _cache_svn_status _cache_svn_mtime cmd="${${(k)_svn_cmds[(R)*:$words[1]:*]}:-${(k)_svn_cmds[(i):$words[1]:]}}" if (( $#cmd )); then @@ -141,7 +140,7 @@ _svn () { (commit) args=( ${args/(#b)(*--file*):arg:/$match[1]:file:_files} - '*:file:_files -g "*(e:_svn_status:)"' + '*:file: _svn_modified "committable"' ) ;; (delete) @@ -151,7 +150,7 @@ _svn () { ;; (diff) args+=( - '*: : _alternative "files:file:_files -g \*\(e:_svn_status:\)" "urls:URL:_svn_urls"' + '*: : _alternative "files:file: _svn_modified revertable" "urls:URL:_svn_urls"' ) ;; (help) @@ -201,7 +200,7 @@ _svn () { ;; (revert) args+=( - '*:file:_files -g "(.svn|*)(/e:_svn_deletedfiles:,e:_svn_status:)"' + '*:file: _svn_modified "revertable"' ) ;; (x-unshelve) @@ -368,33 +367,51 @@ _svn_conflicts() { () { (( $# > 0 )) } $REPLY.(mine|r<->)(NY1) } -(( $+functions[_svn_deletedfiles] )) || -_svn_deletedfiles() { - # Typical usage would be _files -g '.svn(/e:_svn_deletedfiles:)' - local cont controlled - reply=( ) - [[ $REPLY = (*/|).svn ]] || return - controlled=( $REPLY/text-base/*.svn-base(N:r:t) ) - for cont in ${controlled}; do - [[ -e $REPLY:h/$cont ]] || reply+=( ${REPLY%.svn}$cont ) - done -} +(( $+functions[_svn_modified] )) || +_svn_modified() { + setopt localoptions extendedglob -(( $+functions[_svn_status] )) || -_svn_status() { - local dir=$REPLY:h - local pat="${1:-([ADMR~]|?M)}" + local depth dir expl partial_word space=' ' - zmodload -F zsh/stat b:zstat 2>/dev/null - local key="$(zstat +device $dir):$(zstat +inode $dir)" - local mtime="$(zstat +mtime $dir/.svn/entries)" + local svn_context=$1 - if (( ! $+_cache_svn_status[$key] || _cache_svn_mtime[$key] != mtime )); then - _cache_svn_status[$key]="$(_call_program files svn status -q -N -- $dir)" - _cache_svn_mtime[$key]="$mtime" + local partial_word=${(Q)words[CURRENT]} + if [[ -z $partial_word ]]; then + dir="./" + elif [[ -d $partial_word ]]; then + dir=$partial_word + else + dir=${partial_word:h} fi - (( ${(M)#${(f)_cache_svn_status[$key]}:#(#s)${~pat}*$REPLY} )) + if zstyle -T ":completion:${curcontext}:${curtag}" verbose; then + depth=infinity + else + depth=immediates + fi + + local -a status_lines + # Run 'status' + status_lines=( ${(f)"$(_call_program modified-files "svn status -q --depth=${(q)depth} -- ${(q)dir}")"} ) + # Filter to only the right set of statuses + case $svn_context in + (committable) + status_lines=( ${(M)status_lines:#(#s)([ADMR]?|?M)${space}???${space}${space}*} ) + ;; + (revertable) + status_lines=( ${(M)status_lines:#(#s)([ACDMR~!]?|?[CM])${space}????${space}*} ) + ;; + esac + # Strip the 7 status-letter columns and the column of spaces + status_lines=( ${status_lines#????????} ) + # Strip one leading space. This is in case `svn status` ever adds another + # column. If that hasn't happened and you're reading this comment because + # the following line broke your use of filenames that start with a literal + # space, well, nice to meet you! I didn't know you existed. + status_lines=( ${status_lines#${space}} ) + + _wanted svn-modified expl 'modified files in svn' \ + compadd - "${status_lines[@]}" } (( $+functions[_svn_remote_paths] )) || -- cgit v1.2.3 From a956caa2339ea8ae07765943687925c7c2a836bf Mon Sep 17 00:00:00 2001 From: Daniel Shahaf <d.s@daniel.shahaf.name> Date: Wed, 26 Jan 2022 14:18:46 +0000 Subject: 49714: _subversion: resolve: Complete conflicted files created by merges, too --- ChangeLog | 3 +++ Completion/Unix/Command/_subversion | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 15e3a9999..d2598a8ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2022-01-29 Daniel Shahaf <d.s@daniel.shahaf.name> + * 49714: Completion/Unix/Command/_subversion: resolve: Complete + conflicted files created by merges, too + * 49713: Completion/Unix/Command/_subversion: commit, diff, revert: Update completions for svn 1.7 and newer diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index cb5cbd374..e9a3d9b1a 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -364,7 +364,11 @@ _svn_uncontrolled() { (( $+functions[_svn_conflicts] )) || _svn_conflicts() { - () { (( $# > 0 )) } $REPLY.(mine|r<->)(NY1) + # ### These strings are actually translatable + # + # The asterisks are to support an optional extension; see + # "preserved-conflict-file-exts" in ~/.subversion/config. + () { (( $# > 0 )) } $REPLY.(mine|r<->|working*|merge-left*|merge-right*)(NY1) } (( $+functions[_svn_modified] )) || -- cgit v1.2.3 From 04513dd5df31bc235691400b76a524d117cefede Mon Sep 17 00:00:00 2001 From: Daniel Shahaf <d.s@daniel.shahaf.name> Date: Wed, 26 Jan 2022 14:18:47 +0000 Subject: 49715: _subversion: add: Complete target arguments to this subcommand --- ChangeLog | 3 +++ Completion/Unix/Command/_subversion | 24 ++++++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index d2598a8ca..328844766 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2022-01-29 Daniel Shahaf <d.s@daniel.shahaf.name> + * 49715: Completion/Unix/Command/_subversion: add: Complete + target arguments to this subcommand + * 49714: Completion/Unix/Command/_subversion: resolve: Complete conflicted files created by merges, too diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index e9a3d9b1a..8fc46a292 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -122,7 +122,7 @@ _svn () { case $cmd in; (add) args+=( - '*:file:_files -g "*(e:_svn_uncontrolled:)"' + '*:file: _svn_modified "addable"' ) ;; (auth) @@ -350,18 +350,12 @@ _svn_controlled() { # because 1.6 has been deprecated for 8 years and EOL for 6 years, we opt to DTRT # for >=1.7. Therefore: - # TODO: Reimplement this function and _svn_uncontrolled for svn>=1.7. + # TODO: Reimplement this function for svn>=1.7. # (Use 'svn st' or 'svn info', not 'svn ls') return 0 } -(( $+functions[_svn_uncontrolled] )) || -_svn_uncontrolled() { - # TODO: See comments in _svn_controlled - return 0 -} - (( $+functions[_svn_conflicts] )) || _svn_conflicts() { # ### These strings are actually translatable @@ -375,7 +369,7 @@ _svn_conflicts() { _svn_modified() { setopt localoptions extendedglob - local depth dir expl partial_word space=' ' + local depth dir expl maybe_quiet partial_word space=' ' local svn_context=$1 @@ -394,9 +388,15 @@ _svn_modified() { depth=immediates fi + if [[ $svn_context = addable ]]; then + maybe_quiet="" + else + maybe_quiet="-q" + fi + local -a status_lines # Run 'status' - status_lines=( ${(f)"$(_call_program modified-files "svn status -q --depth=${(q)depth} -- ${(q)dir}")"} ) + status_lines=( ${(f)"$(_call_program modified-files "svn status $maybe_quiet --depth=${(q)depth} -- ${(q)dir}")"} ) # Filter to only the right set of statuses case $svn_context in (committable) @@ -405,6 +405,10 @@ _svn_modified() { (revertable) status_lines=( ${(M)status_lines:#(#s)([ACDMR~!]?|?[CM])${space}????${space}*} ) ;; + (addable) + # The 'D' is just in case there's an unversioned file of the same name as the deleted file + status_lines=( ${(M)status_lines:#(#s)[?ID]${space}${space}???${space}${space}*} ) + ;; esac # Strip the 7 status-letter columns and the column of spaces status_lines=( ${status_lines#????????} ) -- cgit v1.2.3 From fc18b7c8a29326e8d5233694954f699f7d018704 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> Date: Fri, 4 Feb 2022 21:15:54 +0900 Subject: 49730: new completions for csplit, pr, ptx, truncate --- ChangeLog | 6 +++ Completion/Unix/Command/_csplit | 51 +++++++++++++++++++ Completion/Unix/Command/_pr | 103 ++++++++++++++++++++++++++++++++++++++ Completion/Unix/Command/_ptx | 54 ++++++++++++++++++++ Completion/Unix/Command/_truncate | 69 +++++++++++++++++++++++++ 5 files changed, 283 insertions(+) create mode 100644 Completion/Unix/Command/_csplit create mode 100644 Completion/Unix/Command/_pr create mode 100644 Completion/Unix/Command/_ptx create mode 100644 Completion/Unix/Command/_truncate (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 85921bb18..94e15474b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2022-02-04 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + + * 49730: Completion/Unix/Command/_csplit, + Completion/Unix/Command/_pr, Completion/Unix/Command/_ptx, + Completion/Unix/Command/_truncate: New completers + 2022-02-02 Matthew Martin <phy1729@gmail.com> * 49731: Completion/BSD/Command/_sysclean, diff --git a/Completion/Unix/Command/_csplit b/Completion/Unix/Command/_csplit new file mode 100644 index 000000000..5f72232bb --- /dev/null +++ b/Completion/Unix/Command/_csplit @@ -0,0 +1,51 @@ +#compdef csplit + +local curcontext=$curcontext cnt_info ret=1 +local -a state state_descr line specs optA +typeset -A opt_args + +# common specs +specs=( + '(hv -f --prefix)'{-f+,--prefix=}'[specify prefix for output file names]:prefix [xx]: ' + '(hv -n --digits -b --suffix-format)'{-n+,--digits=}'[specify number of digits in output file names]:number [2]: ' + '(hv -k --keep-files)'{-k,--keep-files}'[do not remove output files on errors]' + '(hv -s --quiet --silent)'{-s,--quiet,--silent}'[do not print counts of output file sizes]' + '(hv)1: :_files' + '(hv)*: :->patterns' +) + +if _pick_variant gnu=GNU unix --version; then + # GNU coreutils 8.32 + specs+=( + '(hv -b --suffix-format -n --digits)'{-b+,--suffix-format=}'[specify format for numbers in output file names]:format [%%02d]: ' + '(hv)--suppress-matched[suppress the lines matching the pattern]' + '(hv -z --elide-empty)'{-z,--elide-empty-files}'[remove empty output files]' + + hv + '(: * -)--help[display help and exit]' + '(: * -)--version[output version information and exit]' + ) + cnt_info="(integer or '*')" +else + # POSIX ({Free,Open}BSD, DragonFly, macOS) + specs=( ${specs:#(|*\))--*} ) # remove long options + optA=( -A '-?*' ) # a single '-' is a valid file name (stdin) +fi + +_arguments -C -s -S $optA : $specs && ret=0 + +case $state in + patterns) + if compset -P '(/?*/|%?*%)'; then + _message '[+|-]offset' && ret=0 + elif compset -P '[/%]'; then + _message 'regex' && ret=0 + elif compset -P '(|\\){'; then + _message "count $cnt_info" && ret=0 + elif compset -P '[0-9]*'; then + _message 'line number' && ret=0 + elif [[ ${words[CURRENT]} != -* ]] then + _message "line_number, '/regex/[offset]', '%%regex%%[offset]', or '{count}'" && ret=0 + fi +esac + +return ret diff --git a/Completion/Unix/Command/_pr b/Completion/Unix/Command/_pr new file mode 100644 index 000000000..2aeeb13b3 --- /dev/null +++ b/Completion/Unix/Command/_pr @@ -0,0 +1,103 @@ +#compdef pr + +local curcontext=$curcontext variant msg ret=1 +local -a state state_descr line specs optA +typeset -A opt_args + +# take care of '+FIRST_PAGE[:LAST_PAGE]' (GNU) or '+FIRST_PAGE' (POSIX) +if _pick_variant -r variant gnu=GNU $OSTYPE --version; then + msg='FIRST_PAGE[:LAST_PAGE]' +else + msg='first page' +fi + +if [[ $words[CURRENT] = +* ]]; then + _message "$msg" && return +fi + +if (( ! ${words[(I)+[0-9]*]} )); then + # if +number is not on the command line + specs=( '(hv)--pages=[specify first and last page numbers]: : _message $msg' ) +fi + +# common specs +specs+=( + '(hv -a --across)'{-a,--across}'[with multi-column output, print columns across rather than down]' + '(hv -d --double-space)'{-d,--double-space}'[double space the output]' + '(hv -e --expand-tabs)'{-e-,--expand-tabs=-}'[expand tab (or specified char) with specified number of spaces]::number of spaces [8]:->char_number' + '(hv -h --header -t --omit-header)'{-h+,--header=}'[specify text used in header]:header: ' + '(hv -i --output-tabs)'{-i-,--output-tabs=-}'[replace specified number of spaces with tab (or specified char)]::number of spaces [8]:->char_number' + '(hv -l --length)'{-l+,--length=}'[specify the page length]:number of lines [66]: ' + '(hv -m --merge)'{-m,--merge}'[print all files in parallel, one in each column]' + '(hv -n --number-lines)'{-n-,--number-lines=-}'[number lines with specified separator and width]::number of digits [5]:->char_number' + '(hv -o --indent)'{-o+,--indent=}'[specify left margin]:margin [0]: ' + '(hv -r -no-file-warnings)'{-r,--no-file-warnings}'[omit warning when a file cannot be opened]' + '(hv -s --separator)'{-s-,--separator=-}'[specify column separator character]:character [tab]: ' + '(hv -t --omit-header -h --header)'{-t,--omit-header}'[omit page headers and trailers]' + '(hv -w --width)'{-w+,--width=}'[specify page width for multi-column output]:number of characters [72]: ' + '(hv)*: :_files' +) +# XXX: pr accepts -2 -3 -4 ... for specifying the number of columns. +# Here we offer only -2 and -3, and do so only if there is no +# -2 -3 -4 ... or --columns on the command line. +if (( ! ${words[(I)-([0-9]##*|-columns*)]} )); then + specs+=( {-2,-3}'[specify number of columns]' ) +fi + +if [[ $variant = gnu ]]; then + # GNU coreutils 8.32 + specs+=( + '(hv -c --show-control-chars)'{-c,--show-control-chars}'[use hat (^G) and octal backslash notation]' + '(hv -D --date-format)'{-D+,--date-format=}'[specify format for the header date]: :_date_formats' + '(hv -f -F --form-feed)'{-f,-F,--form-feed}'[use form feeds instead of newlines to separate pages]' + '(hv -J --join-lines)'{-J,--join-lines}'[merge full lines in multi-column output]' + '(hv -N --first-line-number)'{-N+,--first-line-number=}'[specify the line number of the 1st line]:number: ' + '(hv -S --sep-string)'{-S-,--sep-string=-}'[specify column separator string]:string: ' + '(hv -T --omit-pagination)'{-T,--omit-pagination}'[omit page headers and trailers, eliminate any pagination]' + '(hv -v --show-nonprinting)'{-v,--show-nonprinting}'[use octal backslash notation]' + '(hv -W --page-width)'{-W+,--page-width=}'[specify page width always]:number of characters [72]: ' + ) + if (( ! ${words[(I)-[0-9]##*]} )); then + # if -2 -3 -4 ... are not on the command line + specs+=( + '(hv)--columns=[specify number of columns]:number of columns: ' + + hv + '(- *)--help[display help and exit]' + '(- *)--version[output version information and exit]' + ) + fi +else + specs=( ${specs:#(|*\))--*} ) # remove long options + case $variant in + freebsd*|dragonfly*|darwin*|netbsd*) + specs+=( + '(-f)-F[use form feeds instead of newlines to separate pages]' + '(-F)-f[same as -F but pause before the 1st page if stdout is terminal]' + '-p[pause before each page if stdout is terminal]' + ) + ;| + freebsd*|dragonfly*|darwin*) + specs+=( '-L+[specify locale to use]: :_locales' ) + ;; + openbsd*) + specs+=( '(-f -F)'{-f,-F}'[use form feeds instead of newlines to separate pages]' ) + ;; + esac + optA=( -A '[-+]?*' ) # a single '-' is a valid file name (stdin) +fi + +_arguments -C -s -S $optA : $specs && ret=0 + +case $state in + char_number) + # argument for option -e (and -i, -n) can be -e. -e10 or -e.10 + # where . is any non-digit character + if compset -p 1; then + _message "$state_descr" && ret=0 + else + _message "a character [tab] (optional), and $state_descr" && ret=0 + fi + ;; +esac + +return ret diff --git a/Completion/Unix/Command/_ptx b/Completion/Unix/Command/_ptx new file mode 100644 index 000000000..12f1d2c9a --- /dev/null +++ b/Completion/Unix/Command/_ptx @@ -0,0 +1,54 @@ +#compdef ptx + +local -a specs optA + +# common specs +specs=( + '(hv -b --break-file)'{-b+,--break-file=}'[use characters in specified file as word separators]:break file:_files' + '(hv -f --ignore-case)'{-f,--ignore-case}'[fold lower case to upper case for sorting]' + '(hv -g --gap-size)'{-g+,--gap-size=}'[specify gap size between output fields]:number of chars [3]: ' + '(hv -i --ignore-file)'{-i+,--ignore-file=}'[ignore keywords listed in specified file]:ignore file:_files' + '(hv -o --only-file)'{-o+,--only-file=}'[use only the keywords listed in specified file]:only file:_files' + '(hv -r --references)'{-r,--references}'[first field of each line is a reference]' + '(hv -w --width)'{-w+,--width=}'[specify page width, reference excluded]:number of characters [72]: ' +) + +if _pick_variant gnu=GNU unix --version; then + # GNU coreutils 8.32 + specs+=( + '(hv -A --auto-reference)'{-A,--auto-reference}'[output automatically generated references]' + '(hv -G --traditional)'{-G,--traditional}"[behave more like System V 'ptx']" + '(hv -F --flag-truncation)'{-F+,--flag-truncation=}'[specify string for flagging line truncations]:string [/]: ' + '(hv -M --macro-name)'{-M+,--macro-name=}"[specify macro name to use instead of 'xx']:macro name: " + '(hv)-O[generate output as roff directives]' + '(hv -R --right-side-refs)'{-R,--right-side-refs}'[put references at right, not counted in -w]' + '(hv -S --sentence-regexp)'{-S+,--sentence-regexp=}'[specify regexp for end of lines/sentences]:regexp: ' + '(hv)-T[generate output as TeX directives]' + '(hv -W --word-regexp -b --break-file)'{-W+,--word-regexp=}'[specify regexp to match each keyword]:regexp: ' + '(hv)--format=[specify the output format]:format:(roff tex)' + !{-t,--typeset-mode}'[not implemented]' + + hv + '(: * -)--help[display help and exit]' + '(: * -)--version[output version information and exit]' + ) + if (( $words[(I)(-G|--traditional)] )); then + specs+=( + arg '1:input file:_files' '2:output file:_files' ) + else + specs+=( + arg '(-G --traditional)*:input file:_files' ) + fi +else + # The only non-GNU implementation I can find is the one in + # heirloom-doctools. FreeBSD has a package for this. + specs=( ${specs:#(|*\))--*} ) # remove long options + # remove '+' from -b+ -g+ -i+ -o+ -w+ + local MATCH MBEGIN MEND + specs=( ${specs/(#m)-[bgiow]+/$MATCH[1,-2]} ) + specs+=( + '-t[prepare output for typesetter]' + '1:input file:_files' + '2:output file:_files' + ) + optA=( -A '-?*' ) # a single '-' is a valid file name (stdin) +fi + +_arguments -s -S $optA : $specs diff --git a/Completion/Unix/Command/_truncate b/Completion/Unix/Command/_truncate new file mode 100644 index 000000000..117be9702 --- /dev/null +++ b/Completion/Unix/Command/_truncate @@ -0,0 +1,69 @@ +#compdef truncate + +local curcontext=$curcontext variant rs ret=1 +local -a state state_descr line specs optA +typeset -A opt_args + +_pick_variant -r variant gnu=GNU $OSTYPE --version +[[ $variant != gnu ]] && rs='-r -s' # -r/-s mutually exclusive + +# common specs +specs=( + '(hv -c --no-create)'{-c,--no-create}'[do not create any files]' + "(hv $rs -r --reference)"{-r+,--reference=}'[base size on the specified file]:reference file:_files' + "(hv $rs -s --size)"{-s+,--size=}'[set or adjust the file size by specified bytes]:size:->size' + '(hv)*: :_files' +) + +case $variant in + gnu) # GNU coreutils 8.32 + specs+=( + '(hv -o --io-blocks)'{-o,--io-blocks}'[treat the specified size as number of IO blocks instead of bytes]' + + 'hv' + '(- *)--help[display help and exit]' + '(- *)--version[output version information and exit]' + ) + ;; + *) # FreeBSD/DragonFly + specs=( ${specs:#(|*\))--*} ) # remove long options + optA=( -A '-*' ) + ;; +esac + +_arguments -C -s -S : $specs && ret=0 + +case $state in + size) + local unit=bytes + (( ${#opt_args[(I)(-o|--io-blocks)]} )) && unit=blocks + local -a suffix=( K:1024 M G T ) + local -a prefix=( '+:extend by' '-:reduce by' ) + local prefix_char='[-+]' + case $variant in + gnu|freebsd*) + prefix+=( '/:round down to multiple of' '%:round up to multiple of' ) + ;| + gnu) + suffix=( K:1024 KB:1000 {M,G,T,P,E,Z,Y}{,B} ) + prefix+=( '<:at most' '>:at least' ) + prefix_char='([-+/%]|\\[<>])' + ;; + freebsd*) + prefix_char='[-+/%]' + ;; + esac + local -a numbers=( _numbers -u $unit size $suffix ) + + if compset -P "$prefix_char"; then + $numbers && ret=0 + elif (( ${#opt_args[(I)(-r|--reference)]} )); then + # prefix is required if the reference file is given + _describe -t 'prefixes' 'prefix' prefix && ret=0 + else + _alternative "prefixes:prefix:((${(@q)prefix}))" \ + "sizes: :$numbers" && ret=0 + fi + ;; +esac + +return ret -- cgit v1.2.3 From b745b06eb3b40b0ccdaf67b174591501a3ce30da Mon Sep 17 00:00:00 2001 From: samcarter <samcarter8@users.sourceforge.net> Date: Wed, 16 Feb 2022 13:12:43 +0900 Subject: 49757 (sourceforge #1): offer *.dtx as TeX input files --- ChangeLog | 5 +++++ Completion/Unix/Command/_tex | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 4b28e616b..1fd675c14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-02-16 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + + * 49757 (sourceforge #1): samcarter: Completion/Unix/Command/_tex: + offer *.dtx as TeX input files + 2022-02-15 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> * 49756 + 49758 (Daniel): Etc/FAQ.yo, Util/zyodl.vim: replace diff --git a/Completion/Unix/Command/_tex b/Completion/Unix/Command/_tex index 9943fe10c..f1428c494 100644 --- a/Completion/Unix/Command/_tex +++ b/Completion/Unix/Command/_tex @@ -26,4 +26,4 @@ _arguments : \ '-8bit[make all characters printable by default]' \ '-help[display this help and exit]' \ '-version[output version information and exit]' \ - '*:TeX or LaTeX file:_files -g "*.(tex|TEX|texinfo|texi)(-.)"' + '*:TeX or LaTeX file:_files -g "*.(tex|TEX|texinfo|texi|dtx)(-.)"' -- cgit v1.2.3 From a692b980cb895143e073ac2e3fccf5ad0760eafe Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> Date: Wed, 23 Feb 2022 11:24:39 +0900 Subject: 49765: _less: add option --color as synonym for -D --- ChangeLog | 5 +++++ Completion/Unix/Command/_less | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 5dc07937f..f8e82282a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-02-23 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + + * 49765: Completion/Unix/Command/_less: add option --color + as synonym for -D + 2022-02-22 Daniel Shahaf <d.s@daniel.shahaf.name> * unposted: Doc/Zsh/contrib.yo, Src/Modules/parameter.c, diff --git a/Completion/Unix/Command/_less b/Completion/Unix/Command/_less index ae912a633..0a72782ef 100644 --- a/Completion/Unix/Command/_less +++ b/Completion/Unix/Command/_less @@ -39,7 +39,7 @@ _arguments -S -s -A "[-+]*" \ '(-C --CLEAR-SCREEN -c --clear-screen)'{-c,--clear-screen}'[repaint screen instead of scrolling]' \ '!(-c --clear-screen)'{-C,--CLEAR-SCREEN} \ '(-d --dumb)'{-d,--dumb}'[suppress error message if terminal is dumb]' \ - '*-D+[set screen colors]: :->colors' \ + '*'{-D+,--color=}'[set screen colors]: :->colors' \ '(-e -E --quit-at-eof --QUIT-AT-EOF)'{-e,--quit-at-eof}'[exit the second time end-of-file is reached]' \ '(-e -E --quit-at-eof --QUIT-AT-EOF)'{-E,--QUIT-AT-EOF}'[exit when end-of-file is reached]' \ '(-f --force)'{-f,--force}'[force opening of non-regular files]' \ @@ -104,7 +104,7 @@ if [[ -n "$state" ]]; then if compset -P 1 \?; then [[ $IPREFIX[-1] != [a-z] ]] || compset -P 1 + || _describe 'color application' '( +:add\ to\ existing\ attribute )' suf=( -S '' ) - compset -P 1 '([a-zA-Z]|*.)' && fgbg=background && suf=() + compset -P 1 '([-a-zA-Z]|*.)' && fgbg=background && suf=() basic=( B:blue C:cyan G:green K:black M:magenta R:red W:white Y:yellow ) _describe -t colors "$fgbg color" \ "( -:default ${(j. .)${(@)basic/:/:light\ }} ${(Lj. .)basic} )" "$suf[@]" && ret=0 -- cgit v1.2.3 From ef60187efce77c0572daf419ca5ba57a28df3cad Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> Date: Wed, 23 Feb 2022 11:39:33 +0900 Subject: 49766: _less: add quotes to -" and -# --- ChangeLog | 2 ++ Completion/Unix/Command/_less | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index f8e82282a..ca8477dfb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2022-02-23 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + * 49766: Completion/Unix/Command/_less: add quotes to -" and -# + * 49765: Completion/Unix/Command/_less: add option --color as synonym for -D diff --git a/Completion/Unix/Command/_less b/Completion/Unix/Command/_less index 0a72782ef..69f75fd0e 100644 --- a/Completion/Unix/Command/_less +++ b/Completion/Unix/Command/_less @@ -80,9 +80,9 @@ _arguments -S -s -A "[-+]*" \ '--no-keypad[disable use of keypad terminal init string]' \ '(-y --max-forw-scroll)'{-y,--max-forw-scroll}'[specify forward scroll limit]' \ '(-z --window)'{-z+,--window=}'[specify scrolling window size]:lines' \ - '(-" --quotes)'{-\"+,--quotes=}'[change quoting character]:quoting characters' \ + '(-\" --quotes)'{'-\"+',--quotes=}'[change quoting character]:quoting characters' \ '(-~ --tilde)'{-~,--tilde}"[don't display tildes after end of file]" \ - '(-# --shift)'{-\#+,--shift=}"[specify amount to move when scrolling horizontally]:number" \ + '(-\# --shift)'{'-\#+',--shift=}"[specify amount to move when scrolling horizontally]:number" \ '--file-size[automatically determine the size of the input file]' \ '--incsearch[search file as each pattern character is typed in]' \ '--line-num-width=[set the width of line number field]:width [7]' \ -- cgit v1.2.3 From 78649ac72596104cfcbaad9a5a7d1a1afa981a4c Mon Sep 17 00:00:00 2001 From: Matthew Martin <phy1729@gmail.com> Date: Fri, 18 Mar 2022 20:49:48 -0500 Subject: 49852: Add _routing_domains and _routing_tables types --- ChangeLog | 8 ++++++++ Completion/BSD/Command/_pfctl | 2 +- Completion/BSD/Type/_routing_domains | 6 ++++++ Completion/BSD/Type/_routing_tables | 6 ++++++ Completion/Unix/Command/_arp | 2 +- Completion/Unix/Command/_netstat | 2 +- Completion/Unix/Command/_pgrep | 3 +-- Completion/Unix/Command/_ping | 2 +- Completion/Unix/Command/_route | 2 +- Completion/Unix/Command/_top | 2 +- 10 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 Completion/BSD/Type/_routing_domains create mode 100644 Completion/BSD/Type/_routing_tables (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 11a9981e3..f915fbae5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2022-03-18 Matthew Martin <phy1729@gmail.com> + * 49852: Completion/BSD/Command/_pfctl, + Completion/BSD/Type/_routing_domains, + Completion/BSD/Type/_routing_tables, + Completion/Unix/Command/_arp, Completion/Unix/Command/_netstat, + Completion/Unix/Command/_pgrep, Completion/Unix/Command/_ping, + Completion/Unix/Command/_route, Completion/Unix/Command/_top: + Add _routing_domains and _routing_tables types. + * 49851: Completion/BSD/Type/_login_classes: Complete login.conf.d classes. diff --git a/Completion/BSD/Command/_pfctl b/Completion/BSD/Command/_pfctl index 23898882f..812e52bdb 100644 --- a/Completion/BSD/Command/_pfctl +++ b/Completion/BSD/Command/_pfctl @@ -66,7 +66,7 @@ case $OSTYPE in "-N[don't perform domain name resolution]" '-P[display ports using service names]' '-S+[store pf state table in the specified file]:file:_files' - '-V+[select routing domain to be used to kill states]:routing domain' + '-V+[select routing domain to be used to kill states]:routing domain:_routing_domains' ) ;; (free|net)bsd*) diff --git a/Completion/BSD/Type/_routing_domains b/Completion/BSD/Type/_routing_domains new file mode 100644 index 000000000..4bb9f78b0 --- /dev/null +++ b/Completion/BSD/Type/_routing_domains @@ -0,0 +1,6 @@ +#autoload + +local expl + +_description routing-domains expl 'routing domain' +compadd "$@" "$expl[@]" - ${${(M)${(f)"$(_call_program routing-domains netstat -R)"}:#Rdomain *}#Rdomain } diff --git a/Completion/BSD/Type/_routing_tables b/Completion/BSD/Type/_routing_tables new file mode 100644 index 000000000..3ba1931fe --- /dev/null +++ b/Completion/BSD/Type/_routing_tables @@ -0,0 +1,6 @@ +#autoload + +local expl + +_description routing-tables expl 'routing table' +compadd "$@" "$expl[@]" - ${(s: :)${${(M)${(f)"$(_call_program routing-tables netstat -R)"}:# Routing tables#: *}#*: }} diff --git a/Completion/Unix/Command/_arp b/Completion/Unix/Command/_arp index 389f1099b..7727de28c 100644 --- a/Completion/Unix/Command/_arp +++ b/Completion/Unix/Command/_arp @@ -61,7 +61,7 @@ case $OSTYPE in openbsd*) args+=( '(-a -d -W)-F[overwrite existing entries]' - '(-W)-V+[select the routing domain]:routing domain' + '(-W)-V+[select the routing domain]:routing domain:_routing_domains' ) cmds+=( '(- 1)-W[send the wake on LAN frame]' diff --git a/Completion/Unix/Command/_netstat b/Completion/Unix/Command/_netstat index aa6c92fde..67133dc6c 100644 --- a/Completion/Unix/Command/_netstat +++ b/Completion/Unix/Command/_netstat @@ -270,7 +270,7 @@ case $OSTYPE in sel_rdomains=( '-R[show all rdomains with associated interfaces and routing tables]' ) sel_wireless=( '-W+[display per-interface IEEE 802.11 wireless statistics]:interface' ) flist+=( local mpls ) - tblopt='-T+[select an alternate routing table to query]:routing table' + tblopt='-T+[select an alternate routing table to query]:routing table:_routing_tables' sockets+=( -l$lopt $tblopt '-B[show buffer sizes for TCP sockets]' ) routing+=( $Mopts $tblopt '-A[show the internal addresses of the routing table]' diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index afd2fe54b..9c3ddf039 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -5,7 +5,6 @@ # (which changed the behaviour of -f and added -a) # - We don't really need to keep pgopts and pkopts separate, but it seems like # it should make things a bit easier to follow -# - @todo We could complete routing tables given to -T local curcontext="$curcontext" state line ret=1 expl pgopts pkopts no typeset -A opt_args @@ -39,7 +38,7 @@ arguments=( '(-s --session)'{-s+,--session=}'[match only on specified process session IDs]: :->sid' # _signals is OK here - we do it differently below '(ss)--signal=[specify signal to send to process]: :_signals -s' - '-T+[match only on specified routing table]:routing table' + '-T+[match only on specified routing table]:routing table:_routing_tables' '(-t --terminal)'{-t+,--terminal=}'[match only on specified controlling terminals]: :_sequence _ttys -do' '(-U --uid)'{-U+,--uid=}'[match only on specified real user IDs]: :_sequence _users' '(-u --euid)'{-u+,--euid=}'[match only on specified effective user IDs]: :_sequence _users' diff --git a/Completion/Unix/Command/_ping b/Completion/Unix/Command/_ping index b371e808f..d36a0f3a9 100644 --- a/Completion/Unix/Command/_ping +++ b/Completion/Unix/Command/_ping @@ -191,7 +191,7 @@ case ${variant}:${${service#ping}:-4} in '-e[audible bell for each packet]' '-g[provide a visual display of packets received and lost]' '-T+[change TOS value]:TOS value:(critical inetcontrol lowdelay netcontrol throughput reliability ef af cs)' - '-V+[specify routing table to be used]:routing table' + '-V+[specify routing table to be used]:routing table:_routing_tables' ) ;; iputils:*) diff --git a/Completion/Unix/Command/_route b/Completion/Unix/Command/_route index 06cca8d99..95df6d936 100644 --- a/Completion/Unix/Command/_route +++ b/Completion/Unix/Command/_route @@ -135,7 +135,7 @@ case $OSTYPE in openbsd*) subcmds+=( exec 'execute a command with alternate routing table' ) args+=( - '-T+[select specified alternate routing table]:table id' + '-T+[select specified alternate routing table]:routing table:_routing_tables' ) modifiers+=( -sa diff --git a/Completion/Unix/Command/_top b/Completion/Unix/Command/_top index af3deb6c7..692df790d 100644 --- a/Completion/Unix/Command/_top +++ b/Completion/Unix/Command/_top @@ -96,7 +96,7 @@ case $OSTYPE in '-C[show command arguments as well as process name]' '-g+[filter processes by the specified string]:string' '-o+[sort process display by the specified field]:field:->sortkey' - '-T+[filter processes by the specified routing table]:routing table' + '-T+[filter processes by the specified routing table]:routing table:_routing_tables' '-U+[filter processes by the specified user]: :_users -M "L\:|-="' );; darwin*) -- cgit v1.2.3 From 57305cf245853b8b30895b41a90142dffab97e38 Mon Sep 17 00:00:00 2001 From: Peter Stephenson <p.stephenson@samsung.com> Date: Thu, 24 Mar 2022 10:37:39 +0000 Subject: 49875: completion for info -f. Use local files if there's a slash in the argument. --- ChangeLog | 4 ++++ Completion/Unix/Command/_texinfo | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 4f82451e5..21d68de57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2022-03-24 Peter Stephenson <p.stephenson@samsung.com> + * 49875: Completion/Unix/Command/_texinfo: info -f completes + both info pages by search and (if there's a slash present) local + files. Not all versions of info seem to need the slash, however. + * 49845: Doc/Zsh/options.yo: clarify that options can be local in function scope. diff --git a/Completion/Unix/Command/_texinfo b/Completion/Unix/Command/_texinfo index 7dfa32e45..2f5d0f91f 100644 --- a/Completion/Unix/Command/_texinfo +++ b/Completion/Unix/Command/_texinfo @@ -41,7 +41,7 @@ case $service in '(: -)'{-k+,--apropos=}'[look up string in indices]:search string: ' \ \*{-d+,--directory=}'[add directory to infopath]:info dir:_files -/' \ '--dribble=[record keystrokes]:file with keystrokes:_files' \ - '(-f --file 1)'{-f+,--file=}'[specify Info manual to visit]:info manual:->infofiles' \ + '(-f --file 1)'{-f+,--file=}'[specify Info manual to visit]:info manual:->infofiles+' \ '(: - -h --help)'{-h,--help}'[display usage]' \ '(-o --output -O)--index-search=[search for matching index entry]:search string:->index-entries' \ '(--index-search -o --output -O)'{-o+,--output=}'[dump selected nodes to filename]:filename:_files -g "*(-.)"' \ @@ -289,7 +289,11 @@ if [[ -n $state ]]; then items=( ${${${(M)${(f)"$(_call_program menu-items info -o-)"}:#(#s)\* *: \(*}#??}%%\)*} ) files+=( ${items##*\(} ) tags=( info-files ) - if [[ $state != infofiles ]]; then + if [[ $state = infofiles+ && $PREFIX$SUFFX = */* ]]; then + # local files allowed + tags+=(files) + fi + if [[ $state != infofiles* ]]; then tags+=( menu-items ) items=( ${items%:*} ) fi @@ -317,6 +321,7 @@ if [[ -n $state ]]; then _requested menu-items expl 'menu item' compadd -M 'm:{a-zA-Z}={A-Za-z}' -a items && ret=0 _requested -x index-entries expl 'index entry' compadd -M 'm:{a-zA-Z}={A-Za-z}' -a items && ret=0 _requested info-nodes expl 'node' compadd -M 'm:{a-zA-Z}={A-Za-z}' ${nodes#*:} && ret=0 + _requested files expl 'file' && _files -g '*.info(|.gz|.bz2)' (( ret )) || break done -- cgit v1.2.3 From 76b573fcbd3f8b6345bee945ad7f43a5c23ac74f Mon Sep 17 00:00:00 2001 From: Mikael Magnusson <mikachu@gmail.com> Date: Sun, 3 Apr 2022 18:33:57 +0200 Subject: 49961: _adb: handle exec-out like shell --- ChangeLog | 3 +++ Completion/Unix/Command/_adb | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 3b0edff7a..fcc4f4526 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ * 49957: Src/Zle/compcore.c: Brown paper bag for 49915 + * 49961: Completion/Unix/Command/_adb: _adb: handle exec-out + like shell + 2022-04-02 dana <dana@dana.is> * unposted (see 48073): Completion/Zsh/Command/_fc: Complete diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb index 1375813bb..9c0118bb7 100644 --- a/Completion/Unix/Command/_adb +++ b/Completion/Unix/Command/_adb @@ -43,6 +43,7 @@ _adb() { "disconnect" "emu" "enable-verity" + "exec-out" "forward" "get-devpath" "get-serialno" @@ -109,7 +110,7 @@ _adb_dispatch_command () { fi case ${curcontext} in - (*:adb-shell:) + (*:adb-shell:|*:adb-exec-out:) (( $+functions[_adb_dispatch_shell] )) && _adb_dispatch_shell ;; (*:adb-backup:) -- cgit v1.2.3 From 8a60e2e21414e3651745e98e52fa288aa76113e3 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson <mikachu@gmail.com> Date: Sun, 3 Apr 2022 18:33:58 +0200 Subject: 49962: _adb: Add dumpsys and cmd completion --- ChangeLog | 3 +++ Completion/Unix/Command/_adb | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index fcc4f4526..2a25a7687 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ * 49961: Completion/Unix/Command/_adb: _adb: handle exec-out like shell + * 49962: Completion/Unix/Command/_adb: _adb: Add dumpsys and + cmd completion + 2022-04-02 dana <dana@dana.is> * unposted (see 48073): Completion/Zsh/Command/_fc: Complete diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb index 9c0118bb7..c86f9cbd0 100644 --- a/Completion/Unix/Command/_adb +++ b/Completion/Unix/Command/_adb @@ -189,6 +189,12 @@ _adb_dispatch_shell () { (pm) (( $+functions[_adb_package_manager_handler] )) && _adb_package_manager_handler ;; + (cmd) + (( $+functions[_adb_cmd_handler] )) && _adb_cmd_handler + ;; + (dumpsys) + (( $+functions[_adb_dumpsys_handler] )) && _adb_dumpsys_handler + ;; (*) _arguments '*: :_adb_remote_folder' ;; @@ -319,6 +325,20 @@ _adb_package_manager_handler () { esac } +(( $+functions[_adb_cmd_handler] )) || +_adb_cmd_handler () { + local -a cmds + cmds=(${${${(f)"$(adb ${ADB_DEVICE_SPECIFICATION} exec-out cmd -l)"}[2,-1]}##[[:space:]]##}) + _wanted dumpsys expl 'cmd command' compadd ${cmds%$'\r'} +} + +(( $+functions[_adb_dumpsys_handler] )) || +_adb_dumpsys_handler () { + local -a services + services=(${${${(f)"$(adb ${ADB_DEVICE_SPECIFICATION} exec-out dumpsys -l)"}[2,-1]}##[[:space:]]##}) + _wanted dumpsys expl 'dumpsys service' compadd ${services%$'\r'} +} + (( $+functions[_adb_dispatch_uninstall] )) || _adb_dispatch_uninstall () { _arguments \ @@ -466,7 +486,7 @@ _adb_options_handler() { (( $+functions[_adb_shell_commands_handler] )) || _adb_shell_commands_handler() { local expl - _wanted adb_shell_commands expl 'adb shell command' compadd ls pm am mkdir rmdir rm cat + _wanted adb_shell_commands expl 'adb shell command' compadd ls pm am mkdir rmdir rm cat cmd dumpsys } (( $+functions[_adb_device_available] )) || -- cgit v1.2.3 From 1b62a5a0af0a189ec3acd5781f77145dcfad15ed Mon Sep 17 00:00:00 2001 From: Mikael Magnusson <mikachu@gmail.com> Date: Sun, 3 Apr 2022 18:33:59 +0200 Subject: 49963: _adb: Fix device serial completion for hostname:port syntax --- ChangeLog | 3 +++ Completion/Unix/Command/_adb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 2a25a7687..20848d875 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,9 @@ * 49962: Completion/Unix/Command/_adb: _adb: Add dumpsys and cmd completion + * 49963: Completion/Unix/Command/_adb: _adb: Fix device serial + completion for hostname:port syntax + 2022-04-02 dana <dana@dana.is> * unposted (see 48073): Completion/Zsh/Command/_fc: Complete diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb index c86f9cbd0..a429954a8 100644 --- a/Completion/Unix/Command/_adb +++ b/Completion/Unix/Command/_adb @@ -432,7 +432,7 @@ _adb_device_serial() { local expl local -a devices device_desc local device - devices=( $(adb devices -l | sed -n 's/^\([^[:space:]]*\)[[:space:]]*.*product:\([^[:space:]]*\).*$/\1:\2/p') ) + devices=( $(adb devices -l | sed -n -e 's/:/\\:/' -e 's/^\([^[:space:]]*\)[[:space:]]*.*product:\([^[:space:]]*\).*$/\1:\2/p') ) zstyle -a :completion:${curcontext} device-names device_desc for device in $device_desc; do if [[ -n $devices[(r)${device%:*}:*] ]]; then -- cgit v1.2.3 From a07d0109813fc8ec1722e19d759c417f7b456580 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson <mikachu@gmail.com> Date: Sun, 3 Apr 2022 18:34:00 +0200 Subject: 49964: _adb: Complete services for start/stop --- ChangeLog | 3 +++ Completion/Unix/Command/_adb | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 20848d875..2e40bfa20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,9 @@ * 49963: Completion/Unix/Command/_adb: _adb: Fix device serial completion for hostname:port syntax + * 49964: Completion/Unix/Command/_adb: _adb: Complete services + for start/stop + 2022-04-02 dana <dana@dana.is> * unposted (see 48073): Completion/Zsh/Command/_fc: Complete diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb index a429954a8..8d3eec542 100644 --- a/Completion/Unix/Command/_adb +++ b/Completion/Unix/Command/_adb @@ -195,6 +195,9 @@ _adb_dispatch_shell () { (dumpsys) (( $+functions[_adb_dumpsys_handler] )) && _adb_dumpsys_handler ;; + (start|stop) + (( $+functions[_adb_startstop] )) && _adb_startstop ${words[2]} + ;; (*) _arguments '*: :_adb_remote_folder' ;; @@ -339,6 +342,17 @@ _adb_dumpsys_handler () { _wanted dumpsys expl 'dumpsys service' compadd ${services%$'\r'} } +(( $+functions[_adb_startstop] )) || +_adb_startstop () { + local -a services + local -A service_status + services=(${(f)"$(adb ${ADB_DEVICE_SPECIFICATION} exec-out getprop)"}) + service_status=( ${(s,: ,)${(j,: ,)${(M)services:#\[init.svc.*}}} ) + local -A map=(start stopped stop running) + services=( ${(k)service_status[(R)*$map[$1]*]} ) + _wanted services expl "$map[$1] services" compadd - ${${${services#\[}%\]}#init.svc.} +} + (( $+functions[_adb_dispatch_uninstall] )) || _adb_dispatch_uninstall () { _arguments \ @@ -486,7 +500,7 @@ _adb_options_handler() { (( $+functions[_adb_shell_commands_handler] )) || _adb_shell_commands_handler() { local expl - _wanted adb_shell_commands expl 'adb shell command' compadd ls pm am mkdir rmdir rm cat cmd dumpsys + _wanted adb_shell_commands expl 'adb shell command' compadd ls pm am mkdir rmdir rm cat cmd dumpsys start stop } (( $+functions[_adb_device_available] )) || -- cgit v1.2.3 From 6900dded09ddfdfda14c68093256db9021720d23 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson <mikachu@gmail.com> Date: Sun, 3 Apr 2022 18:34:01 +0200 Subject: 49965: _adb: use $CURRENT instead of $#words --- ChangeLog | 3 +++ Completion/Unix/Command/_adb | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 2e40bfa20..dc7b1174b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,9 @@ * 49964: Completion/Unix/Command/_adb: _adb: Complete services for start/stop + * 49965: Completion/Unix/Command/_adb: _adb: use $CURRENT instead + of $#words + 2022-04-02 dana <dana@dana.is> * unposted (see 48073): Completion/Zsh/Command/_fc: Complete diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb index 8d3eec542..b8b2470a6 100644 --- a/Completion/Unix/Command/_adb +++ b/Completion/Unix/Command/_adb @@ -176,7 +176,7 @@ _adb_device_specification () { (( $+functions[_adb_dispatch_shell] )) || _adb_dispatch_shell () { - if [[ ${#words} -le 2 ]] + if [[ $CURRENT -le 2 ]] then (( $+functions[_adb_shell_commands_handler] )) && _adb_shell_commands_handler return @@ -272,7 +272,7 @@ _adb_intent_handler () { (( $+functions[_adb_activity_manager_handler] )) || _adb_activity_manager_handler () { - if [[ ${#words} -le 3 ]] + if [[ $CURRENT -le 3 ]] then _wanted am_argument expl 'am argument' compadd start startservice broadcast instrument profile return @@ -379,12 +379,12 @@ _adb_dispatch_install () { (( $+functions[_adb_dispatch_push] )) || _adb_dispatch_push () { - if [[ ${#words} -gt 3 ]] + if [[ $CURRENT -gt 3 ]] then _message -r "Notice: you can only push a single item at a time" return fi - if [[ ${#words} -gt 2 ]] + if [[ $CURRENT -gt 2 ]] then _arguments '*: :_adb_remote_folder' else @@ -394,12 +394,12 @@ _adb_dispatch_push () { (( $+functions[_adb_dispatch_pull] )) || _adb_dispatch_pull () { - if [[ ${#words} -gt 3 ]] + if [[ $CURRENT -gt 3 ]] then _message -r "Notice: you can only pull a single item at a time" return fi - if [[ ${#words} -gt 2 ]] + if [[ $CURRENT -gt 2 ]] then _arguments '*:local file/folder:_files' else -- cgit v1.2.3 From 853773820766a69d7a15c1c0349e6d24de553322 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson <mikachu@gmail.com> Date: Sun, 3 Apr 2022 18:34:02 +0200 Subject: 49966: _adb: Parse device spec correctly This was particularly annoying when trying to complete logtags after adb logcat -s --- ChangeLog | 3 +++ Completion/Unix/Command/_adb | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index dc7b1174b..49708d7d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,9 @@ * 49965: Completion/Unix/Command/_adb: _adb: use $CURRENT instead of $#words + * 49966: Completion/Unix/Command/_adb: _adb: Parse device spec + correctly + 2022-04-02 dana <dana@dana.is> * unposted (see 48073): Completion/Zsh/Command/_fc: Complete diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb index b8b2470a6..b31b84c89 100644 --- a/Completion/Unix/Command/_adb +++ b/Completion/Unix/Command/_adb @@ -82,6 +82,7 @@ _adb() { if ! adb ${ADB_DEVICE_SPECIFICATION} shell exit 2>/dev/null; then # early bail-out until a single valid device/emulator is specified and up-and-running [[ $words[CURRENT-1] = -s ]] || _message -r "No (started) device specified, completions do not yet work" + #TODO handle -t transport-id _arguments \ '-s[serial]: :_adb_device_serial' \ '( -e)-d[device]' \ @@ -165,13 +166,11 @@ _adb_sanitize_context () { (( $+functions[_adb_device_specification] )) || _adb_device_specification () { - local -a word - word=($words[(R)-[des]]) - if [[ $words[(R)-s] == -s ]]; then - local i=$words[(I)-s] - word=($words[i,i+1]) + if [[ $words[2] == -[de] ]]; then + ADB_DEVICE_SPECIFICATION=($words[2]) + elif [[ $words[2] == -[st] ]]; then + ADB_DEVICE_SPECIFICATION=($words[2,3]) fi - ADB_DEVICE_SPECIFICATION=($word) } (( $+functions[_adb_dispatch_shell] )) || -- cgit v1.2.3 From 4d8f36704e0a9fbbc5343a8c1945f1d54360ee53 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson <mikachu@gmail.com> Date: Sun, 3 Apr 2022 18:34:02 +0200 Subject: 49967: _adb: Handle dumpsys SurfaceFlinger arguments --- ChangeLog | 3 +++ Completion/Unix/Command/_adb | 54 +++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 54 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 49708d7d8..6213ea597 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,9 @@ * 49966: Completion/Unix/Command/_adb: _adb: Parse device spec correctly + * 49967: Completion/Unix/Command/_adb: _adb: Handle dumpsys + SurfaceFlinger arguments + 2022-04-02 dana <dana@dana.is> * unposted (see 48073): Completion/Zsh/Command/_fc: Complete diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb index b31b84c89..5e7fbf8d0 100644 --- a/Completion/Unix/Command/_adb +++ b/Completion/Unix/Command/_adb @@ -336,9 +336,57 @@ _adb_cmd_handler () { (( $+functions[_adb_dumpsys_handler] )) || _adb_dumpsys_handler () { - local -a services - services=(${${${(f)"$(adb ${ADB_DEVICE_SPECIFICATION} exec-out dumpsys -l)"}[2,-1]}##[[:space:]]##}) - _wanted dumpsys expl 'dumpsys service' compadd ${services%$'\r'} + if [[ $CURRENT -eq 3 ]]; then + local -a services + services=(${${${(f)"$(adb ${ADB_DEVICE_SPECIFICATION} exec-out dumpsys -l)"}[2,-1]}##[[:space:]]##}) + _wanted dumpsys expl 'dumpsys service' compadd - ${services%$'\r'} + elif [[ $CURRENT -ge 4 && $words[3] == SurfaceFlinger ]]; then + (( CURRENT -= 2 )) + shift 2 words + typeset -A opt_args + local context state state_descr line + _arguments -R \ + '--file[start/stop continuous dumpsys to file]' \ + '--no-limit[disable wrapping around continuous dumpsys at ~20MB]' \ + '--full-dump[set fullDump = true]' \ + '--allocated_buffers[show allocated buffers dump]' \ + '--display-id[show display id dump]' \ + '--dispsync[show dispsync dump]' \ + '--edid[raw edid dump for specified hwc display (binary output)]:*:hwc display:->hwcdisplay' \ + '--latency[show latency stats]:*:layer:->layer' \ + '--latency-clear[clear latency stats]:*:layer:->layer' \ + '--list[list all layers]' \ + '--planner[pass planner dump arguments]:*:planner arguments:->planner' \ + '--static-screen[show static screen stats]' \ + '--timestats[pass time stats arguments]:*:timestats arguments:->timestats' \ + '--vsync[show vsync dump]' \ + '--wide-color[show wide color info]' \ + '--frametimeline[pass frametimeline arguments]:*:frametimeline arguments:->frametimeline' \ + '--mini[show mini dump]' + if [[ $? == 300 ]]; then + case $state in + layer) + typeset -a layers + layers=(${${(f)"$(adb ${ADB_DEVICE_SPECIFICATION} exec-out dumpsys SurfaceFlinger --list)"}[2,-1]}) + _wanted dumpsys expl 'layers' compadd - ${layers%$'\r'} + ;; + planner) + _arguments \ + {--compare,-c}'[compare predictions of two hashes]:left: :right: :' \ + {--describe,-d}'[describe hash]:hash: :' \ + {--help,-h}'[help]' \ + {--similar,-s}'[show similar stacks matching given plan]:plan: :' \ + {--layers,-l}'[show current layers]' + ;; + timestats) + _arguments -disable -enable -clear -dump -maxlayers'[only with -dump]:int:' + ;; + frametimeline) + _arguments -jank -all + ;; + esac + fi + fi } (( $+functions[_adb_startstop] )) || -- cgit v1.2.3 From 29f97c1f9447335c8f088f1cf809d90004e78053 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson <mikachu@gmail.com> Date: Sun, 3 Apr 2022 18:34:03 +0200 Subject: 49968: _adb: also replace model names, since device names aren't sent on wifi listing --- ChangeLog | 3 +++ Completion/Unix/Command/_adb | 2 ++ 2 files changed, 5 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 6213ea597..cde6bfc2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,9 @@ * 49967: Completion/Unix/Command/_adb: _adb: Handle dumpsys SurfaceFlinger arguments + * 49968: Completion/Unix/Command/_adb: _adb: also replace model + names, since device names aren't sent on wifi listing + 2022-04-02 dana <dana@dana.is> * unposted (see 48073): Completion/Zsh/Command/_fc: Complete diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb index 5e7fbf8d0..8a071fa8e 100644 --- a/Completion/Unix/Command/_adb +++ b/Completion/Unix/Command/_adb @@ -498,6 +498,8 @@ _adb_device_serial() { for device in $device_desc; do if [[ -n $devices[(r)${device%:*}:*] ]]; then devices[(i)${device%:*}:*]=$device + elif [[ -n $devices[(r)*:${device%:*}] ]]; then + devices[(i)*:${device%:*}]=${${devices[(r)*:${device%:*}]}%:*}:${device#*:} fi done _describe -t dev_serial 'available device' devices -- cgit v1.2.3