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/_git') 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/_git') 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 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/_git') 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 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/_git') 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/_git') 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 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/_git') 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/_git') 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/_git') 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/_git') 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/_git') 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/_git') 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 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/_git') 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 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/_git') 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 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/_git') 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 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/_git') 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 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/_git') 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/_git') 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 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/_git') 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 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/_git') 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 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/_git') 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 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/_git') 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