From 9cb8c3f4b5d9918028791d975cf3aa7d745b4b22 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Sun, 13 Sep 2015 02:02:59 +0200 Subject: 36523: Completion/…/_gphoto2: Replace --delete-files with --delete-file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Completion/Unix/Command/_gphoto2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/Completion/Unix/Command/_gphoto2 b/Completion/Unix/Command/_gphoto2 index 95d8a49b7..314d83e3a 100644 --- a/Completion/Unix/Command/_gphoto2 +++ b/Completion/Unix/Command/_gphoto2 @@ -32,7 +32,7 @@ _arguments -s \ '--get-all-raw-data[get all raw data from folder]' \ '--get-audio-data[get audio data given in range]:range' \ '--get-all-audio-data[get all audio data from folder]' \ - '--delete-files[delete files given in range]:range' \ + '--delete-file[delete files given in range]:range' \ '--delete-all-files[delete all files in folder]' \ '(-u --upload-file)'{-u,--upload-file}'[upload a file to camera]:file:_files' \ '--capture-preview[capture a quick preview]' \ -- cgit v1.2.3 From 05ec830c943378baf8b9feeb69b97ba6c8eaf257 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Mon, 21 Sep 2015 21:08:29 +0900 Subject: 36574: new completion for the lldb debbuger --- Completion/Unix/Command/_lldb | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Completion/Unix/Command/_lldb (limited to 'Completion/Unix/Command') diff --git a/Completion/Unix/Command/_lldb b/Completion/Unix/Command/_lldb new file mode 100644 index 000000000..16e346cfb --- /dev/null +++ b/Completion/Unix/Command/_lldb @@ -0,0 +1,55 @@ +#compdef lldb + +local curcontext=$curcontext state state_descr line expl ret=1 +typeset -A opt_args +local -a args + +args=( + '*'{-o+,--one-line=}'[run one-line lldb command after loading executable]:lldb command: ' + '*'{-s+,--source=}'[run lldb commands from a file after loading executable]:file:_files' + '*'{-O+,--one-line-before-file=}'[run one-line lldb command before loading executable]:lldb command' + '*'{-S+,--source-before-file=}'[run lldb commands from a file before loading executable]:file:_files' + '(-k --one-line-on-crash)'{-k+,--one-line-on-crash=}'[run one-line lldb command if target crashes in batch mode]:lldb command' + '(-K --source-on-crash)'{-K+,--source-on-crash=}'[run lldb commands from a file if target crashes in batch mode]:file:_files' + '(-b --batch)'{-b,--batch}'[run commands from -s -S -o -O and quit]' + '(-Q --source-quietly)'{-Q,--source-quietly}'[suppress output from -s, -S, -o or -O]' + '(-e --editor)'{-e,--editor}'[open source files using "external editor" mechanism]' + '(-x --no-lldbinit)'{-x,--no-lldbinit}'[do not automatically parse .lldbinit files]' + '(-X --no-use-colors)'{-X,--no-use-colors}'[do not use colors]' + '(-d --debug)'{-d,--debug}'[print extra information for debugging itself]' + '(-r --repl)'{-r,--repl}'[run lldb in REPL mode]' + '(-l --script-language)'{-l+,--script-language=}'[use the specified scripting language]:language:(Python Perl Ruby Tcl)' + - info + '(-)'{-h,--help}'[print the usage information]' + '(-)'{-v,--version}'[print the current version number]' + '(-)'{-P,--python-path}'[print path to the lldb.py file]' + - file + '(-f --file)'{-f+,--file=}'[specify executable file to debug]:executable:_files -g "*(-*)"' + '(-a --arch)'{-a+,--arch=}'[use the specified architecture]:arch' + '(-c --core)'{-c+,--core=}'[specify core file to open]:core file:_files -g "*core*(-.)"' + '*::executable and arguments:->exe_args' + - name + '(-n --attach-name)'{-n+,--attach-name=}'[attach to the named process]:process name' + '(-w --wait-for)'{-w,--wait-for}'[wait for the specified process to launch]' + - pid + '(-p --attach-pid)'{-p+,--attach-pid=}'[attach to the specified process]:pid:_pids' +) + +_arguments -C -s -S : $args && return 0 + +case $state in + (exe_args) + if [[ -z $opt_args[(I)file-(-f|--file)] ]]; then + if [[ $CURRENT -eq 1 ]]; then + _wanted executables expl 'executable' _files -g '*(-*)' && ret=0 + else + _normal && ret=0 + fi + else + words=( ${(v)opt_args[(i)file-(-f|--file)]} "$words[@]" ) + (( CURRENT++ )) + _normal && ret=0 + fi +esac + +return ret -- cgit v1.2.3 From 9b35a04f98300469ad33b44849920c4c3cb2d986 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Mon, 21 Sep 2015 21:38:41 +0900 Subject: 36556: complete two or more options for zsh --- ChangeLog | 8 ++++++++ Completion/Unix/Command/_sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index f59377031..b6755caac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2015-09-21 Jun-ichi Takimoto + + * 36574: Completion/Unix/Command/_lldb: new completion for + the lldb debugger + + * 36556: Completion/Unix/Command/_sh: remove unnecessary + helpspec to '_argument --' + 2015-09-21 Peter Stephenson * unposted: Src/zsh.h: typo in 36559. diff --git a/Completion/Unix/Command/_sh b/Completion/Unix/Command/_sh index 21ebfc3b2..1b5112212 100644 --- a/Completion/Unix/Command/_sh +++ b/Completion/Unix/Command/_sh @@ -24,6 +24,6 @@ fi local ret=$? -[[ $service == zsh ]] && _arguments -S -s -- '*:' && ret=0 +[[ $service == zsh ]] && _arguments -S -s -- && ret=0 return ret -- cgit v1.2.3 From d4a640775f8e6aad3a32a2ebcf4d049d728a9e8b Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 21 Sep 2015 14:41:40 +0200 Subject: 36575: _tmux: ‘lock-server’ option is gone in tmux.git MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog | 5 +++++ Completion/Unix/Command/_tmux | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index b6755caac..29d45e721 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-09-21 Frank Terbeck + + * 36575: Completion/Unix/Command/_tmux: _tmux: ‘lock-server’ + option is gone in tmux.git + 2015-09-21 Jun-ichi Takimoto * 36574: Completion/Unix/Command/_lldb: new completion for diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 49c2b63ed..3d4734bcd 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1270,7 +1270,6 @@ function __tmux-option-guard() { 'history-limit:'${int_guard} 'lock-after-time:'${int_guard} 'lock-command:MSG:command string' - 'lock-server:DESC:on off' 'message-command-style:__tmux-style' 'message-style:__tmux-style' 'mouse:DESC:on off' @@ -1394,7 +1393,6 @@ function __tmux-session-options() { 'history-limit:number of copy-mode lines per window' 'lock-after-time:lock sessions after N seconds' 'lock-command:command to run for locking a client' - 'lock-server:make lock-after-time lock the server instead of sessions' 'message-command-style:status line message command style' 'message-style:status line message style' 'mouse:enable mouse support' -- cgit v1.2.3 From 5476e011f16664e601092c1e94e3332efe80720f Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 21 Sep 2015 14:41:41 +0200 Subject: 36576: _tmux: Fix tmux homepage URI --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 29d45e721..221f57fbd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * 36575: Completion/Unix/Command/_tmux: _tmux: ‘lock-server’ option is gone in tmux.git + * 36576: Completion/Unix/Command/_tmux: _tmux: Fix tmux homepage + URI + 2015-09-21 Jun-ichi Takimoto * 36574: Completion/Unix/Command/_lldb: new completion for diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 3d4734bcd..6f2cac790 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1,6 +1,6 @@ #compdef tmux -# tmux completion for zsh . +# tmux completion for zsh . # # Configuration: # -- cgit v1.2.3 From 1aafc028b392ae85f6670a1c0b8cf00da975e304 Mon Sep 17 00:00:00 2001 From: Christoph Mathys Date: Thu, 24 Sep 2015 16:12:27 +0000 Subject: 36613: _hg: extend completion for hg push to support branch and bookmark --- ChangeLog | 5 +++++ Completion/Unix/Command/_hg | 11 +++++++++++ 2 files changed, 16 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index e5044931f..dcecc8031 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-09-24 Christoph Mathys + + * 36613: Completion/Unix/Command/_hg: _hg: extend completion + for hg push to support branch and bookmark + 2015-09-23 Barton E. Schaefer * 36604: Functions/Misc/zrecompile: fix getopts+shift calculation diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg index e7c21b9d1..2db5c55a5 100644 --- a/Completion/Unix/Command/_hg +++ b/Completion/Unix/Command/_hg @@ -176,6 +176,13 @@ _hg_bookmarks_internal() { _wanted bookmarks expl 'bookmarks' compadd -a - hgbookmarks } +_hg_branches_internal() { + local expl + typeset -a hgbranches + hgbranches=( ${(f)"$(_hg_cmd branches -q 2>/dev/null)"} ) + _wanted branches expl 'branches' compadd -a - hgbranches +} + _hg_tags() { _alternative \ 'bookmarks:bookmark:_hg_bookmarks_internal' \ @@ -659,6 +666,10 @@ _hg_cmd_push() { _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ '(--force -f)'{-f,--force}'[force push]' \ '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_tags' \ + '*'{-B,--bookmark=}'[bookmark to push]:bookmark:_hg_bookmarks_internal' \ + '*'{-b,--branch=}'[branch to push]:branch:_hg_branches_internal' \ + '--insecure[do not verify server certificate]' \ + '--new-branch[allow pushing a new branch]' \ ':destination:_hg_remote' } -- cgit v1.2.3 From 4c935b9f85d25999a2ff9844274827f7905380f3 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 24 Sep 2015 16:15:15 +0000 Subject: unposted: _hg: Declare $expl as an array --- ChangeLog | 5 +++++ Completion/Unix/Command/_hg | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index dcecc8031..80a7d19c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-09-24 Daniel Shahaf + + * unposted: Completion/Unix/Command/_hg: _hg: Declare $expl as + an array + 2015-09-24 Christoph Mathys * 36613: Completion/Unix/Command/_hg: _hg: extend completion diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg index 2db5c55a5..9dd023653 100644 --- a/Completion/Unix/Command/_hg +++ b/Completion/Unix/Command/_hg @@ -163,21 +163,21 @@ _hg_revrange() { } _hg_tags_internal() { - local expl + local -a expl typeset -a hgtags hgtags=( ${(f)"$(_hg_cmd tags -q 2>/dev/null)"} ) _wanted tags expl 'tags' compadd -a - hgtags } _hg_bookmarks_internal() { - local expl + local -a expl typeset -a hgbookmarks hgbookmarks=( ${(f)"$(_hg_cmd bookmarks -q 2>/dev/null)"} ) _wanted bookmarks expl 'bookmarks' compadd -a - hgbookmarks } _hg_branches_internal() { - local expl + local -a expl typeset -a hgbranches hgbranches=( ${(f)"$(_hg_cmd branches -q 2>/dev/null)"} ) _wanted branches expl 'branches' compadd -a - hgbranches -- cgit v1.2.3 From 61fa5f66f05c85e290d50df860708e80221011c9 Mon Sep 17 00:00:00 2001 From: Christoph Mathys Date: Fri, 25 Sep 2015 23:19:44 +0000 Subject: 36626: _hg: completion for 'hg bookmarks' --- ChangeLog | 5 +++++ Completion/Unix/Command/_hg | 10 ++++++++++ 2 files changed, 15 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 7055836fa..71788378d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-09-25 Christoph Mathys + + * 36626: Completion/Unix/Command/_hg: _hg: completion for + 'hg bookmarks' + 2015-09-25 Peter Stephenson * 36630: Doc/Zsh/contrib.yo, Doc/Zsh/manual.yo, diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg index 9dd023653..5d4c9852b 100644 --- a/Completion/Unix/Command/_hg +++ b/Completion/Unix/Command/_hg @@ -460,6 +460,16 @@ _hg_cmd_bisect() { '(--command -c --noupdate -U)'{-U,--noupdate}'[do not update to target]' } +_hg_cmd_bookmarks() { + _arguments -s : $_hg_global_opts \ + '(--force -f)'{-f,--force}'[force]' \ + '(--rev -r)'{-r+,--rev=}'[set bookmark at revision]:revision:_hg_tags' \ + '(--delete -d)'{-d,--delete}'[delete a given bookmark]' \ + '(--rename -m)'{-m+,--rename}'[rename given bookmark]:bookmark:_hg_bookmarks_internal' \ + '(--inactive -i)'{-i,--inactive}'[mark a bookmark inactive]' \ + ':bookmark:_hg_bookmarks_internal' +} + _hg_cmd_branch() { _arguments -s -w : $_hg_global_opts \ '(--force -f)'{-f,--force}'[set branch name even if it shadows an existing branch]' \ -- cgit v1.2.3 From 92584634d3d39e9ca64475ae5af8010e2ccebe24 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 26 Sep 2015 00:19:59 +0000 Subject: unposted (see 36633): _hg: Enable --option=value syntax and disable '-xy Xarg Yarg' syntax This simply removes the '-w' argument to _arguments and changes {-x+,--foo} to {-x+,--foo=} throughout the file. --- ChangeLog | 5 + Completion/Unix/Command/_hg | 252 ++++++++++++++++++++++---------------------- 2 files changed, 131 insertions(+), 126 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index fbd7c3a00..f700ec067 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-09-26 Daniel Shahaf + + * unposted (see 36633): Completion/Unix/Command/_hg: _hg: + Enable --option=value syntax and disable '-xy Xarg Yarg' syntax + 2015-09-25 Daniel Shahaf * unposted: Src/Zle/zle_tricky.c Src/Zle/zle_utils.c: zle: diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg index 5d4c9852b..8d31cd377 100644 --- a/Completion/Unix/Command/_hg +++ b/Completion/Unix/Command/_hg @@ -359,7 +359,7 @@ _hg_clone_dest() { # Common options _hg_global_opts=( - '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/' + '(--repository -R)'{-R+,--repository=}'[repository root directory]:repository:_files -/' '--cwd[change working directory]:new working directory:_files -/' '(--noninteractive -y)'{-y,--noninteractive}'[do not prompt, assume yes for any required answers]' '(--verbose -v)'{-v,--verbose}'[enable additional output]' @@ -378,8 +378,8 @@ _hg_global_opts=( ) _hg_pat_opts=( - '*'{-I+,--include}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/' - '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/') + '*'{-I+,--include=}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/' + '*'{-X+,--exclude=}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/') _hg_diff_opts=( '(--text -a)'{-a,--text}'[treat all files as text]' @@ -395,11 +395,11 @@ _hg_style_opts=( _hg_commit_opts=( '(-m --message -l --logfile --edit -e)'{-e,--edit}'[edit commit message]' - '(-e --edit -l --logfile --message -m)'{-m+,--message}'[use as commit message]:message:' - '(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from ]:log file:_files') + '(-e --edit -l --logfile --message -m)'{-m+,--message=}'[use as commit message]:message:' + '(-e --edit -m --message --logfile -l)'{-l+,--logfile=}'[read the commit message from ]:log file:_files') _hg_remote_opts=( - '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:' + '(--ssh -e)'{-e+,--ssh=}'[specify ssh command to use]:' '--remotecmd[specify hg command to run on the remote side]:') _hg_cmd() { @@ -408,19 +408,19 @@ _hg_cmd() { } _hg_cmd_add() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ + _arguments -s : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ '*:unknown files:_hg_unknown' } _hg_cmd_addremove() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ - '(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \ + _arguments -s : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ + '(--similarity -s)'{-s+,--similarity=}'[guess renamed files by similarity (0<=s<=100)]:' \ '*:unknown or missing files:_hg_addremove' } _hg_cmd_annotate() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '(--rev -r)'{-r+,--rev}'[annotate the specified revision]:revision:_hg_tags' \ + _arguments -s : $_hg_global_opts $_hg_pat_opts \ + '(--rev -r)'{-r+,--rev=}'[annotate the specified revision]:revision:_hg_tags' \ '(--follow -f)'{-f,--follow}'[follow file copies and renames]' \ '(--text -a)'{-a,--text}'[treat all files as text]' \ '(--user -u)'{-u,--user}'[list the author]' \ @@ -431,32 +431,32 @@ _hg_cmd_annotate() { } _hg_cmd_archive() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + _arguments -s : $_hg_global_opts $_hg_pat_opts \ '--no-decode[do not pass files through decoders]' \ - '(--prefix -p)'{-p+,--prefix}'[directory prefix for files in archive]:' \ - '(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_tags' \ - '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \ + '(--prefix -p)'{-p+,--prefix=}'[directory prefix for files in archive]:' \ + '(--rev -r)'{-r+,--rev=}'[revision to distribute]:revision:_hg_tags' \ + '(--type -t)'{-t+,--type=}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \ '*:destination:_files' } _hg_cmd_backout() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + _arguments -s : $_hg_global_opts $_hg_pat_opts \ '--merge[merge with old dirstate parent after backout]' \ - '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ + '(--date -d)'{-d+,--date=}'[record datecode as commit date]:date code:' \ '--parent[parent to choose when backing out merge]' \ - '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ - '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ - '(--message -m)'{-m+,--message}'[specify commit message]:text' \ - '(--logfile -l)'{-l+,--logfile}'[read commit message from specified file]:log file:_files' + '(--user -u)'{-u+,--user=}'[record user as commiter]:user:' \ + '(--rev -r)'{-r+,--rev=}'[revision]:revision:_hg_tags' \ + '(--message -m)'{-m+,--message=}'[specify commit message]:text' \ + '(--logfile -l)'{-l+,--logfile=}'[read commit message from specified file]:log file:_files' } _hg_cmd_bisect() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(-)'{-r,--reset}'[reset bisect state]' \ '(--good -g --bad -b --skip -s --reset -r)'{-g,--good}'[mark changeset good]'::revision:_hg_tags \ '(--good -g --bad -b --skip -s --reset -r)'{-b,--bad}'[mark changeset bad]'::revision:_hg_tags \ '(--good -g --bad -b --skip -s --reset -r)'{-s,--skip}'[skip testing changeset]' \ - '(--command -c --noupdate -U)'{-c+,--command}'[use command to check changeset state]':commands:_command_names \ + '(--command -c --noupdate -U)'{-c+,--command=}'[use command to check changeset state]':commands:_command_names \ '(--command -c --noupdate -U)'{-U,--noupdate}'[do not update to target]' } @@ -465,24 +465,24 @@ _hg_cmd_bookmarks() { '(--force -f)'{-f,--force}'[force]' \ '(--rev -r)'{-r+,--rev=}'[set bookmark at revision]:revision:_hg_tags' \ '(--delete -d)'{-d,--delete}'[delete a given bookmark]' \ - '(--rename -m)'{-m+,--rename}'[rename given bookmark]:bookmark:_hg_bookmarks_internal' \ + '(--rename -m)'{-m+,--rename=}'[rename given bookmark]:bookmark:_hg_bookmarks_internal' \ '(--inactive -i)'{-i,--inactive}'[mark a bookmark inactive]' \ ':bookmark:_hg_bookmarks_internal' } _hg_cmd_branch() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--force -f)'{-f,--force}'[set branch name even if it shadows an existing branch]' \ '(--clean -C)'{-C,--clean}'[reset branch name to parent branch name]' } _hg_cmd_branches() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--active -a)'{-a,--active}'[show only branches that have unmerge heads]' } _hg_cmd_bundle() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ + _arguments -s : $_hg_global_opts $_hg_remote_opts \ '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \ '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_tags' \ ':output file:_files' \ @@ -490,33 +490,33 @@ _hg_cmd_bundle() { } _hg_cmd_cat() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ - '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ + _arguments -s : $_hg_global_opts $_hg_pat_opts \ + '(--output -o)'{-o+,--output=}'[print output to file with formatted name]:filespec:' \ + '(--rev -r)'{-r+,--rev=}'[revision]:revision:_hg_tags' \ '*:file:_hg_files' } _hg_cmd_clone() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ + _arguments -s : $_hg_global_opts $_hg_remote_opts \ '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \ - '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \ + '(--rev -r)'{-r+,--rev=}'[a changeset you would like to have after cloning]:' \ '--uncompressed[use uncompressed transfer (fast over LAN)]' \ ':source repository:_hg_remote' \ ':destination:_hg_clone_dest' } _hg_cmd_commit() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + _arguments -s : $_hg_global_opts $_hg_pat_opts \ '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \ - '(--message -m)'{-m+,--message}'[specify commit message]:text' \ - '(--logfile -l)'{-l+,--logfile}'[read commit message from specified file]:log file:_files' \ - '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ - '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ + '(--message -m)'{-m+,--message=}'[specify commit message]:text' \ + '(--logfile -l)'{-l+,--logfile=}'[read commit message from specified file]:log file:_files' \ + '(--date -d)'{-d+,--date=}'[record datecode as commit date]:date code:' \ + '(--user -u)'{-u+,--user=}'[record user as commiter]:user:' \ '*:file:_hg_committable' } _hg_cmd_copy() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ + _arguments -s : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ '(--after -A)'{-A,--after}'[record a copy that has already occurred]' \ '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ '*:file:_hg_files' @@ -524,8 +524,8 @@ _hg_cmd_copy() { _hg_cmd_diff() { typeset -A opt_args - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \ - '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \ + _arguments -s : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \ + '*'{-r+,--rev=}'[revision]:revision:_hg_revrange' \ '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \ '(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]' \ '(--ignore-space-change -b)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \ @@ -544,99 +544,99 @@ _hg_cmd_diff() { } _hg_cmd_export() { - _arguments -s -w : $_hg_global_opts $_hg_diff_opts \ + _arguments -s : $_hg_global_opts $_hg_diff_opts \ '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ '--switch-parent[diff against the second parent]' \ '*:revision:_hg_tags' } _hg_cmd_grep() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + _arguments -s : $_hg_global_opts $_hg_pat_opts \ '(--print0 -0)'{-0,--print0}'[end filenames with NUL]' \ '--all[print all revisions with matches]' \ '(--follow -f)'{-f,--follow}'[follow changeset or file history]' \ '(--ignore-case -i)'{-i,--ignore-case}'[ignore case when matching]' \ '(--files-with-matches -l)'{-l,--files-with-matches}'[print only filenames and revs that match]' \ '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \ - '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \ + '*'{-r+,--rev=}'[search in given revision range]:revision:_hg_revrange' \ '(--user -u)'{-u,--user}'[print user who committed change]' \ '1:search pattern:' \ '*:files:_hg_files' } _hg_cmd_heads() { - _arguments -s -w : $_hg_global_opts $_hg_style_opts \ - '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_tags' + _arguments -s : $_hg_global_opts $_hg_style_opts \ + '(--rev -r)'{-r+,--rev=}'[show only heads which are descendants of rev]:revision:_hg_tags' } _hg_cmd_help() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '*:mercurial command:_hg_commands' } _hg_cmd_identify() { - _arguments -s -w : $_hg_global_opts \ - '(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_tags' \ - '(--num -n)'{-n+,--num}'[show local revision number]' \ - '(--id -i)'{-i+,--id}'[show global revision id]' \ - '(--branch -b)'{-b+,--branch}'[show branch]' \ - '(--tags -t)'{-t+,--tags}'[show tags]' + _arguments -s : $_hg_global_opts \ + '(--rev -r)'{-r+,--rev=}'[identify the specified rev]:revision:_hg_tags' \ + '(--num -n)'{-n+,--num=}'[show local revision number]' \ + '(--id -i)'{-i+,--id=}'[show global revision id]' \ + '(--branch -b)'{-b+,--branch=}'[show branch]' \ + '(--tags -t)'{-t+,--tags=}'[show tags]' } _hg_cmd_import() { - _arguments -s -w : $_hg_global_opts \ - '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \ - '(--message -m)'{-m+,--message}'[use as commit message]:text:' \ + _arguments -s : $_hg_global_opts \ + '(--strip -p)'{-p+,--strip=}'[directory strip option for patch (default: 1)]:count:' \ + '(--message -m)'{-m+,--message=}'[use as commit message]:text:' \ '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \ '*:patch:_files' } _hg_cmd_incoming() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ + _arguments -s : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ '(--patch -p)'{-p,--patch}'[show patch]' \ - '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \ + '(--rev -r)'{-r+,--rev=}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \ '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ '--bundle[file to store the bundles into]:bundle file:_files' \ ':source:_hg_remote' } _hg_cmd_init() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ + _arguments -s : $_hg_global_opts $_hg_remote_opts \ ':dir:_files -/' } _hg_cmd_locate() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ - '(--rev -r)'{-r+,--rev}'[search repository as it stood at revision]:revision:_hg_tags' \ + _arguments -s : $_hg_global_opts $_hg_pat_opts \ + '(--rev -r)'{-r+,--rev=}'[search repository as it stood at revision]:revision:_hg_tags' \ '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ '(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \ '*:search pattern:_hg_files' } _hg_cmd_log() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_style_opts \ + _arguments -s : $_hg_global_opts $_hg_pat_opts $_hg_style_opts \ '(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \ '(-f --follow)--follow-first[only follow the first parent of merge changesets]' \ '(--copies -C)'{-C,--copies}'[show copied files]' \ - '(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \ - '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ + '(--keyword -k)'{-k+,--keyword=}'[search for a keyword]:' \ + '(--limit -l)'{-l+,--limit=}'[limit number of changes displayed]:' \ '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \ '(--no-merges -M)'{-M,--no-merges}'[do not show merges]' \ '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \ '(--patch -p)'{-p,--patch}'[show patch]' \ - '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_tags' \ + '(--prune -P)'{-P+,--prune=}'[do not display revision or any of its ancestors]:revision:_hg_tags' \ '*:files:_hg_files' } _hg_cmd_manifest() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ ':revision:_hg_tags' } _hg_cmd_merge() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \ '(--rev -r 1)'{-r,--rev}'[revision to merge]:revision:_hg_mergerevs' \ '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \ @@ -644,38 +644,38 @@ _hg_cmd_merge() { } _hg_cmd_outgoing() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ + _arguments -s : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ '(--patch -p)'{-p,--patch}'[show patch]' \ - '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \ + '(--rev -r)'{-r+,--rev=}'[a specific revision you would like to push]' \ '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ ':destination:_hg_remote' } _hg_cmd_parents() { - _arguments -s -w : $_hg_global_opts $_hg_style_opts \ - '(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_tags' \ + _arguments -s : $_hg_global_opts $_hg_style_opts \ + '(--rev -r)'{-r+,--rev=}'[show parents of the specified rev]:revision:_hg_tags' \ ':last modified file:_hg_files' } _hg_cmd_paths() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ ':path:_hg_paths' } _hg_cmd_pull() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ + _arguments -s : $_hg_global_opts $_hg_remote_opts \ '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \ - '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \ + '(--rev -r)'{-r+,--rev=}'[a specific revision up to which you would like to pull]:revision:' \ ':source:_hg_remote' } _hg_cmd_push() { - _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ + _arguments -s : $_hg_global_opts $_hg_remote_opts \ '(--force -f)'{-f,--force}'[force push]' \ - '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_tags' \ + '(--rev -r)'{-r+,--rev=}'[a specific revision you would like to push]:revision:_hg_tags' \ '*'{-B,--bookmark=}'[bookmark to push]:bookmark:_hg_bookmarks_internal' \ '*'{-b,--branch=}'[branch to push]:branch:_hg_branches_internal' \ '--insecure[do not verify server certificate]' \ @@ -684,14 +684,14 @@ _hg_cmd_push() { } _hg_cmd_remove() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + _arguments -s : $_hg_global_opts $_hg_pat_opts \ '(--after -A)'{-A,--after}'[record remove that has already occurred]' \ '(--force -f)'{-f,--force}'[remove file even if modified]' \ '*:file:_hg_files' } _hg_cmd_rename() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ + _arguments -s : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ '(--after -A)'{-A,--after}'[record a rename that has already occurred]' \ '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ '*:file:_hg_files' @@ -701,7 +701,7 @@ _hg_cmd_resolve() { local context state line typeset -A opt_args - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \ '(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \ '(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' \ @@ -718,9 +718,9 @@ _hg_cmd_revert() { local context state line typeset -A opt_args - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ + _arguments -s : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \ - '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_tags' \ + '(--rev -r)'{-r+,--rev=}'[revision to revert to]:revision:_hg_tags' \ '--no-backup[do not save backup copies of files]' \ '*:file:->diff_files' @@ -738,13 +738,13 @@ _hg_cmd_revert() { } _hg_cmd_serve() { - _arguments -s -w : $_hg_global_opts \ - '(--accesslog -A)'{-A+,--accesslog}'[name of access log file]:log file:_files' \ - '(--errorlog -E)'{-E+,--errorlog}'[name of error log file]:log file:_files' \ + _arguments -s : $_hg_global_opts \ + '(--accesslog -A)'{-A+,--accesslog=}'[name of access log file]:log file:_files' \ + '(--errorlog -E)'{-E+,--errorlog=}'[name of error log file]:log file:_files' \ '(--daemon -d)'{-d,--daemon}'[run server in background]' \ - '(--port -p)'{-p+,--port}'[listen port]:listen port:' \ - '(--address -a)'{-a+,--address}'[interface address]:interface address:' \ - '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \ + '(--port -p)'{-p+,--port=}'[listen port]:listen port:' \ + '(--address -a)'{-a+,--address=}'[interface address]:interface address:' \ + '(--name -n)'{-n+,--name=}'[name to show in web pages]:repository name:' \ '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \ '--style[web template style]:style' \ '--stdio[for remote clients]' \ @@ -752,13 +752,13 @@ _hg_cmd_serve() { } _hg_cmd_showconfig() { - _arguments -s -w : $_hg_global_opts \ - '(--untrusted -u)'{-u+,--untrusted}'[show untrusted configuration options]' \ + _arguments -s : $_hg_global_opts \ + '(--untrusted -u)'{-u+,--untrusted=}'[show untrusted configuration options]' \ ':config item:_hg_config' } _hg_cmd_status() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + _arguments -s : $_hg_global_opts $_hg_pat_opts \ '(--all -A)'{-A,--all}'[show status of all files]' \ '(--modified -m)'{-m,--modified}'[show only modified files]' \ '(--added -a)'{-a,--added}'[show only added files]' \ @@ -775,37 +775,37 @@ _hg_cmd_status() { } _hg_cmd_tag() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--local -l)'{-l,--local}'[make the tag local]' \ - '(--message -m)'{-m+,--message}'[message for tag commit log entry]:message:' \ - '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ - '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ - '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_tags' \ + '(--message -m)'{-m+,--message=}'[message for tag commit log entry]:message:' \ + '(--date -d)'{-d+,--date=}'[record datecode as commit date]:date code:' \ + '(--user -u)'{-u+,--user=}'[record user as commiter]:user:' \ + '(--rev -r)'{-r+,--rev=}'[revision to tag]:revision:_hg_tags' \ ':tag name:' } _hg_cmd_tip() { - _arguments -s -w : $_hg_global_opts $_hg_style_opts \ + _arguments -s : $_hg_global_opts $_hg_style_opts \ '(--patch -p)'{-p,--patch}'[show patch]' } _hg_cmd_unbundle() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--update -u)'{-u,--update}'[update to new tip if changesets were unbundled]' \ ':files:_files' } _hg_cmd_update() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \ - '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ + '(--rev -r)'{-r+,--rev=}'[revision]:revision:_hg_tags' \ ':revision:_hg_tags' } # HGK _hg_cmd_view() { - _arguments -s -w : $_hg_global_opts \ - '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ + _arguments -s : $_hg_global_opts \ + '(--limit -l)'{-l+,--limit=}'[limit number of changes displayed]:' \ ':revision range:_hg_tags' } @@ -859,35 +859,35 @@ _hg_qseries_opts=( '(--summary -s)'{-s,--summary}'[print first line of patch header]') _hg_cmd_qapplied() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts + _arguments -s : $_hg_global_opts $_hg_qseries_opts } _hg_cmd_qdelete() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--keep -k)'{-k,--keep}'[keep patch file]' \ - '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \ + '*'{-r+,--rev=}'[stop managing a revision]:applied patch:_hg_revrange' \ '*:unapplied patch:_hg_qdeletable' } _hg_cmd_qdiff() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + _arguments -s : $_hg_global_opts $_hg_pat_opts \ '*:pattern:_hg_files' } _hg_cmd_qfold() { - _arguments -s -w : $_hg_global_opts $_h_commit_opts \ + _arguments -s : $_hg_global_opts $_h_commit_opts \ '(--keep,-k)'{-k,--keep}'[keep folded patch files]' \ '*:unapplied patch:_hg_qunapplied' } _hg_cmd_qgoto() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--force -f)'{-f,--force}'[overwrite any local changes]' \ ':patch:_hg_qseries' } _hg_cmd_qguard() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--list -l)'{-l,--list}'[list all patches and guards]' \ '(--none -n)'{-n,--none}'[drop all guards]' \ ':patch:_hg_qseries' \ @@ -895,66 +895,66 @@ _hg_cmd_qguard() { } _hg_cmd_qheader() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ ':patch:_hg_qseries' } _hg_cmd_qimport() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--existing -e)'{-e,--existing}'[import file in patch dir]' \ - '(--name -n 2)'{-n+,--name}'[patch file name]:name:' \ + '(--name -n 2)'{-n+,--name=}'[patch file name]:name:' \ '(--force -f)'{-f,--force}'[overwrite existing files]' \ - '*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_revrange' \ + '*'{-r+,--rev=}'[place existing revisions under mq control]:revision:_hg_revrange' \ '*:patch:_files' } _hg_cmd_qnew() { - _arguments -s -w : $_hg_global_opts $_hg_commit_opts \ + _arguments -s : $_hg_global_opts $_hg_commit_opts \ '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \ ':patch:' } _hg_cmd_qnext() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts + _arguments -s : $_hg_global_opts $_hg_qseries_opts } _hg_cmd_qpop() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--all -a :)'{-a,--all}'[pop all patches]' \ - '(--name -n)'{-n+,--name}'[queue name to pop]:' \ + '(--name -n)'{-n+,--name=}'[queue name to pop]:' \ '(--force -f)'{-f,--force}'[forget any local changes]' \ ':patch:_hg_qapplied' } _hg_cmd_qprev() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts + _arguments -s : $_hg_global_opts $_hg_qseries_opts } _hg_cmd_qpush() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--all -a :)'{-a,--all}'[apply all patches]' \ '(--list -l)'{-l,--list}'[list patch name in commit text]' \ - '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \ - '(--name -n)'{-n+,--name}'[merge queue name]:' \ + '(--merge -m)'{-m+,--merge=}'[merge from another queue]:' \ + '(--name -n)'{-n+,--name=}'[merge queue name]:' \ '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \ ':patch:_hg_qunapplied' } _hg_cmd_qrefresh() { - _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts \ + _arguments -s : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts \ '(--git -g)'{-g,--git}'[use git extended diff format]' \ '(--short -s)'{-s,--short}'[short refresh]' \ '*:files:_hg_files' } _hg_cmd_qrename() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ ':patch:_hg_qseries' \ ':destination:' } _hg_cmd_qselect() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--none -n :)'{-n,--none}'[disable all guards]' \ '(--series -s :)'{-s,--series}'[list all guards in series file]' \ '--pop[pop to before first guarded applied patch]' \ @@ -963,20 +963,20 @@ _hg_cmd_qselect() { } _hg_cmd_qseries() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts \ + _arguments -s : $_hg_global_opts $_hg_qseries_opts \ '(--missing -m)'{-m,--missing}'[print patches not in series]' } _hg_cmd_qunapplied() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts + _arguments -s : $_hg_global_opts $_hg_qseries_opts } _hg_cmd_qtop() { - _arguments -s -w : $_hg_global_opts $_hg_qseries_opts + _arguments -s : $_hg_global_opts $_hg_qseries_opts } _hg_cmd_strip() { - _arguments -s -w : $_hg_global_opts \ + _arguments -s : $_hg_global_opts \ '(--force -f)'{-f,--force}'[force multi-head removal]' \ '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \ '(--nobackup -n)'{-n,--nobackup}'[no backups]' \ -- cgit v1.2.3 From 0cfa2dcfc424667f7fc29cf9a13c68883f3ffc28 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Mon, 28 Sep 2015 00:09:03 +0900 Subject: 36631: separate _zsh from _sh Do all the completion for zsh by _arguments --- ChangeLog | 5 +++++ Completion/Unix/Command/_sh | 17 +---------------- Completion/Unix/Command/_zsh | 8 ++++++++ 3 files changed, 14 insertions(+), 16 deletions(-) create mode 100644 Completion/Unix/Command/_zsh (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 964e340f0..05c163014 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-09-28 Jun-ichi Takimoto + + * 36631: Completion/Unix/Command/_sh, + Completion/Unix/Command/_zsh: separate _zsh from _sh + 2015-09-26 Barton E. Schaefer * 36641: Src/Modules/complist.c: fix multibyte handling in diff --git a/Completion/Unix/Command/_sh b/Completion/Unix/Command/_sh index 1b5112212..2afb46621 100644 --- a/Completion/Unix/Command/_sh +++ b/Completion/Unix/Command/_sh @@ -1,13 +1,4 @@ -#compdef sh ksh bash zsh csh tcsh rc - -if [[ $service == zsh ]]; then - # try a bit harder - if [[ ${words[CURRENT-1]} == -o ]]; then - _options - # no other possibilities - return - fi -fi +#compdef sh ksh bash csh tcsh rc if (( CURRENT == ${words[(i)-c]} + 1 )); then _cmdstring @@ -21,9 +12,3 @@ else fi _default fi - -local ret=$? - -[[ $service == zsh ]] && _arguments -S -s -- && ret=0 - -return ret diff --git a/Completion/Unix/Command/_zsh b/Completion/Unix/Command/_zsh new file mode 100644 index 000000000..3b6d7ad4f --- /dev/null +++ b/Completion/Unix/Command/_zsh @@ -0,0 +1,8 @@ +#compdef zsh + +_arguments -S -s : \ + '*-o+[set named option]:option:_options' \ + '*+o+[unset named option]:option:_options' \ + '(1 -)-c[run a command]:command:_cmdstring' \ + '(-)1:script file:_files' \ + '*:command arguments' -- -- cgit v1.2.3 From 36abe20c0f53015b816d5f3bdd1eeed713614233 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Sun, 27 Sep 2015 01:03:16 -0500 Subject: 36653: OpenBSD's usermod has no -a flag --- ChangeLog | 5 +++++ Completion/Unix/Command/_user_admin | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 3562b1379..b1fe74da4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-09-27 Matthew Martin + + * 36653: Completion/Unix/Command/_user_admin: OpenBSD's usermod + has no -a flag + 2015-09-27 Barton E. Schaefer * 36663: Src/mkmakemod.sh, Src/zsh.mdd: replace obsolete diff --git a/Completion/Unix/Command/_user_admin b/Completion/Unix/Command/_user_admin index 31ccbf1c2..3653308a1 100644 --- a/Completion/Unix/Command/_user_admin +++ b/Completion/Unix/Command/_user_admin @@ -44,8 +44,8 @@ if [[ $service = user* ]]; then "(-U -p)-L[lock user's password]" "(-L -p)-U[unlock user's password]" ) + [[ $OSTYPE = openbsd* ]] || args+=('-a[append groups]') args+=( - '-a[append groups]' '-l[specify new user name]:new username' ':username:_users' ) -- cgit v1.2.3 From 9064483b6c73286cd892acd5d30366db14a77371 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 1 Oct 2015 09:47:15 +0100 Subject: 36722: allow git range to complete after ^. Take account of backslash quoting. --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index b3a0a649f..80edc8fdf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-10-01 Peter Stephenson + + * 36722: Completion/Unix/Command/_git: allow range to complete + after ^, taking acoount of backslash quoting. + 2015-10-01 Mikael Magnusson * 36709: Doc/Zsh/zle.yo, Functions/Zle/bracketed-paste-url-magic, diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 40a9fb63b..1fcde9015 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5753,7 +5753,14 @@ __git_commit_ranges () { if compset -P '*..(.|)'; then expl=( $* ) else - compset -S '..*' || suf=( -S .. -r '.@~ ^:\t\n\-' ) + if ! compset -S '..*'; then + local match mbegin mend + if [[ ${PREFIX} = (#b)((\\|)\^)* ]]; then + compset -p ${#match[1]} + else + suf=( -S .. -r '.@~ ^:\t\n\-' ) + fi + fi expl=( $* $suf ) fi -- cgit v1.2.3 From e3bc9aa22843cb55912b909e00f54972eab5b2c5 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Fri, 2 Oct 2015 22:11:43 +0900 Subject: 36732: _zsh now complets script args; also support -s, -b --- ChangeLog | 5 +++++ Completion/Unix/Command/_zsh | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 14749d9ff..87a2ce490 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-10-02 Jun-ichi Takimoto + + * 36732: Completion/Unix/Command/_zsh: support -s and -b, + and complete script arguments + 2015-10-01 Peter Stephenson * 36737: Src/pattern.c: Ensure we are not dereferencing diff --git a/Completion/Unix/Command/_zsh b/Completion/Unix/Command/_zsh index 3b6d7ad4f..a5414670b 100644 --- a/Completion/Unix/Command/_zsh +++ b/Completion/Unix/Command/_zsh @@ -1,8 +1,23 @@ #compdef zsh +local curcontext=$curcontext state state_descr line expl +typeset -A opt_args + _arguments -S -s : \ '*-o+[set named option]:option:_options' \ '*+o+[unset named option]:option:_options' \ + '(1 -s --shinstdin)'{-s,--shinstdin}'[read commands from standard input]' \ + '(-)-b[end of option processing, like --]' \ '(1 -)-c[run a command]:command:_cmdstring' \ '(-)1:script file:_files' \ - '*:command arguments' -- + '*::script arguments:->args' -- && return 0 + +case $state in + (args) + if [[ -n ${opt_args[(I)-c|-s|--shinstdin]} ]]; then + _files + else + _normal + fi + ;; +esac -- cgit v1.2.3 From 21b6852b15c563c434ae053b71d109e4c6010479 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 15 Oct 2015 11:24:21 +0100 Subject: 36864: new objdump completion and tweak to nm completion --- ChangeLog | 6 ++++++ Completion/Unix/Command/_nm | 2 +- Completion/Unix/Command/_objdump | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 Completion/Unix/Command/_objdump (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index f0c88c979..c84b643b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-10-15 Peter Stephenson + + * 36864: Completion/Unix/Command/_nm, + Completion/Unix/Command/_objdump: new objdump completion plus + tweak to _nm. + 2015-10-14 Barton E. Schaefer * 36853: Src/exec.c: replace pushheap/popheap by NEWHEAPS/OLDHEAPS diff --git a/Completion/Unix/Command/_nm b/Completion/Unix/Command/_nm index 80136329d..d171ef5a3 100644 --- a/Completion/Unix/Command/_nm +++ b/Completion/Unix/Command/_nm @@ -6,7 +6,7 @@ _nm_object_file() { [[ -x $REPLY || $REPLY = *.([ao]|so|elf) ]] } -files="*:object file:_files -g '*(-.e:_nm_object_file:)'" +files="*:object file:_files -g '*(-.e,_nm_object_file,)'" args=( '(-A -o --print-file-name)'{-A,-o,--print-file-name}'[print name of input file on each line]' '(--demangle)-C[decode symbol names]' diff --git a/Completion/Unix/Command/_objdump b/Completion/Unix/Command/_objdump new file mode 100644 index 000000000..607719a19 --- /dev/null +++ b/Completion/Unix/Command/_objdump @@ -0,0 +1,8 @@ +#compdef objdump + +# borrowed from _nm_object_file +_objdump_object_file() { + [[ -x $REPLY || $REPLY = *.([ao]|so|elf) ]] +} + +_arguments -- '*:object file:_files -g "*(-.e,_objdump_object_file,)"' -- cgit v1.2.3 From 509c822b626c01e0787aac2baef5af80d15da529 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Mon, 19 Oct 2015 11:23:57 +0200 Subject: 36869: use permissions to limit files completed for ssh identity files --- ChangeLog | 5 +++++ Completion/Unix/Command/_ssh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 70a8d2e2e..ea86f62cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-10-19 Oliver Kiddle + + * 36869: Matthew Martin: Completion/Unix/Command/_ssh: use + permissions to limit files completed for ssh identity files + 2015-10-18 Frank Terbeck * 36888: Functions/VCS_Info/vcs_info: vcs_info: Prevent diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index a66702a65..c6ede9efe 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -18,7 +18,7 @@ _ssh () { # for protocol version 2, this can be a comma-separated list '-c+[select encryption cipher]:encryption cipher:(idea des 3des blowfish arcfour tss none)' '-F+[specify alternate config file]:config file:_files' - '*-i+[select identity file]:SSH identity file:_files' + '*-i+[select identity file]:SSH identity file:_files -g "*(-.^AR)"' '*-o+[specify extra options]:option string:->option' ) common_transfer=( -- cgit v1.2.3 From 878d1272fd18da172441d058c3b6b9b60ef01da9 Mon Sep 17 00:00:00 2001 From: Eric Cook Date: Mon, 19 Oct 2015 16:05:01 +0200 Subject: 36646: handle solaris/openzfs differences; only use -t share on solaris --- ChangeLog | 4 ++++ Completion/Unix/Command/_zfs | 4 +++- Completion/Unix/Command/_zpool | 4 +++- Completion/Unix/Type/_zfs_dataset | 6 ++++-- 4 files changed, 14 insertions(+), 4 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index f7369b89a..83aef6f64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-10-19 Oliver Kiddle + * 36646: Eric Cook: Completion/Unix/Type/_zfs_dataset, + Completion/Unix/Command/_zpool, Completion/Unix/Command/_zfs: + solaris/openzfs differences; only use -t share solaris + * 36889: Eric Cook: Completion/BSD/Command/_sockstat: completion of system specific sockstat options diff --git a/Completion/Unix/Command/_zfs b/Completion/Unix/Command/_zfs index cd5ad3edc..04a92e685 100644 --- a/Completion/Unix/Command/_zfs +++ b/Completion/Unix/Command/_zfs @@ -2,7 +2,7 @@ # Synced with the S11U1 man page _zfs() { - local context state line expl + local context state line expl implementation typeset -A opt_args local -a subcmds rw_properties rw_propnames ro_properties create_properties local -a share_nfs_ro_properties share_nfs_rw_properties @@ -10,6 +10,8 @@ _zfs() { local -a share_ro_properties share_rw_properties local -a difffields delegatable_perms + _pick_variant -r implementation -c 'zpool upgrade -v' openzfs='This system supports ZFS pool feature flags' solaris + subcmds=( "create" "destroy" "clone" "promote" "rename" "snapshot" "rollback" "list" "set" "get" "inherit" "mount" "unmount" diff --git a/Completion/Unix/Command/_zpool b/Completion/Unix/Command/_zpool index f2116dc2e..53022db8a 100644 --- a/Completion/Unix/Command/_zpool +++ b/Completion/Unix/Command/_zpool @@ -2,9 +2,11 @@ # Synced with the S11U1 man page _zpool() { - local context state line expl + local context state line expl implementation local -a subcmds fields ro_props rw_props versions create_properties_dataset + _pick_variant -r implementation -c 'zpool upgrade -v' openzfs='This system supports ZFS pool feature flags' solaris + subcmds=( create destroy add remove list iostat status online offline clear attach detach replace scrub import export diff --git a/Completion/Unix/Type/_zfs_dataset b/Completion/Unix/Type/_zfs_dataset index 64e343f3a..5fa3e9e50 100644 --- a/Completion/Unix/Type/_zfs_dataset +++ b/Completion/Unix/Type/_zfs_dataset @@ -34,6 +34,8 @@ if [[ ${#rsrc} -gt 0 ]]; then typearg=( -t snapshot ) elif [[ -n $words[(r)-p] ]]; then typearg=( -t filesystem,volume ) + elif [[ $implementation == openzfs ]]; then + typearg=( -t filesystem,snapshot,volume ) else typearg=( -t filesystem,share,snapshot,volume ) fi @@ -50,13 +52,13 @@ if [[ ${#rdst} -gt 0 ]]; then else # The parent dataset must be a filesystem, and can't rename # a dataset into another pool. Plus we hardcode the expl. - typearg=( -t fs -r ${${words[CURRENT - 1]}%%/*} ) + typearg=( -t filesystem -r ${${words[CURRENT - 1]}%%/*} ) expl_type_arr=( -e "parent dataset" ) fi fi if [[ -n $type[(r)clone] ]]; then - datasetlist=( ${="$(zfs list -H -o name,origin -t fs | awk "\$2 != \"-\" {print \$1}")":#no cloned filesystems available} ) + datasetlist=( ${="$(zfs list -H -o name,origin -t filesystem | awk "\$2 != \"-\" {print \$1}")":#no cloned filesystems available} ) else datasetlist=( ${="$(zfs list -H -o name $typearg)":#no datasets available} ) fi -- cgit v1.2.3 From c6028f7387ad496ade9daaf76ac1683c3002bbf7 Mon Sep 17 00:00:00 2001 From: Eric Cook Date: Mon, 19 Oct 2015 16:00:21 +0200 Subject: 36642: complete jail/unjail zfs subcommands on freebsd --- ChangeLog | 3 +++ Completion/Unix/Command/_zfs | 8 ++++++++ 2 files changed, 11 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 83aef6f64..4d8b15c69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-10-19 Oliver Kiddle + * 36642: Eric Cook: Completion/Unix/Command/_zfs: + complete jail/unjail subcommands on freebsd + * 36646: Eric Cook: Completion/Unix/Type/_zfs_dataset, Completion/Unix/Command/_zpool, Completion/Unix/Command/_zfs: solaris/openzfs differences; only use -t share solaris diff --git a/Completion/Unix/Command/_zfs b/Completion/Unix/Command/_zfs index 04a92e685..f3869da43 100644 --- a/Completion/Unix/Command/_zfs +++ b/Completion/Unix/Command/_zfs @@ -20,6 +20,8 @@ _zfs() { "diff" "key" "help" ) + [[ $OSTYPE == freebsd<7->.* ]] && subcmds+=(jail unjail) + share_nfs_ro_properties=( "share.nfs.all" ) @@ -533,6 +535,12 @@ _zfs() { ':filesystem or volume:_zfs_dataset -t fs -t vol' ;; + ("jail"|"unjail") + _arguments \ + '1: : _jails' \ + '2:filesystem:_zfs_dataset -t fs' + ;; + ("help") _arguments -A "-*" \ - set1 \ -- cgit v1.2.3 From 98875bcb05d552cc59b300e33fe9000d295b1ffe Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 20 Oct 2015 14:22:25 +0000 Subject: 36900: _git: stash names completion: Display log messages The "$@" argument to compadd is removed because (I think) it contains a -J, which conflicts with the -V. Joint with Daniel Hahler. --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 4d8b15c69..04883a152 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-10-20 Daniel Shahaf + + * 36900: Completion/Unix/Command/_git: _git: stash names + completion: Display log messages + 2015-10-19 Oliver Kiddle * 36642: Eric Cook: Completion/Unix/Command/_zfs: diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 1fcde9015..719d717d7 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5487,12 +5487,21 @@ __git_signoff_file () { (( $+functions[__git_stashes] )) || __git_stashes () { local expl + declare -a interleaved declare -a stashes + declare -a descriptions - stashes=(${(f)"$(_call_program stashes git stash list --pretty=format:%gd 2>/dev/null)"}) + interleaved=(${(ps:\0:)"$(_call_program stashes git stash list -z --pretty='format:%gd%x00%s%x00\(%cr\)' 2>/dev/null)"}) __git_command_successful $pipestatus || return 1 + () { + local i j k + for i j k in $interleaved; do + stashes+=($i) + descriptions+=("$i: $j $k") + done + } - _wanted stashes expl stash compadd "$@" -a - stashes + _wanted stashes expl 'stash' compadd -Vx -d descriptions -a - stashes } (( $+functions[__git_svn_revisions] )) || -- cgit v1.2.3 From e3c68450d77e679499a93fa87d964907213e15c3 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 24 Oct 2015 20:31:01 +0000 Subject: unposted: _beep completion: Actually hook it for the 'beep' command. --- ChangeLog | 3 +++ Completion/Unix/Command/_beep | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index dffd3b35a..44830070e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-10-24 Daniel Shahaf + * unposted: Completion/Unix/Command/_beep: _beep completion: + Actually hook it for the 'beep' command. + * 36913 + 36945: Functions/VCS_Info/VCS_INFO_quilt: vcs_info quilt: Pass patch subject lines to gen-applied-string diff --git a/Completion/Unix/Command/_beep b/Completion/Unix/Command/_beep index c49c09726..d393bc91e 100644 --- a/Completion/Unix/Command/_beep +++ b/Completion/Unix/Command/_beep @@ -1,4 +1,4 @@ -#compdef _beep +#compdef beep # beep [--verbose | --debug] [-e device | --device device] [-f N] [-l N] # [-r N] [-d N] [-D N] [-s] [-c] -- cgit v1.2.3 From f8b2c13c97228c9a1a0319f07d1ae7c1268e12db Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 25 Oct 2015 18:39:31 +0000 Subject: unposted: _git: Fix 'commit object name' completion messages. Offer the "this alternative is still valid, but I don't know to offer completions for it" for hash completion but not for recent object completion; the former is protected by a _guard and the latter incorrectly appeared also in cases such as 'git log a/b' which were not the start of a gitrevisions(7) expression. --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 8bf01dc3f..812ef3540 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-10-25 Daniel Shahaf + + * unposted: Completion/Unix/Command/_git: _git: Fix 'commit + object name' completion messages. + 2015-10-25 Jun-ichi Takimoto * 36911: Src/Zle/computil.c: '-optarg' should not match diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 719d717d7..e38b1c6e7 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5640,7 +5640,7 @@ __git_commit_objects () { commits=(${(f)"$(_call_program commits git --no-pager log -1000 --all --reflog --format='%h:\[%h\]\ %s\ \(%cr\)')"}) __git_command_successful $pipestatus || return 1 - _describe -V -t commits 'commit object name' commits + _describe -Vx -t commits 'commit object name' commits } (( $+functions[__git_recent_commits] )) || @@ -5704,7 +5704,7 @@ __git_recent_commits () { expl=() _wanted heads expl 'head' compadd "$@" -a - heads && ret=0 expl=() - _describe -Vx -t commits 'recent commit object name' descr && ret=0 + _describe -V -t commits 'recent commit object name' descr && ret=0 return $ret } -- cgit v1.2.3 From 17af119089379ec1b65b327c72eee3aac93fada7 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 25 Oct 2015 18:34:08 +0000 Subject: 36958: _git: Fix recent commit completion descriptions. The uniquifiers 'HEAD~$n' were incorrect when a recent commit was the second parent of a merge commit. Detect that case and print something correct instead. --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 41 +++++++++++++++++++++++++++++------------ 2 files changed, 32 insertions(+), 12 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 812ef3540..234f26f11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-10-25 Daniel Shahaf + * 36958: Completion/Unix/Command/_git: _git: Fix recent commit + completion descriptions. + * unposted: Completion/Unix/Command/_git: _git: Fix 'commit object name' completion messages. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index e38b1c6e7..279331b00 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5650,6 +5650,8 @@ __git_recent_commits () { local i j k ret integer distance_from_head local label + local parents + local next_first_parent_ancestral_line_commit zparseopts -D -E O:=argument_array_names # Turn (-O foo:bar) to (foo bar) @@ -5659,10 +5661,10 @@ __git_recent_commits () { # Careful: most %d will expand to the empty string. Quote properly! # NOTE: we could use %D directly, but it's not available in git 1.9.1 at least. - commits=("${(f)"$(_call_program commits git --no-pager log $commit_opts -20 --format='%h%n%d%n%s\ \(%cr\)')"}") + commits=("${(f)"$(_call_program commits git --no-pager log $commit_opts -20 --format='%h%n%d%n%s\ \(%cr\)%n%p')"}") __git_command_successful $pipestatus || return 1 - for i j k in "$commits[@]" ; do + for i j k parents in "$commits[@]" ; do # Note: the after-the-colon part must be unique across the entire array; # see workers/34768 if (( $#commit_opts )); then @@ -5671,20 +5673,35 @@ __git_recent_commits () { # description unique (due to workers/34768), which we do by including the # hash. Git always prints enough hash digits to make the output unique.) label="[$i]" - elif (( distance_from_head == 0 )); then - label="[HEAD] " - elif (( distance_from_head == 1 )); then - label="[HEAD^] " - elif (( distance_from_head == 2 )); then - label="[HEAD^^] " - elif (( distance_from_head < 10 )); then - label="[HEAD~$distance_from_head] " + elif (( distance_from_head )) && [[ $i != $next_first_parent_ancestral_line_commit ]]; then + # The first commit (HEAD), and its ancestors along the first-parent line, + # get HEAD~$n labels. + # + # For other commits, we just print the hash. (${parents} does provide enough + # information to compute HEAD~3^2~4 -style labels, though, if somebody cared + # enough to implement that.) + label="[$i]" else - label="[HEAD~$distance_from_head]" + # Compute a first-parent-ancestry commit's label. + if false ; then + elif (( distance_from_head == 0 )); then + label="[HEAD] " + elif (( distance_from_head == 1 )); then + label="[HEAD^] " + elif (( distance_from_head == 2 )); then + label="[HEAD^^] " + elif (( distance_from_head < 10 )); then + label="[HEAD~$distance_from_head] " + else + label="[HEAD~$distance_from_head]" + fi + + # Prepare for the next first-parent-ancestry commit. + (( ++distance_from_head )) + next_first_parent_ancestral_line_commit=${parents%% *} fi # label is now 9 bytes, so the descriptions ($k) will be aligned. descr+=($i:"${label} $k") - (( ++distance_from_head )) j=${${j# \(}%\)} # strip leading ' (' and trailing ')' j=${j/ ->/,} # Convert " -> master, origin/master". -- cgit v1.2.3 From f890d442e22fccb94997c400710a88f8415388cf Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 25 Oct 2015 18:34:58 +0000 Subject: 36959: _git: Offer @~$n as completion of recent commits. Suggested-by: Oliver Kiddle (users/20705) --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 234f26f11..67129de6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-10-25 Daniel Shahaf + * 36959: Completion/Unix/Command/_git: _git: Offer @~$n as + completion of recent commits. + * 36958: Completion/Unix/Command/_git: _git: Fix recent commit completion descriptions. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 279331b00..740aec4cd 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5695,13 +5695,14 @@ __git_recent_commits () { else label="[HEAD~$distance_from_head]" fi + descr+=("@~${distance_from_head}":"${label} $k") # CROSSREF: use the same label as below # Prepare for the next first-parent-ancestry commit. (( ++distance_from_head )) next_first_parent_ancestral_line_commit=${parents%% *} fi # label is now 9 bytes, so the descriptions ($k) will be aligned. - descr+=($i:"${label} $k") + descr+=($i:"${label} $k") # CROSSREF: use the same label as above j=${${j# \(}%\)} # strip leading ' (' and trailing ')' j=${j/ ->/,} # Convert " -> master, origin/master". -- cgit v1.2.3 From b4f7482e44ec59bfe99c8d0f23503570eda0ca1b Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 25 Oct 2015 18:35:20 +0000 Subject: 36960: _git: Enable slash matcher for more branch and tag completions, include 'git branch ' and 'git tag '. --- ChangeLog | 4 ++++ Completion/Unix/Command/_git | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 67129de6e..c77e0a525 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-10-25 Daniel Shahaf + * 36960: Completion/Unix/Command/_git: _git: Enable slash matcher + for more branch and tag completions, include 'git branch ' + and 'git tag '. + * 36959: Completion/Unix/Command/_git: _git: Offer @~$n as completion of recent commits. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 740aec4cd..e5005f1c3 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5540,7 +5540,7 @@ __git_branch_names () { branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) __git_command_successful $pipestatus || return 1 - _wanted branch-names expl branch-name compadd "$@" -a - branch_names + _wanted branch-names expl branch-name compadd -M 'r:|/=**' "$@" -a - branch_names } (( $+functions[__git_remote_branch_names] )) || @@ -5848,7 +5848,7 @@ __git_tags () { tags=(${${(f)"$(_call_program tagrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/}) __git_command_successful $pipestatus || return 1 - _wanted tags expl tag compadd "$@" -a - tags + _wanted tags expl tag compadd -M 'r:|/=**' "$@" -a - tags } (( $+functions[__git_commit_tags] )) || @@ -5871,7 +5871,7 @@ __git_tags_of_type () { tags=(${${(M)${(f)"$(_call_program $type-tag-refs "git for-each-ref --format='%(*objecttype)%(objecttype) %(refname)' refs/tags 2>/dev/null")"}:#$type(tag|) *}#$type(tag|) refs/tags/}) __git_command_successful $pipestatus || return 1 - _wanted $type-tags expl "$type tag" compadd "$@" -a - tags + _wanted $type-tags expl "$type tag" compadd -M 'r:|/=**' "$@" -a - tags } # Reference Argument Types -- cgit v1.2.3 From cc19bb96b91904cc650512297df63b834aa42d28 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 25 Oct 2015 18:35:38 +0000 Subject: 36964: _git: Complete remotes branch names with slashes correctly. For example, 'git push remote HEAD:foo/bar' creates such branches. --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index c77e0a525..2e5b99cd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-10-25 Daniel Shahaf + * 36964: Completion/Unix/Command/_git: _git: Complete remotes + branch names with slashes correctly. + * 36960: Completion/Unix/Command/_git: _git: Enable slash matcher for more branch and tag completions, include 'git branch ' and 'git tag '. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index e5005f1c3..f22cddb3e 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5559,7 +5559,7 @@ __git_remote_branch_names_noprefix () { local expl declare -a heads - branch_names=(${${${(f)"$(_call_program remote-branch-refs-noprefix git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}##*/}:#HEAD}) + branch_names=(${${${${(f)"$(_call_program remote-branch-refs-noprefix git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}#refs/remotes/}#*/}:#HEAD}) __git_command_successful $pipestatus || return 1 _wanted remote-branch-names-noprefix expl 'remote branch name' compadd -M 'r:|/=**' "$@" -a - branch_names -- cgit v1.2.3 From 8b5158424637834f242bb1e2114dee4ac7cca328 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 25 Oct 2015 18:35:50 +0000 Subject: 36962: _git: Fix completion of RHS of refspecs. Before this patch, 'git push $remote :' completed branch names (as though by `git branch -a`), instead of completing remote branch names sans the ${remote}/ prefix. --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 2e5b99cd3..e26e62e5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-10-25 Daniel Shahaf + * 36962: Completion/Unix/Command/_git: _git: Fix completion of + RHS of refspecs. + * 36964: Completion/Unix/Command/_git: _git: Complete remotes branch names with slashes correctly. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index f22cddb3e..320bfa712 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5313,7 +5313,8 @@ __git_remotes () { __git_ref_specs () { # TODO: This needs to deal with a lot more types of things. if compset -P '*:'; then - __git_heads + # TODO: have the caller supply the correct remote name, restrict to refs/remotes/${that_remote}/* only + __git_remote_branch_names_noprefix else compset -P '+' if compset -S ':*'; then -- cgit v1.2.3 From 9640e9f497e8d78bf0bfa9defc4cfdeba1e7bfae Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Thu, 29 Oct 2015 01:03:18 +0900 Subject: 36983 + 36990: new completions for head and tail --- ChangeLog | 5 ++++ Completion/Unix/Command/_head | 45 ++++++++++++++++++++++++++++++ Completion/Unix/Command/_tail | 65 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 Completion/Unix/Command/_head create mode 100644 Completion/Unix/Command/_tail (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index b5da1df4e..0c38b2697 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-10-29 Jun-ichi Takimoto + + * 36983 (with fix from 36990): Completion/Unix/Command/_head, + Completion/Unix/Command/_tail: new completions for head and tail + 2015-10-27 Barton E. Schaefer * 36994: Functions/Zle/bracketed-paste-magic: declare local REPLY diff --git a/Completion/Unix/Command/_head b/Completion/Unix/Command/_head new file mode 100644 index 000000000..4f956acdc --- /dev/null +++ b/Completion/Unix/Command/_head @@ -0,0 +1,45 @@ +#compdef head + +local curcontext=$curcontext state state_descr line expl opts args ret=1 +typeset -A opt_args + +if _pick_variant gnu=GNU unix --version; then + args=( + '(-n --lines -c --bytes)'{-c+,--bytes=}'[print the first (or with -, all but the last) specified bytes]:number of bytes:->number' + '(-n --lines -c --bytes)'{-n+,--lines=}'[print the first (or with -, all but the last) specified lines]:number of lines:->number' + '(-q --quiet --silent -v --verbose)'{-q,--quiet,--silent}'[never print headers giving file names]' + '(-q --quiet --silent -v --verbose)'{-v,--verbose}'[always print headers giving file names]' + '(- *)--help[display help and exit]' + '(- *)--version[output version information and exit]' + ) +else + opts=(-A '-*') + args=( '(-c)-n+[display the first specified lines]:number of lines' ) + case $OSTYPE in + (freebsd*|darwin*|dragonfly*|netbsd*) + args+=( '(-n)-c+[display the first specified bytes]:number of bytes' ) + ;; + esac +fi + +_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 + ;; +esac + +return ret diff --git a/Completion/Unix/Command/_tail b/Completion/Unix/Command/_tail new file mode 100644 index 000000000..6e1445328 --- /dev/null +++ b/Completion/Unix/Command/_tail @@ -0,0 +1,65 @@ +#compdef tail + +local curcontext=$curcontext state state_descr line expl opts args ret=1 +typeset -A opt_args + +if _pick_variant gnu=GNU unix --version; then + args=( + '(-n --lines -c --bytes)'{-c+,--bytes=}'[print the last specified bytes; with +, start at the specified byte]:number of bytes:->number' + '(-n --lines -c --bytes)'{-n+,--lines=}'[print the last specified lines; with +, start at the specified line]:number of lines:->number' + '(-F -f)--follow=-[output appended data as the file grows]::how:(name descriptor)' + '(-F --follow)-f[same as --follow=descriptor]' + '(-f --follow --retry)-F[same as --follow=name --retry]' + '--max-unchanged-stats=[with --follow=name, check file rename after the specified number of iterations]:number of iterations' + '(-s --sleep-interval)'{-s+,--sleep-interval=}'[with -f, sleep the specfied seconds between iterations]:seconds' + '--pid=[with -f, terminate after the specified process dies]:pid:_pids' + '(-q --quiet --silent -v --verbose)'{-q,--quiet,--silent}'[never output headers giving file names]' + '(-q --quiet --silent -v --verbose)'{-v,--verbose}'[always output headers giving file names]' + '--retry[keep trying to open a file even when it becomes inaccessible]' + '(- *)--help[display help and exit]' + '(- *)--version[output version information and exit]' + ) +else + opts=(-A '-*') + args=( + '(-b -n)-c+[start at the specified byte]:bytes relative to the end (with +, beginning) of file' + '(-b -c)-n+[start at the specified line]:lines relative to the end (with +, beginning) of file' + '(-F -r)-f[wait for new data to be appended to the file]' + ) + case $OSTYPE in + (freebsd*|darwin*|dragonfly*|netbsd*|openbsd*) + args+=( + '(-f -F)-r[display the file in reverse order]' + '(-c -n)-b+[start at the specified block (512-byte)]:blocks relative to the end (with +, beginning) of file' + ) + ;| + (freebsd*|darwin*|dragonfly*|netbsd*) + args+=( '(-f -r)-F[implies -f, but also detect file rename]' ) + ;| + (freebsd*|darwin*|dragonfly*) + args+=( '-q[suppress the headers when displaying multiple files]' ) + ;; + esac +fi + +_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:((+\:"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 + ;; +esac + +return ret -- cgit v1.2.3 From 0e510f0c3522c9b18e9320388dd232a84fa79351 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 31 Oct 2015 12:54:56 +0000 Subject: 37032: Temporarily revert 36959. --- ChangeLog | 4 ++++ Completion/Unix/Command/_git | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index ed5cd5e6b..499c871e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-10-31 Daniel Shahaf + + * 37032: Completion/Unix/Command/_git: Temporarily revert 36959. + 2015-10-30 Daniel Shahaf * unposted (after 37018): Src/params.c, Test/E01options.ztst: Fix diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 320bfa712..df7a7d900 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5696,7 +5696,10 @@ __git_recent_commits () { else label="[HEAD~$distance_from_head]" fi - descr+=("@~${distance_from_head}":"${label} $k") # CROSSREF: use the same label as below + ## Disabled because _describe renders the output unhelpfuly when this function + ## is called twice during a single completion operation, and list-grouped is + ## in its default setting (enabled). + #descr+=("@~${distance_from_head}":"${label} $k") # CROSSREF: use the same label as below # Prepare for the next first-parent-ancestry commit. (( ++distance_from_head )) -- cgit v1.2.3 From 682e779a211fdfa0baa41c06d821f0ea9acf4941 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sat, 31 Oct 2015 09:54:04 -0700 Subject: unposted (cf. 36998,36999): undo 36956 / restore 34451 with expanded comment about the flip-flopping --- ChangeLog | 5 +++++ Completion/Unix/Command/_qemu | 4 ++-- Src/mem.c | 7 +++---- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 499c871e4..a35b6056f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-10-31 Barton E. Schaefer + + * unposted (cf. 36998,36999): Src/mem.c: undo 36956 / restore 34451 + with expanded comment about the flip-flopping + 2015-10-31 Daniel Shahaf * 37032: Completion/Unix/Command/_git: Temporarily revert 36959. diff --git a/Completion/Unix/Command/_qemu b/Completion/Unix/Command/_qemu index db07eba33..3c21c3e74 100644 --- a/Completion/Unix/Command/_qemu +++ b/Completion/Unix/Command/_qemu @@ -2,7 +2,7 @@ _qemu_log_items () { local -a opts hline - $service -d \? | while read -A hline; do + $service -d \? 2>/dev/null | while read -A hline; do [[ $hline[1] = Log ]] && continue opts=($opts "${hline[1]}[${hline[2,-1]}]") done @@ -11,7 +11,7 @@ _qemu_log_items () { local _qemu_machines -_qemu_machines=(${${${(f)"$($service -M \?)"}[2,-1]}%% *}) +_qemu_machines=(${${${(f)"$($service -M \? 2>/dev/null)"}[2,-1]}%% *}) _arguments \ '-'{fda,fdb,hda,hdb,hdc,hdd,cdrom}':disk image:_files' \ diff --git a/Src/mem.c b/Src/mem.c index 62d18d0cd..e31145e1e 100644 --- a/Src/mem.c +++ b/Src/mem.c @@ -79,16 +79,15 @@ #include -#if 0 /* - * This change was designed to enable use of memory mapping on MacOS. + * This definition is designed to enable use of memory mapping on MacOS. * However, performance tests indicate that MacOS mapped regions are - * significantly slower to allocate than memory from malloc(). + * somewhat slower to allocate than memory from malloc(), so whether + * using this improves performance depends on details of zhalloc(). */ #if defined(MAP_ANON) && !defined(MAP_ANONYMOUS) #define MAP_ANONYMOUS MAP_ANON #endif -#endif /* 0 */ #if defined(MAP_ANONYMOUS) && defined(MAP_PRIVATE) -- cgit v1.2.3 From fa59375e36e1718e060048ba7efd7346b3c8e94a Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sat, 31 Oct 2015 19:14:36 +0100 Subject: 37029: update options and new tr completion --- ChangeLog | 4 ++++ Completion/Unix/Command/_date | 17 +++++++++++--- Completion/Unix/Command/_sed | 8 ++----- Completion/Unix/Command/_tail | 14 ++++++++---- Completion/Unix/Command/_tr | 53 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 82 insertions(+), 14 deletions(-) create mode 100644 Completion/Unix/Command/_tr (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 86510979c..20d848320 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-10-31 Oliver Kiddle + * 37029: Completion/Unix/Command/_date, + Completion/Unix/Command/_sed, Completion/Unix/Command/_tail, + Completion/Unix/Command/_tr: update options and new tr completion + * 37028: Completion/Redhat/Command/_scl: new completion * 36993: Eric Cook: Functions/Misc/zed: fix argument parsing diff --git a/Completion/Unix/Command/_date b/Completion/Unix/Command/_date index e596ac038..ff3bac398 100644 --- a/Completion/Unix/Command/_date +++ b/Completion/Unix/Command/_date @@ -1,6 +1,6 @@ #compdef date gdate -local -a args +local -a args alts if _pick_variant gnu="Free Software Foundation" unix --version; then args=( @@ -20,16 +20,27 @@ else solaris*) args=( '-a:adjustment' ) ;; + darwin*|dragonfly*|netbsd*|openbsd*) + args+=( '-r[specify reference time]:seconds since epoch' ) + ;| freebsd*|darwin*|dragonfly*|netbsd*|openbsd*) args=( '-n[only set time on current machine]' '-d:daylight saving time value' '-j[do not try to set date]' - '-r:seconds since epoch' '-t:minutes west of GMT' ) ;| - freebsd*) args+=( '-R[RFC2822 format]' ) ;| + freebsd*) + alts=( + 'seconds:sec:_guard "(0x[0-9a-fA-F]#|[0-9]#)" "seconds since epoch"' + 'files:file:_files' + ) + args+=( + '-r[reference time: file modification or literal time]:reference: _alternative $alts' + '-R[RFC2822 format]' + ) + ;| freebsd*|dragonfly*|darwin*) args+=( '-f:parsing format' '-v:adjustment value' ) ;; diff --git a/Completion/Unix/Command/_sed b/Completion/Unix/Command/_sed index 8e2385cc8..cc7a9631d 100644 --- a/Completion/Unix/Command/_sed +++ b/Completion/Unix/Command/_sed @@ -38,12 +38,8 @@ else '-a[delay opening files listed with w function]' ) ;| - darwin*|freebsd*|netbsd*) - args+=( - '-i'$inplace - '-l[make output line buffered]' - ) - ;| + darwin*|freebsd*|netbsd*|openbsd*) args+=( '-i'$inplace ) ;| + darwin*|freebsd*|netbsd*) args+=( '-l[make output line buffered]' ) ;| freebsd*) args+=( '-u[disable data buffering]' ) ;| freebsd*|netbsd*) args+=( diff --git a/Completion/Unix/Command/_tail b/Completion/Unix/Command/_tail index 6e1445328..fbe30f13a 100644 --- a/Completion/Unix/Command/_tail +++ b/Completion/Unix/Command/_tail @@ -1,6 +1,6 @@ #compdef tail -local curcontext=$curcontext state state_descr line expl opts args ret=1 +local curcontext=$curcontext state state_descr line opts args ret=1 typeset -A opt_args if _pick_variant gnu=GNU unix --version; then @@ -27,9 +27,13 @@ else '(-F -r)-f[wait for new data to be appended to the file]' ) case $OSTYPE in - (freebsd*|darwin*|dragonfly*|netbsd*|openbsd*) + (freebsd*|darwin*|dragonfly*|netbsd*|openbsd*|solaris*) args+=( '(-f -F)-r[display the file in reverse order]' + ) + ;| + (freebsd*|darwin*|dragonfly*|netbsd*|openbsd*) + args+=( '(-c -n)-b+[start at the specified block (512-byte)]:blocks relative to the end (with +, beginning) of file' ) ;| @@ -42,14 +46,14 @@ else esac fi -_arguments -C -s -S $opts : $args '*:file:_files' && return 0 +_arguments -C -s -S $opts : $args '*:file:_files' && return case $state in (number) local mlt sign digit - mlt='multiplier:multiplier:((b\:512 K\:1024 KB\:1000 M\:1024\^2' + 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='sign:sign:((+\:"start at the specified byte/line"' + 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 diff --git a/Completion/Unix/Command/_tr b/Completion/Unix/Command/_tr new file mode 100644 index 000000000..d55fab5ff --- /dev/null +++ b/Completion/Unix/Command/_tr @@ -0,0 +1,53 @@ +#compdef tr + +local curcontext="$curcontext" state line expl ret=1 +local args variant +local -A descr +descr=( + -c '[complement characters specified by first string]' + -d '[delete specified characters from input]' + -s '[squeeze repeated instances of character to a single instance]' +) + +_pick_variant -r variant gnu=GNU $OSTYPE --version +case $variant in + gnu) + args=( + '(-c -C --complement)'{-c,-C,--complement}"${descr[-c]}" + '(-d --delete 2)'{-d,--delete}"${descr[-d]}" + '(-s --squeeze-repeats)'{-s,--squeeze-repeats}"${descr[-s]}" + '(- 1 2)--help[display help information]' + '(- 1 2)--version[display version information]' + ) + ;; + darwin*|dragonfly*|*bsd*) + args+=( "(-c)-C$descr[-c]" ) + ;| + darwin*|dragonfly*|freebsd*) + args+=( '-u[guarantee that output is unbuffered]' ) + ;| + *) + for k in c d s; do + args+=( -$k$descr[$k] ) + done + ;; +esac + +_arguments -C -s $args \ + '1:character set:->chsets' \ + '2:character set:->chsets' && ret=0 + +if [[ -n $state ]]; then + if compset -P '*\[:'; then + _wanted characters expl 'character class' \ + compadd -S ":${${QIPREFIX:+]}:-\]}$compstate[quote] " \ + alnum alpha blank cntrl digit graph lower print punct space upper \ + xdigit && return + elif compset -P '*\\'; then + _describe -t characters character \ + '(\\\\:backslash a:alert b:backspace f:form\ feed n:new\ line r:return t:tab v:vertical\ tab)' -S '' && return + fi + _message -e characters 'character set' +fi + +return ret -- cgit v1.2.3 From 9642aeeaebd654565a045475d4d3ba101bfaec8f Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 2 Nov 2015 02:55:15 +0100 Subject: 35303: remove Completion/Unix/Command/_systemd systemd's upstream version seems to be maintained well, and e.g. on Arch Linux the version from Zsh gets removed in favour of it. --- ChangeLog | 5 + Completion/Unix/Command/_systemd | 470 --------------------------------------- 2 files changed, 5 insertions(+), 470 deletions(-) delete mode 100644 Completion/Unix/Command/_systemd (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 13f262bea..bb6575b3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-11-02 Daniel Hahler + + * 35303: Completion/Unix/Command/_systemd: remove it in favour of the + one from upstream. + 2015-11-01 Peter Stephenson * 37038: Doc/Zsh/builtins.yo, Src/builtin.c, Src/options.c: add diff --git a/Completion/Unix/Command/_systemd b/Completion/Unix/Command/_systemd deleted file mode 100644 index 028ecddd9..000000000 --- a/Completion/Unix/Command/_systemd +++ /dev/null @@ -1,470 +0,0 @@ -#compdef systemctl systemd-loginctl - -# Copyright (c) 2011 Foudil Bre'tel -# -# This file is released under the GPLv3. -# -# inspired from _yum and systemctl-bash-completion.sh (shipped with systemctl) -# -# TODO: enable options after commands. Ex: systemctl list-units --all --full - -# Main dispatcher -_systemd() -{ - local curcontext="$curcontext" state lstate line - - case "$service" in - systemctl) - # -s for aggregated options like -aP - _arguments -s \ - {-h,--help}'[Show help]' \ - '--version[Show package version]' \ - {-t,--type=}'[List only units of a particular type]:unit type:(automount device mount path service snapshot socket swap target timer)' \ - \*{-p,--property=}'[Show only properties by specific name]:unit property:()' \ - {-a,--all}'[Show all units/properties, including dead/empty ones]' \ - '--failed[Show only failed units]' \ - "--full[Don't ellipsize unit names on output]" \ - '--fail[When queueing a new job, fail if conflicting jobs are pending]' \ - '--ignore-dependencies[When queueing a new job, ignore all its dependencies]' \ - '--kill-mode=[How to send signal]:killmode:(control-group process)' \ - '--kill-who=[Who to send signal to]:killwho:(main control all)' \ - {-s,--signal=}'[Which signal to send]:signal:_signals' \ - {-H,--host=}'[Show information for remote host]:userathost:_hosts_or_user_at_host' \ - {-P,--privileged}'[Acquire privileges before execution]' \ - {-q,--quiet}'[Suppress output]' \ - '--no-block[Do not wait until operation finished]' \ - "--no-wall[Don't send wall message before halt/power-off/reboot]" \ - "--no-reload[When enabling/disabling unit files, don't reload daemon configuration]" \ - '--no-legend[Do not print a legend, i.e. the column headers and the footer with hints]' \ - '--no-pager[Do not pipe output into a pager]' \ - '--no-ask-password[Do not ask for system passwords]' \ - '--order[When generating graph for dot, show only order]' \ - '--require[When generating graph for dot, show only requirement]' \ - '--system[Connect to system manager]' \ - '--user[Connect to user service manager]' \ - '--global[Enable/disable unit files globally]' \ - {-f,--force}'[When enabling unit files, override existing symlinks. When shutting down, execute action immediately]' \ - '--root=[Enable unit files in the specified root directory]:directory:_directories' \ - '--runtime[Enable unit files only temporarily until next reboot]' \ - '*::systemctl command:_systemctl_command' - ;; - - systemd-loginctl) - _arguments -s \ - {-h,--help}'[Show help]' \ - '--version[Show package version]' \ - \*{-p,--property=}'[Show only properties by this name]:unit property:' \ - {-a,--all}'[Show all properties, including empty ones]' \ - '--failed[Show only failed units]' \ - '--kill-who=[Who to send signal to]:killwho:(main control all)' \ - {-s,--signal=}'[Which signal to send]:signal:_signals' \ - {-H,--host=}'[Show information for remote host]:userathost:_hosts_or_user_at_host' \ - {-P,--privileged}'[Acquire privileges before execution]' \ - '--no-pager[Do not pipe output into a pager]' \ - '*::systemd-loginctl command:_systemd_loginctl_command' - ;; - - *) _message 'eh?' ;; - esac - -} - -_hosts_or_user_at_host() -{ - _alternative \ - 'users-hosts:: _user_at_host' \ - 'hosts:: _hosts' -} - -(( $+functions[_systemctl_command] )) || _systemctl_command() -{ - local -a _systemctl_cmds - _systemctl_cmds=( - "list-units:List units" - "start:Start (activate) one or more units" - "stop:Stop (deactivate) one or more units" - "reload:Reload one or more units" - "restart:Start or restart one or more units" - "condrestart:Restart one or more units if active" - "try-restart:Restart one or more units if active" - "reload-or-restart:Reload one or more units is possible, otherwise start or restart" - "force-reload:Reload one or more units is possible, otherwise restart if active" - "reload-or-try-restart:Reload one or more units is possible, otherwise restart if active" - "isolate:Start one unit and stop all others" - "kill:Send signal to processes of a unit" - "is-active:Check whether units are active" - "status:Show runtime status of one or more units" - "show:Show properties of one or more units/jobs or the manager" - "reset-failed:Reset failed state for all, one, or more units" - "load:Load one or more units" - "list-unit-files:List installed unit files" - "enable:Enable one or more unit files" - "disable:Disable one or more unit files" - "reenable:Reenable one or more unit files" - "preset:Enable/disable one or more unit files based on preset configuration" - "mask:Mask one or more units" - "unmask:Unmask one or more units" - "link:Link one or more units files into the search path" - "is-enabled:Check whether unit files are enabled" - "list-jobs:List jobs" - "cancel:Cancel all, one, or more jobs" - "dump:Dump server status" - "dot:Dump dependency graph for dot(1)" - "snapshot:Create a snapshot" - "delete:Remove one or more snapshots" - "show-environment:Dump environment" - "set-environment:Set one or more environment variables" - "unset-environment:Unset one or more environment variables" - "daemon-reload:Reload systemd manager configuration" - "daemon-reexec:Reexecute systemd manager" - "default:Enter system default mode" - "rescue:Enter system rescue mode" - "emergency:Enter system emergency mode" - "halt:Shut down and halt the system" - "poweroff:Shut down and power-off the system" - "reboot:Shut down and reboot the system" - "kexec:Shut down and reboot the system with kexec" - "exit:Ask for user instance termination" - "switch-root:Change to a different root file system" - "suspend:Suspend the system" - "hibernate:Hibernate the system" - "hibernate-sleep:Hibernate and suspend the system" - ) - - if (( CURRENT == 1 )); then - _describe -t commands 'systemctl command' _systemctl_cmds - else - local curcontext="$curcontext" ret - - cmd="${${_systemctl_cmds[(r)$words[1]:*]%%:*}}" - # Deal with any aliases - case $cmd in - condrestart) cmd="try-restart";; - force-reload) cmd="reload-or-try-restart";; - esac - - if (( $#cmd )); then - curcontext="${curcontext%:*:*}:systemctl-${cmd}:" - - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy _systemctl_caching_policy - fi - - _call_function ret _systemctl_$cmd || _message 'no more arguments' - else - _message "unknown systemctl command: $words[1]" - fi - return ret - fi -} - -__systemctl() -{ - systemctl --full --no-legend --no-pager "$@" -} - - -# Fills the unit list -_systemctl_all_units() -{ - if ( [[ ${+_sys_all_units} -eq 0 ]] || _cache_invalid SYS_ALL_UNITS ) && - ! _retrieve_cache SYS_ALL_UNITS; - then - _sys_all_units=( $(__systemctl list-units --all | { while read a b; do echo "$a"; done; }) ) - _store_cache SYS_ALL_UNITS _sys_all_units - fi -} - -# Fills the unit list including all file units -_systemctl_really_all_units() -{ - local -a all_unit_files; - local -a really_all_units; - if ( [[ ${+_sys_really_all_units} -eq 0 ]] || _cache_invalid SYS_REALLY_ALL_UNITS ) && - ! _retrieve_cache SYS_REALLY_ALL_UNITS; - then - all_unit_files=( $(__systemctl list-unit-files | { while read a b; do echo "$a"; done; }) ) - _systemctl_all_units - really_all_units=($_sys_all_units $all_unit_files) - _sys_really_all_units=(${(u)really_all_units}) - _store_cache SYS_REALLY_ALL_UNITS _sys_really_all_units - fi -} - -_filter_units_by_property() { - local property=$1 value=$2 ; shift ; shift - local -a units ; units=($*) - local prop unit - for ((i=1; $i <= ${#units[*]}; i++)); do - # FIXME: "Failed to issue method call: Unknown unit" errors are ignored for - # now (related to DBUS_ERROR_UNKNOWN_OBJECT). in the future, we need to - # revert to calling 'systemctl show' once for all units, which is way - # faster - unit=${units[i]} - prop=$(systemctl show --no-pager --property="$property" ${unit} 2>/dev/null) - if [[ "${prop}" = "$property=$value" ]]; then - echo "${unit}" - fi - done -} - -_systemctl_active_units() {_sys_active_units=( $(__systemctl list-units | { while read a b; do echo "$a"; done; }) )} -_systemctl_inactive_units(){_sys_inactive_units=($(__systemctl list-units --all | { while read a b c d; do [[ $c == "inactive" ]] && echo "$a"; done; }) )} -_systemctl_failed_units() {_sys_failed_units=( $(__systemctl list-units --failed | { while read a b; do echo "$a"; done; }) )} -_systemctl_enabled_units() {_sys_enabled_units=( $(__systemctl list-unit-files | { while read a b; do [[ $b == "enabled" ]] && echo "$a"; done; }) )} -_systemctl_disabled_units(){_sys_disabled_units=($(__systemctl list-unit-files | { while read a b; do [[ $b == "disabled" ]] && echo "$a"; done; }) )} -_systemctl_masked_units() {_sys_masked_units=( $(__systemctl list-unit-files | { while read a b; do [[ $b == "masked" ]] && echo "$a"; done; }) )} - -# Completion functions for ALL_UNITS -for fun in is-active is-enabled status show mask preset ; do - (( $+functions[_systemctl_$fun] )) || _systemctl_$fun() - { - _systemctl_really_all_units - compadd "$@" -a - _sys_really_all_units - } -done - -# Completion functions for ENABLED_UNITS -for fun in disable reenable ; do - (( $+functions[_systemctl_$fun] )) || _systemctl_$fun() - { - _systemctl_enabled_units - compadd "$@" -a - _sys_enabled_units - } -done - -# Completion functions for DISABLED_UNITS -(( $+functions[_systemctl_enable] )) || _systemctl_enable() -{ - _systemctl_disabled_units - compadd "$@" -a - _sys_disabled_units -} - -# Completion functions for FAILED_UNITS -(( $+functions[_systemctl_reset-failed] )) || _systemctl_reset-failed() -{ - _systemctl_failed_units - compadd "$@" -a - _sys_failed_units || _message "no failed unit found" -} - -# Completion functions for STARTABLE_UNITS -(( $+functions[_systemctl_start] )) || _systemctl_start() -{ - _systemctl_inactive_units - compadd "$@" -a - _sys_inactive_units -} - -# Completion functions for STOPPABLE_UNITS -for fun in stop kill try-restart condrestart ; do - (( $+functions[_systemctl_$fun] )) || _systemctl_$fun() - { - _systemctl_active_units - compadd "$@" - $( _filter_units_by_property CanStop yes \ - ${_sys_active_units[*]} ) - } -done - -# Completion functions for ISOLATABLE_UNITS -(( $+functions[_systemctl_isolate] )) || _systemctl_isolate() -{ - _systemctl_all_units - compadd "$@" - $( _filter_units_by_property AllowIsolate yes \ - ${_sys_all_units[*]} ) -} - -# Completion functions for RELOADABLE_UNITS -for fun in reload reload-or-try-restart force-reload ; do - (( $+functions[_systemctl_$fun] )) || _systemctl_$fun() - { - _systemctl_active_units - compadd "$@" - $( _filter_units_by_property CanReload yes \ - ${_sys_active_units[*]} ) - } -done - -# Completion functions for RESTARTABLE_UNITS -for fun in restart reload-or-restart ; do - (( $+functions[_systemctl_$fun] )) || _systemctl_$fun() - { - _systemctl_all_units - compadd "$@" - $( _filter_units_by_property CanStart yes \ - ${_sys_all_units[*]} | while read line; do \ - [[ "$line" =~ \.(device|snapshot|socket|timer)$ ]] || echo "$line"; \ - done ) - } -done - -# Completion functions for MASKED_UNITS -(( $+functions[_systemctl_unmask] )) || _systemctl_unmask() -{ - _systemctl_masked_units - compadd "$@" -a - _sys_masked_units || _message "no masked unit found" -} - -# Completion functions for JOBS -(( $+functions[_systemctl_cancel] )) || _systemctl_cancel() -{ - compadd "$@" - $(__systemctl list-jobs \ - | cut -d' ' -f1 2>/dev/null ) || _message "no job found" -} - -# Completion functions for SNAPSHOTS -(( $+functions[_systemctl_delete] )) || _systemctl_delete() -{ - compadd "$@" - $(__systemctl list-units --type snapshot --all \ - | cut -d' ' -f1 2>/dev/null ) || _message "no snampshot found" -} - -# Completion functions for ENVS -for fun in set-environment unset-environment ; do - (( $+functions[_systemctl_$fun] )) || _systemctl_$fun() - { - local fun=$0 ; fun=${fun##_systemctl_} - local suf - if [[ "${fun}" = "set-environment" ]]; then - suf='-S=' - fi - - compadd "$@" ${suf} - $(systemctl show-environment \ - | while read line; do echo "${line%%\=}";done ) - } -done - -(( $+functions[_systemctl_link] )) || _systemctl_link() { _files } - -(( $+functions[_systemctl_switch-root] )) || _systemctl_switch-root() -{ - if (( CURRENT == 2 )); then - _directories - fi -} - -# no systemctl completion for: -# [STANDALONE]='daemon-reexec daemon-reload default dot dump -# emergency exit halt kexec list-jobs list-units -# list-unit-files poweroff reboot rescue show-environment' -# [NAME]='snapshot load' - -_systemctl_caching_policy() -{ - local _sysunits - local -a oldcache - - # rebuild if cache is more than a day old - oldcache=( "$1"(mh+1) ) - (( $#oldcache )) && return 0 - - _sysunits=($(__systemctl --all | cut -d' ' -f1)) - - if (( $#_sysunits )); then - for unit in $_sysunits; do - [[ "$unit" -nt "$1" ]] && return 0 - done - fi - - return 1 -} - - - -_systemd_loginctl_all_sessions(){_sys_all_sessions=($(systemd-loginctl list-sessions | { while read a b; do echo "$a"; done; }) )} -_systemd_loginctl_all_users() {_sys_all_users=( $(systemd-loginctl list-users | { while read a b; do echo "$a"; done; }) )} -_systemd_loginctl_all_seats() {_sys_all_seats=( $(systemd-loginctl list-seats | { while read a b; do echo "$a"; done; }) )} - -# Completion functions for SESSIONS -for fun in session-status show-session activate lock-session unlock-session terminate-session kill-session ; do - (( $+functions[_systemd_loginctl_$fun] )) || _systemd_loginctl_$fun() - { - _systemd_loginctl_all_sessions - compadd "$@" -a - _sys_all_sessions - } -done - -# Completion functions for USERS -for fun in user-status show-user enable-linger disable-linger terminate-user kill-user ; do - (( $+functions[_systemd_loginctl_$fun] )) || _systemd_loginctl_$fun() - { - _systemd_loginctl_all_users - compadd "$@" -a - _sys_all_users - } -done - -# Completion functions for SEATS -(( $+functions[_systemd_loginctl_seats] )) || _systemd_loginctl_seats() -{ - _systemd_loginctl_all_seats - compadd "$@" -a - _sys_all_seats -} -for fun in seat-status show-seat terminate-seat ; do - (( $+functions[_systemd_loginctl_$fun] )) || _systemd_loginctl_$fun() - { _systemd_loginctl_seats } -done - -# Completion functions for ATTACH -(( $+functions[_systemd_loginctl_attach] )) || _systemd_loginctl_attach() -{ - _systemd_loginctl_all_seats - - _arguments -w -C -S -s \ - ':seat:_systemd_loginctl_seats' \ - '*:device:_files' -} - -# no systemd-loginctl completion for: -# [STANDALONE]='list-sessions list-users list-seats flush-devices' - -(( $+functions[_systemd_loginctl_command] )) || _systemd_loginctl_command() -{ - local -a _systemd_loginctl_cmds - _systemd_loginctl_cmds=( - "list-sessions:List sessions" - "session-status:Show session status" - "show-session:Show properties of one or more sessions" - "activate:Activate a session" - "lock-session:Screen lock one or more sessions" - "unlock-session:Screen unlock one or more sessions" - "terminate-session:Terminate one or more sessions" - "kill-session:Send signal to processes of a session" - "list-users:List users" - "user-status:Show user status" - "show-user:Show properties of one or more users" - "enable-linger:Enable linger state of one or more users" - "disable-linger:Disable linger state of one or more users" - "terminate-user:Terminate all sessions of one or more users" - "kill-user:Send signal to processes of a user" - "list-seats:List seats" - "seat-status:Show seat status" - "show-seat:Show properties of one or more seats" - "attach:Attach one or more devices to a seat" - "flush-devices:Flush all device associations" - "terminate-seat:Terminate all sessions on one or more seats" - ) - - if (( CURRENT == 1 )); then - _describe -t commands 'systemd-loginctl command' _systemd_loginctl_cmds || compadd "$@" - else - local curcontext="$curcontext" - - cmd="${${_systemd_loginctl_cmds[(r)$words[1]:*]%%:*}}" - - if (( $#cmd )); then - curcontext="${curcontext%:*:*}:systemd_loginctl-${cmd}:" - - _call_function ret _systemd_loginctl_$cmd || _message 'no more arguments' - else - _message "unknown systemd-loginctl command: $words[1]" - fi - return ret - fi -} - -_systemd "$@" - -# Local Variables: -# mode: sh -# sh-indentation: 2 -# indent-tabs-mode: nil -# sh-basic-offset: 2 -# End: -- cgit v1.2.3 From 20153c573e1d9156fdee02fb854298bc0b88545f Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 4 Nov 2015 17:37:17 +0000 Subject: 37062: tentative mechanism for git commit descriptions. Mechanism for forcing completion system into verbose mode is subject to change. --- ChangeLog | 6 ++++++ Completion/Unix/Command/_git | 42 +++++++++++++++++++++++++++++++++--------- 2 files changed, 39 insertions(+), 9 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index bb6575b3a..6b4a38a85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-11-04 Peter Stephenson + + * 37062: Completion/Unix/Command/_git: allow verbose + descriptions of commits and branches using git log. Mechanism + for turning this on subject to change. + 2015-11-02 Daniel Hahler * 35303: Completion/Unix/Command/_systemd: remove it in favour of the diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index df7a7d900..61386bfac 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5004,6 +5004,33 @@ __git_is_in_middle_of_merge () { [[ -f $gitdir/MERGE_HEAD ]] } +(( $+functions[__git_describe_branch] )) || +__git_describe_branch () { + local __commits_in=$1 + local __tag=$2 + local __desc=$3 + shift 3 + + integer maxverbose + if zstyle -s :completion:$curcontext max-verbose maxverbose && + (( ${compstate[nmatches]} <= maxverbose )); then + local __c + local -a __commits + for __c in ${(P)__commits_in}; do + __commits+=("${__c}:${$(_call_program describe git log -1 --oneline $__c)//:/\\:}") + done + _describe -t $__tag $__desc __commits "$@" + else + local expl + _wanted $__tag expl $__desc compadd "$@" -a - $__commits_in + fi +} + +(( $+functions[__git_describe_commit] )) || +__git_describe_commit () { + __git_describe_branch $1 $2 $3 -M 'r:|/=**' "${(@)argv[4,-1]}" +} + # Completion Wrappers (( $+functions[__git_ignore_line] )) || @@ -5541,29 +5568,27 @@ __git_branch_names () { branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) __git_command_successful $pipestatus || return 1 - _wanted branch-names expl branch-name compadd -M 'r:|/=**' "$@" -a - branch_names + __git_describe_commit branch_names branch-names 'branch name' "$@" } (( $+functions[__git_remote_branch_names] )) || __git_remote_branch_names () { - local expl declare -a branch_names branch_names=(${${(f)"$(_call_program remote-branch-refs git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}#refs/remotes/}) __git_command_successful $pipestatus || return 1 - _wanted remote-branch-names expl 'remote branch name' compadd -M 'r:|/=**' "$@" -a - branch_names + __git_describe_commit branch_names remote-branch-names 'remote branch name' "$@" } (( $+functions[__git_remote_branch_names_noprefix] )) || __git_remote_branch_names_noprefix () { - local expl declare -a heads branch_names=(${${${${(f)"$(_call_program remote-branch-refs-noprefix git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}#refs/remotes/}#*/}:#HEAD}) __git_command_successful $pipestatus || return 1 - _wanted remote-branch-names-noprefix expl 'remote branch name' compadd -M 'r:|/=**' "$@" -a - branch_names + __git_describe_commit branch_names remote-branch-names-noprefix 'remote branch name' "$@" } (( $+functions[__git_commit_objects_prefer_recent] )) || @@ -5603,7 +5628,7 @@ __git_heads () { (( $+functions[__git_heads_local] )) || __git_heads_local () { - local gitdir expl start + local gitdir declare -a heads heads=(${(f)"$(_call_program headrefs git for-each-ref --format='"%(refname:short)" refs/heads' 2>/dev/null)"}) @@ -5615,17 +5640,16 @@ __git_heads_local () { [[ -f $gitdir/refs/stash ]] && heads+=stash fi - _wanted heads-local expl "local head" compadd -M 'r:|/=**' "$@" -a - heads + __git_describe_commit heads heads-local "local head" "$@" } (( $+functions[__git_heads_remote] )) || __git_heads_remote () { - local gitdir expl start declare -a heads heads=(${(f)"$(_call_program headrefs git for-each-ref --format='"%(refname:short)" refs/remotes' 2>/dev/null)"}) - _wanted heads-remote expl "remote head" compadd -M 'r:|/=**' "$@" -a - heads + __git_describe_commit heads heads-remote "remote head" "$@" } (( $+functions[__git_commit_objects] )) || -- cgit v1.2.3 From 6198f7ffbae48230561fdd6996358fd553d954db Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 31 Oct 2015 12:52:46 +0000 Subject: 37031: _git-merge: Exclude ancestors of HEAD from recent commit completion As done for _git-cherry-pick in a428c6b62cb2 (36328 + 36340). --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index f314e82f4..9fd23ada9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-11-13 Daniel Shahaf + * 37031: Completion/Unix/Command/_git: _git-merge: Exclude + ancestors of HEAD from recent commit completion + * 37025: Functions/VCS_Info/Backends/VCS_INFO_get_data_git: vcs_info git: Add a cherry-pick patch-format diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 61386bfac..3dfd604e9 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1131,6 +1131,7 @@ _git-log () { _git-merge () { local -a merge_options __git_setup_merge_options + local -a git_commit_opts=(--all --not HEAD --not) _arguments -w -S -s \ $merge_options \ @@ -1138,7 +1139,7 @@ _git-merge () { '( --no-rerere-autoupdate)--rerere-autoupdate[allow the rerere mechanism to update the index]' \ '(--rerere-autoupdate )--no-rerere-autoupdate[do not allow the rerere mechanism to update the index]' \ '--abort[restore the original branch and abort the merge operation]' \ - '*: :__git_commits' + '*: : __git_commits -O expl:git_commit_opts' } (( $+functions[_git-mv] )) || -- cgit v1.2.3 From 9ce000db220d0c676ff14cfe4fa436e6988f59ad Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sat, 14 Nov 2015 21:22:17 -0800 Subject: 37115: update for changes in ${(P)...} evaluation. --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 2 +- Doc/Zsh/expn.yo | 27 ++++++++++++++++++++++----- 3 files changed, 28 insertions(+), 6 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 52c770b00..a27c49817 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-11-14 Barton E. Schaefer + + * 37115: Completion/Unix/Commmand/_git, Doc/Zsh/expn.yo: update + for changes in ${(P)...} evaluation. + 2015-11-13 Daniel Shahaf * unposted: Src/Zle/zle_tricky.c: Make $EDITOR's diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 3dfd604e9..614185ebb 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5244,7 +5244,7 @@ _git_commands () { for cmdtype in aliases $cmdtypes; do local -a ${cmdtype}_d (( $#disp )) && set -A ${cmdtype}_d \ - ${${(Pr.COLUMNS-4.)cmdtype/(#s)(#m)[^:]##:/${(r.len.)MATCH[1,-2]} $sep }%% #} + ${${(r.COLUMNS-4.)${(P)cmdtype}/(#s)(#m)[^:]##:/${(r.len.)MATCH[1,-2]} $sep }%% #} alts+=( "${cmdtype//_/-}:${${cmdtype//_/ }%%(e|)s}:compadd ${(e)disp} -a ${cmdtype}_m" ) done diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index 4c373d1f2..6f08d7d47 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -1380,9 +1380,13 @@ outermost. The flags are not propagated up to enclosing substitutions; the nested substitution will return either a scalar or an array as determined by the flags, possibly adjusted for quoting. All the following steps take place where applicable at all levels of substitution. -Note that, unless the `tt((P))' flag is present, the flags and any subscripts -apply directly to the value of the nested substitution; for example, the -expansion tt(${${foo}}) behaves exactly the same as tt(${foo}). + +Note that, unless the `tt((P))' flag is present, the flags and any +subscripts apply directly to the value of the nested substitution; for +example, the expansion tt(${${foo}}) behaves exactly the same as +tt(${foo}). When the `tt((P))' flag is present in a nested substitution, +the other substitution rules are applied to the value em(before) it is +interpreted as a name, so tt(${${(P)foo}}) may differ from tt(${(P)foo}). At each nested level of substitution, the substituted words undergo all forms of single-word substitution (i.e. not filename generation), including @@ -1400,6 +1404,12 @@ in particular the tt(L), tt(R), tt(Z), tt(u) and tt(l) flags for padding and capitalization, are applied directly to the parameter value. Note these flags are options to the command, e.g. `tt(typeset -Z)'; they are not the same as the flags used within parameter substitutions. + +At the outermost level of substitution, the `tt((P))' flag ignores these +transformations and uses the unmodified value of the parameter as the name +to be replaced. This is usually the desired behavior because padding may +make the value syntactically illegal as a parameter name, but if +capitalization changes are desired, use the tt(${${(P)foo}}) form. ) item(tt(3.) em(Parameter subscripting))( If the value is a raw parameter reference with a subscript, such as @@ -1413,8 +1423,10 @@ original array). Any number of subscripts may appear. Flags such as tt((k)) and tt((v)) which alter the result of subscripting are applied. ) item(tt(4.) em(Parameter name replacement))( -The effect of any tt((P)) flag, which treats the value so far as a -parameter name and replaces it with the corresponding value, is applied. +At the outermost level of nesting only, the effect of any tt((P)) flag, +which treats the value so far as a parameter name and replaces it with the +corresponding value, is applied. This replacement occurs later if the +tt((P)) flag appears in a nested substitution. ) item(tt(5.) em(Double-quoted joining))( If the value after this process is an array, and the substitution @@ -1534,6 +1546,11 @@ Strictly speaking, the removal happens later as the same happens with other forms of substitution; the point to note here is simply that it occurs after any of the above parameter operations. ) +item(tt(25.) em(Parameter name replacement))( +If the `tt((P))' flag is present and this has not yet been done, the value +so far is looked up as a parameter name. Errors may occur if the value is +neither a valid identifier nor an identifier plus subscript expression. +) enditem() subsect(Examples) -- cgit v1.2.3 From afc4d416524f186e3bdb01c512b7c7795eb5572b Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 17 Nov 2015 22:14:04 +0000 Subject: 37129: _git: Complete 'commit -p' --- ChangeLog | 4 ++++ Completion/Unix/Command/_git | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 1000ae611..14e5783c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-11-17 Daniel Shahaf + + * 37129: Completion/Unix/Command/_git: _git: Complete 'commit -p' + 2015-11-17 Peter Stephenson * 37128: Src/lex.c, Test/D06subscript.ztst: work around alias diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 614185ebb..c97fed399 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -656,7 +656,7 @@ _git-commit () { '( --porcelain --dry-run)--short[output dry run in short format]' \ '(--short --dry-run)--porcelain[output dry run in porcelain-ready format]' \ '(--short --porcelain --dry-run -z --null)'{-z,--null}'[separate dry run entry output with NUL]' \ - '--patch[use the interactive patch selection interface to chose which changes to 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]' \ -- cgit v1.2.3 From d554f31bcbe1264f69e22e990d356ab7ee6e87a8 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 20 Nov 2015 03:39:26 +0000 Subject: 37149: _git: Complete 'bisect/bad' ref --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 1 + 2 files changed, 6 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 5355abaa6..5ab68f7a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-11-20 Daniel Shahaf + + * 37149: Completion/Unix/Command/_git: _git: Complete + 'bisect/bad' ref + 2015-11-19 Peter Stephenson * 37159: NEWS, README: update for next version. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index c97fed399..6e8e9c665 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5639,6 +5639,7 @@ __git_heads_local () { [[ -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 c563f1ba83c40aab632ac958a1d3a57277ca22cc Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 20 Nov 2015 03:39:47 +0000 Subject: 37164: _tmux: Complete external commands --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 5ab68f7a1..252f2fc5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-11-20 Daniel Shahaf + * 37164: Completion/Unix/Command/_tmux: _tmux: Complete external + commands + * 37149: Completion/Unix/Command/_git: _git: Complete 'bisect/bad' ref diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 6f2cac790..d218cc3f3 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -640,7 +640,7 @@ function _tmux-new-session() { '-t[specify target session]:sessions:__tmux-sessions' '-x[specify width]:width:_guard "[0-9]#" "numeric value"' '-y[specify height]:height:_guard "[0-9]#" "numeric value"' - '*:: :_command' + '*:: :_cmdstring' ) _arguments -s ${args} } @@ -657,7 +657,7 @@ function _tmux-new-window() { '-n[specify a window name]:window name:' '-P[print information about new window after it is created]' '-t[specify target window]:windows:__tmux-windows' - '*:: :_command' + '*:: :_cmdstring' ) _arguments ${args} } @@ -776,7 +776,7 @@ function _tmux-respawn-pane() { args=( '-k[kill window if it is in use]' '-t[choose target pane]:window:__tmux-pane' - '*::command:_command' + '*::command:_cmdstring' ) _arguments ${args} } @@ -787,7 +787,7 @@ function _tmux-respawn-window() { args=( '-k[kill window if it is in use]' '-t[choose target window]:window:__tmux-windows' - '*::command:_command' + '*::command:_cmdstring' ) _arguments ${args} } @@ -809,7 +809,7 @@ function _tmux-run-shell() { args=( '-b[run shell command in background]' '-t[choose target pane]:pane:__tmux-panes' - '*::command:_command' + '*::command:_cmdstring' ) _arguments ${args} } @@ -1042,7 +1042,7 @@ function _tmux-split-window() { # changing the command's name might annoy users. So it stays like # this. '-t[choose target pane]:window:__tmux-panes' - '*:: :_command' + '*:: :_cmdstring' ) _arguments ${args} && return } -- cgit v1.2.3