From 52cace80567dc53fa8d32f3664b524b5e8ec905b Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 2 Jun 2015 00:52:11 +0200 Subject: 35356: factor out completion of tty devices --- Completion/Unix/Command/_gdb | 6 ++++-- Completion/Unix/Command/_last | 4 ++-- Completion/Unix/Command/_pgrep | 8 +------- Completion/Unix/Command/_ps | 5 ++--- 4 files changed, 9 insertions(+), 14 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/Completion/Unix/Command/_gdb b/Completion/Unix/Command/_gdb index 48c9d654f..f387c878a 100644 --- a/Completion/Unix/Command/_gdb +++ b/Completion/Unix/Command/_gdb @@ -5,17 +5,19 @@ local cur="$words[CURRENT]" prev w list ret=1 expl [[ "$PREFIX" = --* ]] && _arguments -- '*=(CORE|SYM)FILE:core file:_files' \ '*=EXECFILE:executable:_files -g \*\(-\*\)' \ - '*=TTY:terminal device:compadd /dev/tty\*' && return 0 + '*=TTY:terminal device:_ttys' && return 0 if compset -P '-(cd|directory)='; then _files -/ elif compset -P '-tty='; then - _wanted devices expl 'terminal device' compadd - /dev/tty* + _wanted devices expl 'terminal device' _ttys elif compset -P '-(exec|se)='; then _description files expl executable _files "$expl[@]" -g '*(-*)' elif compset -P '-(symbols|core|command)='; then _files +elif compset -P '--pid='; then + _pids elif [[ "$PREFIX" = -* ]]; then _tags options while _tags; do diff --git a/Completion/Unix/Command/_last b/Completion/Unix/Command/_last index 706d82f26..f198e0fff 100644 --- a/Completion/Unix/Command/_last +++ b/Completion/Unix/Command/_last @@ -9,7 +9,7 @@ for pattern arg in \ '((free|net|open)bsd*|darwin*|dragonfly*|linux-gnu)' '-h[limit sessions by hostname]:host:_hosts' \ '((free|open)bsd*|linux-gnu)' '-s[report duration in seconds]' \ '(freebsd*|openbsd*)' '-d[limit sessions to those active at snapshot time]:time ([[CC]YY][MMDD]hhmm[.SS])' \ - '((net|free|open)bsd*|darwin*|dragonfly*)' '-t[limit sessions by tty]:tty:compadd -a ttys' \ + '((net|free|open)bsd*|darwin*|dragonfly*)' '-t[limit sessions by tty]:tty:_ttys -D' \ 'openbsd*' '-c[calculate total time]' \ '^darwin*' '-f[specify account file]:file:_files' \ '(solaris*|linux-gnu|freebsd*|openbsd*)' '-n[specify number of lines to show]:number' \ @@ -45,7 +45,7 @@ case $OSTYPE in esac if [[ $OSTYPE = (linux-gnu|solaris*) ]]; then - args+=( '*:arg: _alternative "users:user:_users" "ttys:tty:compadd -a ttys"' ) + args+=( '*:arg: _alternative "users:user:_users" "ttys:tty:_ttys -d" "ttys:tty:(reboot)"' ) else args+=( '*:user:_users' ) fi diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index d3dcd1812..0b7d23d4d 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -13,7 +13,7 @@ arguments=('-P[parent process id]:parent process id:->ppid' '-M[extract the name list from the specified core]:files:_files' '-N[extract the name list from the specified system]:files:_files' '-s[match only session id]:session id:->sid' - '-t[match only controlled by terminal]:terminal device:->tty' + '-t[match only controlled by terminal]:terminal device:_sequence _ttys -d' '-T[match only in processes specified routing table in rtable]' '-u[match only effective user id]:user:_users' '-U[match only real user id]:user:_users' @@ -69,12 +69,6 @@ arguments=( ${(M)arguments:#(|\*)(|\(*\))-[$optchars]*} _arguments -C -s -w $arguments && ret=0 case $state in - (tty) - local -a ttys - ttys=( /dev/tty*(N) /dev/pts/*(N) ) - _sequence -s , _wanted tty expl 'terminal device' compadd - ${ttys#/dev/} - ;; - (sid) if [[ $OSTYPE == openbsd* ]]; then break diff --git a/Completion/Unix/Command/_ps b/Completion/Unix/Command/_ps index e557b27b9..6f67f7933 100644 --- a/Completion/Unix/Command/_ps +++ b/Completion/Unix/Command/_ps @@ -31,7 +31,7 @@ args=( '*-G+[select processes by real group]:group:_sequence -s , _groups' '*-g+[select processes by effective group or session]:group:_sequence -s , _groups' '*-s+[select processes by session leaders]:session leader:_sequence -s , _pids' - '*-t+[select processes by attached terminal]:tty:_sequence -s , compadd - /dev/pts/<->(N\:s/\\/dev\\//) /dev/tty*(N\:t)' + '*-t+[select processes by attached terminal]:tty:_sequence -s , _ttys -D' '*-u+[select processes by effective user]:user:_sequence -s , _users' '*-U+[select processes by real user]:user:_sequence -s , _users' '-o+[specify output format]:property:_sequence -s , _ps_props -' @@ -163,8 +163,7 @@ if (( CURRENT > 1 )) && [[ $OSTYPE != solaris* || ( $OSTYPE = linux-gnu && $word *J) _sequence _jails -0 && return ;; *[MNW]) _files && return ;; *t) - _wanted -C option-t-1 ttys expl tty _sequence -s , \ - compadd - /dev/pts/<->(N\:s/\\/dev\\//) /dev/tty*(N\:t) && return + _wanted -C option-t-1 ttys expl tty _sequence -s , _ttys -D && return ;; *p) _wanted -C option-p-1 processes expl 'process ID' _sequence -s , _pids && return;; *U) _wanted -C option-U-1 users expl user _sequence -s , _users && return ;; -- cgit v1.2.3 From 83ac36c14f3457f49b77bba9b806d2577a6128f3 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 23 May 2015 10:11:26 +0000 Subject: 35271: New completion: beep. The new completion is mostly boilerplate except for the handling of $words/$CURRENT to support specifying the arguments multiple times separated by -n. --- ChangeLog | 3 +++ Completion/Unix/Command/_beep | 50 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 Completion/Unix/Command/_beep (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 25fdb31ed..3ef78201e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-06-02 Daniel Shahaf + * 35271: Completion/Unix/Command/_beep: New completion: + beep. + * unposted: Doc/Zsh/options.yo: Typo fix 2015-06-02 Peter Stephenson diff --git a/Completion/Unix/Command/_beep b/Completion/Unix/Command/_beep new file mode 100644 index 000000000..c49c09726 --- /dev/null +++ b/Completion/Unix/Command/_beep @@ -0,0 +1,50 @@ +#compdef _beep + +# beep [--verbose | --debug] [-e device | --device device] [-f N] [-l N] +# [-r N] [-d N] [-D N] [-s] [-c] +# beep [ OPTIONS ] [-n] [--new] [ OPTIONS ] +# beep [-h] [--help] +# beep [-v] [-V] [--version] + +# We support the -n/--new restart flag, when it is in its own word, by +# stripping all words from the command line that are after the first -n +# following words[CURRENT] or before the first -n preceding it. As far as +# _arguments knows, the -n flag does not exist, and argv should specify +# a single beeping specification. + +## Strip $words[2] through the first -n preceding $words[CURRENT]. +integer specstart +while specstart=$words[(i)(-n|--new)] + (( specstart < CURRENT )) +do + words[2,specstart]=() + (( CURRENT -= specstart - 1)) +done +unset specstart + +## Strip everything in $words after the first -n following $words[CURRENT]. +integer specend +while specend=$words[(I)(-n|--new)] + (( specend > CURRENT )) +do + words[specend,$#words]=() +done +unset specend + +local -a args +args=( + "(--verbose --debug)"{--verbose,--debug}"[enable debug output]" + "(-e --device)"{-e+,--device=}"[specify device to use]:device (default /dev/tty0, /dev/vc/0)" + "-f+:frequency (Hz) as integer or float" + "-l+:duration (ms)" + "-r+:number of repetitions" + "(-D)-d+[delay between beeps]:delay (ms)" + "(-d)-D+[delay after each beep]:delay (ms)" + "(-n --new)"{-n,--new}"[start a new beeping specification]" + "-s[cat, and beep after each line]" + "-c[cat, and beep after each character]" + "(-)"{-h,--help}"[display usage info]" + "(-)"{-v,-V,--version}"[display version info]" +) + +_arguments -s -S -w : $args -- cgit v1.2.3 From e8cf611879a2d9e6bf84af0dabaa1ff985c96f4e Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 7 Jun 2015 23:49:32 +0200 Subject: 35216: _git-checkout: do not call __git_commits twice This makes `branch_arg` empty by default, to be used only for __git_remote_branch_names. `branches::__git_revisions` was used here, but that's the same as tree_ish_arg='tree-ishs::__git_tree_ishs' - both call __git_commits. Only tree_ish_arg will call __git-commits now. --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index e4b3ed77b..8dfdbc5cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-06-08 Daniel Hahler + + * 35216: Completion/Unix/Command/_git: _git-checkout: do not call + __git_commits twice. + 2015-06-07 Oliver Kiddle * 35412: Src/builtin.c, Test/B03print.ztst: fix for - flag diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index b8edc109e..088a7dbb7 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -456,14 +456,13 @@ _git-checkout () { [[ $line[CURRENT] = -* ]] && return if (( CURRENT == 1 )) && [[ -z $opt_args[(I)--] ]]; then # TODO: Allow A...B - local branch_arg='branches::__git_revisions' \ + local branch_arg='' \ remote_branch_noprefix_arg='remote branches::__git_remote_branch_names_noprefix' \ tree_ish_arg='tree-ishs::__git_tree_ishs' \ file_arg='modified-files::__git_modified_files' if [[ -n ${opt_args[(I)-b|-B|--orphan|--detach]} ]]; then remote_branch_noprefix_arg= - tree_ish_arg= file_arg= elif [[ -n $opt_args[(I)--track] ]]; then branch_arg='remote-branches::__git_remote_branch_names' @@ -471,7 +470,6 @@ _git-checkout () { tree_ish_arg= file_arg= elif [[ -n ${opt_args[(I)--ours|--theirs|-m|--conflict|--patch]} ]]; then - branch_arg= remote_branch_noprefix_arg= fi -- cgit v1.2.3 From 806f73a0b3d3959d5af12ce97e0258b4d4fe7d76 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sun, 14 Jun 2015 20:10:50 -0700 Subject: 35467: complete files for non-GNU du --- ChangeLog | 4 ++++ Completion/Unix/Command/_du | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 5b45e5e8f..f297a0b17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-06-14 Barton E. Schaefer + + * 35467: Completion/Unix/Command/_du: complete files for non-GNU du + 2015-06-12 Peter Stephenson * 35448: Src/Modules/curses.c, Src/Modules/regex.c, diff --git a/Completion/Unix/Command/_du b/Completion/Unix/Command/_du index d8871cd8d..4065a20de 100644 --- a/Completion/Unix/Command/_du +++ b/Completion/Unix/Command/_du @@ -74,5 +74,5 @@ else do [[ $OSTYPE = $~pattern ]] && args+=( $arg ) done - _arguments -s -A "-*" $args + _arguments -s -A "-*" $args '*:file:_files' fi -- cgit v1.2.3 From 54c2c442eeee46b28d5596e7e83812df01d1f13f Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Mon, 15 Jun 2015 05:43:46 +0200 Subject: _gdb: Allow 'core' to occur anywhere in a coredump filename --- ChangeLog | 5 +++++ Completion/Unix/Command/_gdb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 17fd01237..cb3b5e78d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-06-17 Mikael Magnusson + + * 35477: Completion/Unix/Command/_gdb: _gdb: Allow 'core' to + occur anywhere in a coredump filename + 2015-06-14 Barton E. Schaefer * 35469: Functions/Zle/smart-insert-last-word: test UNDO_CHANGE_NO diff --git a/Completion/Unix/Command/_gdb b/Completion/Unix/Command/_gdb index f387c878a..e9c333925 100644 --- a/Completion/Unix/Command/_gdb +++ b/Completion/Unix/Command/_gdb @@ -49,7 +49,7 @@ else done if [[ $#w -gt 1 ]]; then - _alternative "files:: _files -g '*core(-.)'" "processes:: _pids -m ${w[1]:t}" + _alternative "files:: _files -g '*core*(-.)'" "processes:: _pids -m ${w[1]:t}" else _description files expl executable _files "$expl[@]" -g '*(-*)' -- cgit v1.2.3 From 8ebb4e65a9b47d68b730ff02e70d9ba28d3ccd3f Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 18 Jun 2015 23:47:40 +0200 Subject: 35504: complete % placeholders for git log --format --- ChangeLog | 3 ++ Completion/Unix/Command/_git | 100 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 93 insertions(+), 10 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 9614924d6..2b4dfb4a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-06-18 Oliver Kiddle + * 35504: Completion/Unix/Command/_git: complete % placeholders + for git log --format + * 35521: Completion/Zsh/Type/_file_descriptors: sort matches numerically and use pfiles on Solaris diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 088a7dbb7..3e728865b 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -6269,6 +6269,95 @@ __git_setup_diff_stage_options () { ) } +(( $+functions[__git_format_placeholders] )) || +__git_format_placeholders() { + local sep + local -a disp names placeholders expl + if compset -P 'format:'; then + compset -P '(%[^acgCG]|%?[^%]|[^%])#' + if compset -P '%C'; then + _wanted colors expl color compadd reset red green blue + return + fi + if [[ -prefix %G ]]; then + placeholders=( + 'GG:raw verification message' + 'G?:indicate [G]ood, [B]ad, [U]ntrusted or [N]o signature' + 'GS:name of signer' + 'GK:signing key' + ) + disp=( -l ) + elif [[ -prefix %g ]]; then + placeholders=( + gD:'reflog selector' + gd:'short reflog selector' + gn:'reflog identity' + gs:'reflog subject' + ) + disp=( -l ) + elif [[ $PREFIX = (#b)%([ac]) ]]; then + placeholders=( + n:'name' + N:'name (use .mailmap)' + e:'email' + E:'email (use .mailmap)' + d:'date' + D:'date, RFC2822 style' + r:'date, relative' + t:'date, UNIX timestamp' + i:'date, like ISO 8601' + I:'date, strict ISO 8601' + ) + placeholders=( $match[1]$^placeholders ) + else + placeholders=( + H:commit\ hash + h:'abbreviated commit hash' + T:'tree hash' + t:'abbreviated tree hash' + P:'parent hash' + p:'abbreviated parent hash' + a:'author details' + c:'committer details' + d:'ref name in brackets' + D:'ref name' + e:encoding + s:subject + f:'sanitized subject' + g:reflog + b:body + B:'raw body' + N:notes + G:GPG\ details + C:color + m:mark + n:newline + %:raw\ % + x:'hex code' + w:'switch line wrapping' + ) + fi + names=( ${placeholders%%:*} ) + if zstyle -T ":completion:${curcontext}:" verbose; then + zstyle -s ":completion:${curcontext}:" list-separator sep || sep=-- + zformat -a placeholders " $sep " $placeholders + disp+=(-d placeholders) + else + disp=() + fi + _wanted placeholders expl placeholder \ + compadd -p % -S '' "$disp[@]" "$@" - "$names[@]" + else + _describe -t formats format '( oneline:"commit-ids and subject of messages" + short:"few headers and only subject of messages" + medium:"most parts of messages" + full:"all parts of commit messages" + fuller:"like full and includes dates" + email:"use email headers like From and Subject" + raw:"the raw commits" )' -- '( format:"specify own format" )' -S ':' + fi +} + (( $+functions[__git_setup_revision_options] )) || __git_setup_revision_options () { local -a diff_options @@ -6276,16 +6365,7 @@ __git_setup_revision_options () { revision_options=( $diff_options - # TODO: format pretty print format is a lot more advanced than this. - # TODO: You can't actually specify --format without a format. - '(-v --header)'{--pretty=-,--format=-}'[pretty print commit messages]::format:((oneline\:"commit-ids and subject of messages" - short\:"few headers and only subject of messages" - medium\:"most parts of messages" - full\:"all parts of commit messages" - fuller\:"like full and includes dates" - email\:"use email headers like From and Subject" - raw\:"the raw commits" - format\:"specify own format"))' + '(-v --header)'{--pretty=-,--format=-}'[pretty print commit messages]::format:__git_format_placeholders' '(--abbrev-commit --no-abbrev-commit)--abbrev-commit[show only partial prefixes of commit object names]' '(--abbrev-commit --no-abbrev-commit)--no-abbrev-commit[show the full 40-byte hexadecimal commit object name]' '(--abbrev --no-abbrev)--abbrev=[set minimum SHA1 display-length (for use with --abbrev-commit)]: :__git_guard_number length' -- cgit v1.2.3 From deb2ec7f174df720033e7001be0c8d8f0bd9a9d9 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 18 Jun 2015 23:50:59 +0200 Subject: 35510: use consistent formatting for git subcommands --- ChangeLog | 3 ++ Completion/Unix/Command/_git | 116 ++++++++++++------------------------------- 2 files changed, 36 insertions(+), 83 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 2b4dfb4a3..42b25a74d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-06-18 Oliver Kiddle + * 35510: Completion/Unix/Command/_git: use consistent + formatting for git subcommands + * 35504: Completion/Unix/Command/_git: complete % placeholders for git log --format diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 3e728865b..a44de405c 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5023,7 +5023,16 @@ __git_ignore_line_inside_arguments () { (( $+functions[_git_commands] )) || _git_commands () { - local -a main_porcelain_commands + local -a cmdtypes + cmdtypes=( main_porcelain_commands user_commands + third_party_commands ancillary_manipulator_commands + ancillary_interrogator_commands interaction_commands + plumbing_manipulator_commands plumbing_interrogator_commands + plumbing_sync_commands plumbing_sync_helper_commands + plumbing_internal_helper_commands + ) + local -a $cmdtypes + main_porcelain_commands=( add:'add file contents to index' am:'apply patches from a mailbox' @@ -5062,7 +5071,6 @@ _git_commands () { submodule:'initialize, update, or inspect submodules' tag:'create, list, delete or verify tag object signed with GPG') - local -a ancillary_manipulator_commands ancillary_manipulator_commands=( config:'get and set repository or global options' fast-export:'data exporter' @@ -5077,7 +5085,6 @@ _git_commands () { repack:'pack unpacked objects in a repository' replace:'create, list, delete refs to replace objects') - local -a ancillary_interrogator_commands ancillary_interrogator_commands=( blame:'show what revision and author last modified each line of a file' cherry:'find commits not merged upstream' @@ -5095,7 +5102,6 @@ _git_commands () { verify-tag:'check GPG signature of tags' whatchanged:'show commit-logs and differences they introduce') - local -a interaction_commands interaction_commands=( archimport:'import an Arch repository into git' cvsexportcommit:'export a single commit to a CVS checkout' @@ -5107,7 +5113,6 @@ _git_commands () { send-email:'send collection of patches as emails' svn:'bidirectional operation between a Subversion repository and git') - local -a plumbing_manipulator_commands plumbing_manipulator_commands=( apply:'apply patch to files and/or to index' checkout-index:'copy files from index to working directory' @@ -5127,7 +5132,6 @@ _git_commands () { update-ref:'update object name stored in a reference safely' write-tree:'create tree from the current index') - local -a plumbing_interrogator_commands plumbing_interrogator_commands=( cat-file:'provide content or type information for repository objects' diff-files:'compare files in working tree and index' @@ -5147,7 +5151,6 @@ _git_commands () { var:'show git logical variable' verify-pack:'validate packed git archive files') - local -a plumbing_sync_commands plumbing_sync_commands=( daemon:'run a really simple server for git repositories' fetch-pack:'receive missing objects from another repository' @@ -5155,7 +5158,6 @@ _git_commands () { send-pack:'push objects over git protocol to another repository' update-server-info:'update auxiliary information file to help dumb servers') - local -a plumbing_sync_helper_commands plumbing_sync_helper_commands=( http-fetch:'download from remote git repository via HTTP' http-push:'push objects over HTTP/DAV to another repository' @@ -5165,7 +5167,6 @@ _git_commands () { upload-archive:'send archive back to git-archive' upload-pack:'send objects packed back to git fetch-pack') - local -a plumbing_internal_helper_commands plumbing_internal_helper_commands=( check-attr:'display gitattributes information' check-ignore:'debug gitignore/exclude files' @@ -5178,91 +5179,40 @@ _git_commands () { patch-id:'compute unique ID for a patch' stripspace:'filter out empty lines') - local -a user_commands zstyle -a :completion:$curcontext: user-commands user_commands - local -a third_party_commands local command for command in $_git_third_party_commands; do (( $+commands[git-${command%%:*}] )) && third_party_commands+=$command done - local -a aliases unique_aliases + local -a aliases __git_extract_aliases - local alias - for alias in $aliases; do - local name=${alias%%:*} - (( main_porcelain_commands[(I)$name:*] || - user_commands[(I)$name:*] || - third_party_commands[(I)$name:*] || - ancillary_manipulator_commands[(I)$name:*] || - ancillary_interrogator_commands[(I)$name:*] || - interaction_commands[(I)$name:*] || - plumbing_manipulator_commands[(I)$name:*] || - plumbing_interrogator_commands[(I)$name:*] || - plumbing_sync_commands[(I)$name:*] || - plumbing_sync_helper_commands[(I)$name:*] || - plumbing_internal_helper_commands[(I)$name:*] )) || unique_aliases+=$alias + local cmdtype len dup sep + local -a allcmds allmatching alts disp + + zstyle -s ":completion:${curcontext}:" list-separator sep || sep=-- + for cmdtype in $cmdtypes aliases; do + if [[ $cmdtype = aliases ]]; then + for dup in ${${aliases%:*}:*allcmds}; do + aliases=( ${aliases:#$dup:*} ) + done + fi + local -a ${cmdtype}_m + set -A ${cmdtype}_m ${(P)cmdtype%%:*} + allcmds+=( ${(P)${:-${cmdtype}_m}} ) done - - integer ret=1 - - _tags \ - aliases \ - main-porcelain-commands \ - user-commands \ - third-party-commands \ - ancillary-manipulator-commands \ - ancillary-interrogator-commands \ - interaction-commands \ - plumbing-manipulator-commands \ - plumbing-interrogator-commands \ - plumbing-sync-commands \ - plumbing-sync-helper-commands \ - plumbing-internal-helper-commands - - while _tags; do - - _requested aliases && \ - _describe -t aliases 'alias' unique_aliases && ret=0 - - _requested main-porcelain-commands && \ - _describe -t main-porcelain-commands 'main porcelain command' main_porcelain_commands && ret=0 - - _requested user-commands && \ - _describe -t user-commands 'user command' user_commands && ret=0 - - _requested third-party-commands && \ - _describe -t third-party-commands 'third-party command' third_party_commands && ret=0 - - _requested ancillary-manipulator-commands && \ - _describe -t ancillary-manipulator-commands 'ancillary manipulator command' ancillary_manipulator_commands && ret=0 - - _requested ancillary-interrogator-commands && \ - _describe -t ancillary-interrogator-commands 'ancillary interrogator command' ancillary_interrogator_commands && ret=0 - - _requested interaction-commands && \ - _describe -t interaction-commands 'interaction command' interaction_commands && ret=0 - - _requested plumbing-manipulator-commands && \ - _describe -t plumbing-manipulator-commands 'plumbing manipulator command' plumbing_manipulator_commands && ret=0 - - _requested plumbing-interrogator-commands && \ - _describe -t plumbing-interrogator-commands 'plumbing interrogator command' plumbing_interrogator_commands && ret=0 - - _requested plumbing-sync-commands && \ - _describe -t plumbing-sync-commands 'plumbing sync command' plumbing_sync_commands && ret=0 - - _requested plumbing-sync-helper-commands && \ - _describe -t plumbing-sync-helper-commands 'plumbing sync helper command' plumbing_sync_helper_commands && ret=0 - - _requested plumbing-internal-helper-commands && \ - _describe -t plumbing-internal-helper-commands 'plumbing internal helper command' plumbing_internal_helper_commands && ret=0 - - (( ret )) || break + zstyle -T ":completion:${curcontext}:" verbose && disp=(-ld '${cmdtype}_d') + compadd -O allmatching -a allcmds + len=${#${(O)allmatching//?/.}[1]} # length of longest match + 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 }%% #} + alts+=( "${cmdtype//_/-}:${${cmdtype//_/ }%%(e|)s}:compadd ${(e)disp} -a ${cmdtype}_m" ) done - return ret + _alternative $alts } (( $+functions[__git_aliases] )) || -- cgit v1.2.3 From dd7852089705e8228228f9e2fb69437b43ddb7e6 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 19 Jun 2015 20:00:51 +0200 Subject: 35531: fallback on file completion --- ChangeLog | 2 ++ Completion/Unix/Command/_adb | 26 +++++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 16daaab8e..45011327f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2015-06-19 Oliver Kiddle + * 35531: Completion/Unix/Command/_adb: fallback on file completion + * 35527: Completion/Unix/Type/_email_addresses, Completion/Zsh/Command/_fc, Completion/Zsh/Command/_zpty: use list-separator style in cases where separator was hardcoded diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb index e687762d3..88aca2464 100644 --- a/Completion/Unix/Command/_adb +++ b/Completion/Unix/Command/_adb @@ -76,7 +76,8 @@ _adb() { '(-d -e )-s[serial]: :_adb_device_serial' \ '( -e -s)-d[device]' \ '(-d -s)-e[emulator]' \ - '*:"options":_adb_options_handler' + '1:"options":_adb_options_handler' \ + '*: : _default' return; } @@ -99,27 +100,30 @@ _adb_dispatch_command () { fi case ${curcontext} in - (*:adb:shell) + (*:adb-shell) (( $+functions[_adb_dispatch_shell] )) && _adb_dispatch_shell ;; - (*:adb:connect|*:adb:disconnect) + (*:adb-connect|*:adb-disconnect) (( $+functions[_adb_dispatch_connection_handling] )) && _adb_dispatch_connection_handling ;; - (*:adb:logcat) + (*:adb-logcat) (( $+functions[_adb_dispatch_logcat] )) && _adb_dispatch_logcat ;; - (*:adb:push) + (*:adb-push) (( $+functions[_adb_dispatch_push] )) && _adb_dispatch_push ;; - (*:adb:pull) + (*:adb-pull) (( $+functions[_adb_dispatch_pull] )) && _adb_dispatch_pull ;; - (*:adb:install) + (*:adb-install) (( $+functions[_adb_dispatch_install] )) && _adb_dispatch_install ;; - (*:adb:uninstall) + (*:adb-uninstall) (( $+functions[_adb_dispatch_uninstall] )) && _adb_dispatch_uninstall ;; + (*:adb-*) + _default + ;; (*) _arguments \ '(-d -e)-s["serial"]: :_adb_device_serial' \ @@ -143,7 +147,7 @@ _adb_sanitize_context () { done ##expand unquoted to remove sparse elements mywords=( ${mywords[@]} ) - curcontext="${curcontext}${mywords[-1]}" + (( $#mywords )) && curcontext="${curcontext%:*}-${mywords[-1]}:" } (( $+functions[_adb_device_specification] )) || @@ -373,9 +377,9 @@ _adb_dispatch_connection_handling () { fi } -(( $+functions[adb_check_log_redirect] )) || +(( $+functions[_adb_check_log_redirect] )) || _adb_check_log_redirect () { - LOG_REDIRECT=${$(adb ${=ADB_DEVICE_SPECIFICATION} shell getprop log.redirect-stdio)// + LOG_REDIRECT=${$(adb ${=ADB_DEVICE_SPECIFICATION} shell getprop log.redirect-stdio 2>/dev/null)// /} [[ ${LOG_REDIRECT[1,4]} == "true" ]] && _message -r "Notice: stdio log redirection enabled on the device, so some completions will not work" } -- cgit v1.2.3 From bf098bc29e1bfe8082a3d2e02ea56924e2f6ea80 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 23 Jun 2015 03:24:49 +0200 Subject: 35529: fix filename completion after java -jar --- ChangeLog | 5 ++++ Completion/Unix/Command/_java | 66 +++++++++++++++++++++++++++++++------------ 2 files changed, 53 insertions(+), 18 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index c92a911ab..ee3756a9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-06-23 Oliver Kiddle + + * 35529: Completion/Unix/Command/_java: fix filename completion + after java -jar + 2015-06-22 Peter Stephenson * 35566: Src/Modules/regex.c: didn't handle faile diff --git a/Completion/Unix/Command/_java b/Completion/Unix/Command/_java index 7b1dce18f..2aef15a25 100644 --- a/Completion/Unix/Command/_java +++ b/Completion/Unix/Command/_java @@ -7,45 +7,76 @@ typeset -A opt_args tmpassoc jdb_args=() case "$service" in +javac|jar) + if compset -P @; then + _wanted files expl 'option file' _files + return + fi + ;| # continue javac) _arguments -C \ '-g-[generate debugging information]:debug:->debug' \ + '-A-[specify option to annotation processors]:option' \ + '-implicit\:-[control generation of class files for implicitly loaded sources]:implicit:(class none)' \ '-nowarn[generate no warnings]' \ '-verbose[output messages about what the compiler is doing]' \ '-deprecation[output source locations where deprecated APIs are used]' \ - '-classpath[specify where to find user class files]:class path:->classpath' \ + '(-cp -classpath)'{-cp,-classpath}'[specify where to find user class files]:class path:->classpath' \ '-sourcepath[specify where to find input source files]:source path:->sourcepath' \ '-bootclasspath[override location of bootstrap class files]:bootstrap class path:->bootstrapclasspath' \ '-extdirs[override location of installed extensions]:extensions directories:->extdirs' \ '-d[specify where to place generated class files]:directory:_files -/' \ '-encoding[specify character encoding used by source files]:encoding:->encoding' \ - '-source[provide source compatibility with specified release]:release:(1.{2..5})' \ + '-proc\:-[control annotation processing]:annotation processing:(none only)' \ + '-processor[specify annotation processors to run]:class:_files' \ + '-processorpath[specify where to find annotation processors]:directory:_directories' \ + '-s[specify directory for generated source files]:directory:_directories' \ + '-source[provide source compatibility with specified release]:release:(1.{2..8} {5..8})' \ '-target[specify VM version]:release:(1.{1..5})' \ - '-help[print a synopsis of standard options]' \ + '(-)-help[print a synopsis of standard options]' \ + '(-)-version[print version information]' \ + '(-)-X[display information about non-standard options]' \ '*:java source file:_files -g \*.java\(-.\)' && return 0 ;; jdb) jdb_args=( '-host[specify host to connect to]:host:_hosts' - '-password[specify password]:password:' + '-password[specify password]:password' + '-attach[attach to running VM]:address' + '-listen[wait for VM to connect]:address' + '-listenany[wait for VM to connect at any available address]' + '-launch[launch VM immediately]' + '-listconnectors[list the connectors available in this VM]' + '-connect[connect to target VM]:connector' + -dbgtrace -tclient -tserver + '-J-[java runtime option]:option' ) ;& java) _arguments -C \ "$jdb_args[@]" \ + -client -server -d32 -d64 \ + '-agentlib\:-:agent library' \ + '-agentpath\:-:path:_directories' \ + '-javaagent\:-:path:_directories' \ '(-cp -classpath)'{-cp,-classpath}'[specify path for user class files]:class path:->classpath' \ '-D-[specify a property]:property:->property' \ + \*{-enableassertions,-ea}-::class \ + \*{-disableassertions,-da}-::class \ + '(-enablesystemassertions,-esa,-disablesystemassertions,-dsa)'{-enablesystemassertions,-esa,-disablesystemassertions,-dsa} \ '(-verbose:class)-verbose[print class information]' \ '(-verbose)-verbose\:class[print class information]' \ '-verbose\:gc[print gc information]' \ '-verbose\:jni[print JNI information]' \ - '-version[print version]' \ - '-help[print help message]' \ - '(- 1)-jar[specify a program capsulated as jar]:jar:_files -g \*.jar\(-.\)' \ + '(- 1)-version[print version]' \ + '-showversion[print version and contrinue]' \ + '(- 1)-'{\?,help}'[print help message]' \ + '(- 1)-X-[non-standard java option]:option' \ + '(- 1)-jar[specify a program encapsulated as jar]:jar:_files -g \*.jar\(-.\)' \ '(-):class:_java_class -m main ${(kv)opt_args[(i)(-classpath|-cp)]}' \ - '*::args: _normal' \ + '*::args:= _normal' \ && return 0 ;; @@ -111,16 +142,20 @@ jar) '(c t x )u[update archive]' \ 'f[specify archive file]' \ 'v[verbose mode]' \ - 'm[specify manifest file]' \ + '(e)m[specify manifest file]' \ + '(m)e[specify class of for application entry point]' \ '0[store only without using ZIP compression]' \ - 'M[do not create manifest file]' && return + 'M[do not create manifest file]' \ + 'i[generate index information for specified jar files]' && return else jar_cmd="${words[2]#-}" tmpassoc=( m ':manifest file:_files' + e ':main class' f ':archive file:_files -g "*.([ejw]ar|zip)(-.)"' ) - _arguments -C \ + _arguments '*-C[directory of class file]:directory:_directories' \ + '-J-[java runtime option]:option' \ "${jar_cmd/[^-]*/:dummy:}" \ ${${(s::)jar_cmd}/(#b)(?)/$tmpassoc[$match[1]]} \ '*:file:->jararg' && return 0 @@ -140,6 +175,7 @@ javah|javah_g) '-bootclasspath[specify path for bootstrap class files]:bootstrap class path:->bootstrapclasspath' \ '-old[generate old JDK1.0-style header files]' \ '-force[force output]' \ + '-J-[java runtime option]:option' \ '*:class:_java_class -m main ${(kv)opt_args[(i)-classpath]}' && return 0 ;; @@ -558,20 +594,14 @@ docsrc) ;; jararg) - if [[ -prefix - ]]; then - tmp=('-C:chdir') - _describe -o 'option' tmp -- && return - elif [[ "$words[CURRENT - 2]" == -C ]]; then + if [[ "$words[CURRENT - 2]" == -C ]]; then _wanted file expl 'input file' _files -W "($words[CURRENT - 1])" && return - elif [[ "$words[CURRENT - 1]" == -C ]]; then - _wanted directories expl 'chdir to' _files -/ && return elif [[ $words[2] = *x* ]]; then jf="$words[3]" if [[ $jf != $_jar_cache_name && -f $jf ]]; then _jar_cache_list=("${(@f)$($words[1] tf $jf)}") _jar_cache_name=$jf fi - _wanted files expl 'file from archive' _multi_parts / _jar_cache_list && return else _wanted files expl 'input file' _files && return -- cgit v1.2.3 From 96fa41a7c8114d9a5bddec29fdbd0997a74ee745 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 2 Jul 2015 16:25:59 +0100 Subject: 35663: zpool completion fix needed after completion change --- ChangeLog | 3 +++ Completion/Unix/Command/_zpool | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index b326336ab..99b779252 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-07-02 Peter Stephenson + * Eric Cook: 35663: Completion/Unix/Command/_zpool: fix for + changed interface. + * 35668: Src/input.c, Src/lex.c, Src/zsh.h, Test/D03procsubst.ztst: replacement for 35667: use input flag to stop unwanted backtracking, diff --git a/Completion/Unix/Command/_zpool b/Completion/Unix/Command/_zpool index 03ebd0642..f2116dc2e 100644 --- a/Completion/Unix/Command/_zpool +++ b/Completion/Unix/Command/_zpool @@ -86,7 +86,7 @@ _zpool() { ) if [[ $service == "zpool" ]]; then - _arguments -C -A "-*" \ + _arguments -C \ '-\?[show help information]' \ '1:subcommand:compadd -a subcmds' \ '*:: :->subcmd' && return -- cgit v1.2.3 From 396f68971fef574160e780c01d12a58747f5d224 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 7 Jul 2015 22:59:00 +0200 Subject: 35718: new calendar style date completion --- ChangeLog | 5 ++ Completion/Unix/Command/_find | 21 +++++-- Completion/Unix/Type/_dates | 123 +++++++++++++++++++++++++++++++++++++++++ Completion/Zsh/Type/_globquals | 11 ++-- 4 files changed, 150 insertions(+), 10 deletions(-) create mode 100644 Completion/Unix/Type/_dates (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 1f4e3f999..0c60eedf9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-07-06 Oliver Kiddle + + * 35718: Completion/Unix/Command/_find, Completion/Unix/Type/_dates, + Completion/Zsh/Type/_globquals: new calendar style date completion + 2015-07-07 Peter Stephenson * unposted: Src/Zle/complete.c: remove compiler warning. diff --git a/Completion/Unix/Command/_find b/Completion/Unix/Command/_find index 8f80e36cf..aefca34f2 100644 --- a/Completion/Unix/Command/_find +++ b/Completion/Unix/Command/_find @@ -1,6 +1,7 @@ #compdef find gfind -local variant args +local curcontext="$curcontext" state_descr variant +local -a state line args alts _pick_variant -r variant gnu=GNU $OSTYPE -version @@ -114,11 +115,11 @@ case $variant in ;; esac -_arguments $args \ +_arguments -C $args \ '(-L -P)-H[only follow symlinks when resolving command-line arguments]' \ '(-H -P)-L[follow symlinks]' \ - '*-atime:access time (days)' \ - '*-ctime:inode change time (days)' \ + '*-atime:access time (days):->times' \ + '*-ctime:inode change time (days):->times' \ '*-depth' \ '*-exec:program: _command_names -e:*\;::program arguments: _normal' \ '*-follow' \ @@ -128,7 +129,7 @@ _arguments $args \ '*-links:number of links:' \ '*-ls' \ '*-mount' \ - '*-mtime:modification time (days)' \ + '*-mtime:modification time (days):->times' \ '*-name:name pattern' \ '*-newer:file to compare (modification time):_files' \ '*-nogroup' \ @@ -143,3 +144,13 @@ _arguments $args \ '*-xdev' \ '*-a' '*-o' \ '*:directory:_files -/' + +if [[ $state = times ]]; then + if ! compset -P '[+-]' || [[ -prefix '[0-9]' ]]; then + disp=( 'before' 'exactly' 'since' ) + compstate[list]+=' packed' + alts=( "senses:sense:compadd -V times -S '' -d disp - + '' -" ) + fi + alts+=( "times:${state_descr}:_dates -f d" ) + _alternative $alts +fi diff --git a/Completion/Unix/Type/_dates b/Completion/Unix/Type/_dates new file mode 100644 index 000000000..486a2c229 --- /dev/null +++ b/Completion/Unix/Type/_dates @@ -0,0 +1,123 @@ +#autoload + +# Options: +# -f format : specify strftime format for matches +# -f s/m/h/d/w/M : specify relative format +# -F : select a future rather than past date + +# Styles: +# max-matches-length : maximum number or percentage of lines to use for +# completion listing, if both are specified, the +# lowest takes precedence. +# format : override date format + +local -a disp cand expl +local userformat format spacer=1 spacing month monstart skip match +local d day daysecs extra preclude r ri col explain +local -a starts skips +local -i start now mult +local -i columns=$(( (COLUMNS+4) / 32 )) rows=LINES-4 offset=0 +local -a days=( Mo Tu We Th Fr Sa Su ) +local future mlabel mfmt mlabels + +zparseopts -D -K -E f:=format F=future X:=explain +(( future = $#future ? 1 : -1 )) +zstyle -s ':completion:$curcontext:dates' date-format userformat +format=${userformat:-${format[2]:-%F}} + +zstyle -a ':completion:$curcontext:dates' max-matches-length r +for ri in $r; do + [[ $ri = [0-9]##% ]] && (( ri = LINES * .${ri%%%} )) + (( ri < rows )) && (( rows=ri )) +done +(( rows = rows / 8 )) +zmodload -i zsh/datetime || rows=0 + +_message -e dates ${explain[2]:-date} +(( rows )) || return +_description -2V -x dates expl date +compstate[list]='packed rows' + +if [[ $WIDGET = _next_tags ]]; then + typeset -g -i _next_tags_line + typeset -g -i _next_tags_date=$(( HISTNO == _next_tags_line ? _next_tags_date+1 : 1)) + _next_tags_line=HISTNO + (( offset = _next_tags_date*rows*columns )) +fi + +(( now=EPOCHSECONDS )) +strftime -s year '%Y' $now +strftime -s month '%m' $now +(( offset = future*offset + year*12 + month + ((future == 1) ? rows*columns-2 : -1) )) +for ((;rows;rows--)); do + disp=() mlabels="" + for ((col=1;col<=columns;col++)); do + (( start = offset + col - rows * columns )) + strftime -r -s monstart '%Y%m' $(( start/12 ))$(( 1 + start % 12 )) + strftime -s skip '%w' $(( monstart-86400 )) + starts[col]=$monstart + skips[col]=$skip + disp+=( $days ' ' ) + + mfmt='%B' + strftime -s mlabel '%m' $monstart + [[ $mlabel = 01 ]] && mfmt+=' %Y' + strftime -s mlabel "$mfmt" $monstart + + mlabels+="${(r.(col == columns) ? 28 : 32.):-${(l.(26-$#mlabel)/2.)}$mlabel}" + done + (( spacing = COLUMNS - 32 * columns + 2 )) + disp[-1]="${(l.spacing.)}" + (( spacing < 2 )) && spacer=0 disp[-1]=() + expl[1+expl[(i)-V]]=dates-$rows + compadd -x "$mlabels" "$expl[@]" -d disp -E $(( $#disp )) + + for ((line=0;line<6;line++)); do + for ((col=1;col<=columns;col++)); do + if (( skips[col] && !line )); then + disp=(); disp[skips[col]]='' + compadd -x "$mlabels" "$expl[@]" -d disp -E $skips[col] + (( skip=skips[col] )) + else + skip=0 + fi + disp=() cand=() + (( extra = (col == columns) ? spacer : 1 )) + (( preclude = 0 )) + for ((d=1;d<=7-skip;d++)); do + (( day = d+7*line+skip-skips[col] )) + (( daysecs = starts[col] + 86400 * (day - 1) )) + strftime -s realday '%d' $daysecs + if (( realday != day )); then + (( extra+=8-d )) + break + fi + (( mult = -future * (now - daysecs) + (future == 1 ? 86400 : 0) )) + case $format in + s) (( match = mult )) ;; + m) (( match = mult / 60 )) ;; + h) (( match = mult / 3600 )) ;; + d) (( match = mult / 86400 )) ;; + w) (( match = mult / 604800 )) ;; + M) (( match = mult / 2592000 )) ;; + *) strftime -s match - $format $daysecs ;; + esac + disp+=( "${(l.2.)day}" ) + if (( future < 0 && now < daysecs )); then + (( extra++ )) + elif (( future > 0 && (now - daysecs) > 86400 )); then + (( preclude++ )) + else + (( (now - daysecs) < 86400 && (now - daysecs) > 0 )) && + compstate[insert]=menu:$(( compstate[nmatches] + $#disp )) + cand+=( "$match" ) + fi + done + if (( preclude )); then + compadd -x "$mlabels" "$expl[@]" -E $preclude -d disp + shift preclude disp + fi + compadd -x "$mlabels" -U -i "$IPREFIX" -I "$ISUFFIX" "$expl[@]" "$@" -d disp -E $extra -a cand + done + done +done diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals index 042b27400..5cdb8f7c4 100644 --- a/Completion/Zsh/Type/_globquals +++ b/Completion/Zsh/Type/_globquals @@ -1,7 +1,7 @@ #autoload local state=qual expl char delim timespec -local -a alts +local -a alts tdisp sdisp local -A specmap while [[ -n $PREFIX ]]; do @@ -117,14 +117,15 @@ while [[ -n $PREFIX ]]; do alts=() timespec=$PREFIX[1] if ! compset -P '[Mwhmsd]' && [[ -z $PREFIX ]]; then - alts+=("time-specifiers:time specifier:\ -((M\:months w\:weeks h\:hours m:\minutes s\:seconds d\:days))") + tdisp=( seconds minutes hours days weeks Months ) + alts+=( "time-specifiers:time specifier:compadd -E 0 -d tdisp -S '' - s m h d w M" ) fi if ! compset -P '[-+]' && [[ -z $PREFIX ]]; then - alts+=("senses:sense:((-\:less\ than +\:more\ than))") + sdisp=( before exactly since ) + alts+=("senses:sense:compadd -E 0 -d sdisp -S '' - + '' -") fi specmap=( M months w weeks h hours m minutes s seconds '(|+|-|d)' days) - alts+=('digits:digit ('${${specmap[(K)$timespec]}:-invalid time specifier}'):' ) + alts+=('digits:digit ('${${specmap[(K)$timespec]}:-invalid time specifier}'):_dates -f ${${timespec/[-+]/d}:-d} -S ""' ) _alternative $alts return fi -- cgit v1.2.3 From 8024de798d1b3eb0eca5772bf5c316124748e74c Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 12 Jul 2015 18:14:03 +0200 Subject: 35779: completion: _git-config: remove extraneous "local expl" It is defined at the beginning of the function already, and results in the output of `expl=''` when completing after `git config branch.local.pushremote ` etc. --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 71f4755ea..354418d05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-07-13 Daniel Hahler + + * 35779: Completion/Unix/Command/_git: _git-config: remove + extraneous "local expl". + 2015-07-12 Daniel Shahaf * unposted: Test/B01cd.ztst: Typo diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index a44de405c..26f108fbd 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -2923,7 +2923,6 @@ _git-config () { (*) # TODO: Do we need to set up a _requested/_next_label? declare -a action - local expl _description values expl "$parts[2]" eval "action=($parts[4])" "$action[1]" "$expl[@]" "${(@)action[2,-1]}" && ret=0 -- cgit v1.2.3 From 7351fea0f914198e39cbf0f7fc98a4823a77b9fc Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 23 Jul 2015 07:02:40 +0200 Subject: 35866: complete also for pigz and allow for NetBSD gzip --- ChangeLog | 4 +++ Completion/Unix/Command/_gzip | 63 ++++++++++++++++++++++++------------------- Completion/Unix/Command/_zcat | 2 +- 3 files changed, 41 insertions(+), 28 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index ea9ebec5d..2aa3fb98b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-07-23 Oliver Kiddle + * 35866: Completion/Unix/Command/_gzip: complete also for pigz + + * 35866: Completion/Unix/Command/_zcat: allow for NetBSD gzip + * 35824: Doc/Zsh/zle.yo, Src/Zle/iwidgets.list, Src/Zle/zle.h, Src/Zle/zle_misc.c, Src/Zle/zle_refresh.c: allow highlighting of just pasted text, put text from bracketed paste in cut buffers diff --git a/Completion/Unix/Command/_gzip b/Completion/Unix/Command/_gzip index 927d31d45..f9fd17819 100644 --- a/Completion/Unix/Command/_gzip +++ b/Completion/Unix/Command/_gzip @@ -1,37 +1,57 @@ -#compdef gzip gunzip gzcat=gunzip -redirect-,<,gunzip=gunzip -redirect-,>,gzip=gunzip -redirect-,<,gzip=gzip -value-,GZIP,-default- +#compdef gzip gunzip gzcat=gunzip pigz unpigz -redirect-,<,gunzip=gunzip -redirect-,>,gzip=gunzip -redirect-,<,gzip=gzip -value-,GZIP,-default- local decompress files expl curcontext="$curcontext" state line ret=1 +local -a pigz typeset -A opt_args +local excl="--decompress --uncompress -1 -2 -3 -4 -5 -6 -7 -8 -9 -11 --best" files=( '*:files:->files' ) case "$service" in +unpigz|pigz) + pigz=( + '(-K --zip)'{-K,--zip}'[compress to PKWare zip format]' + '(-b --blocksize)'{-b+,--blocksize}'[set compression block size]:size (KiB)' + '(-p --processes)'{-p,--processes}'[specify number of processes to use]' + '(-z --zlib)'{-z,--zlib}'[compress to zlib (.zz) format]' + '(-T --no-time)'{-T,--no-time}"[don't store/restore modification time in/from header]" + ) +;| +pigz) + pigz+=( + '(-i --independent)'{-i,--independent}'[compress blocks independently to allow for damage recovery]' + "($excl)-11" + '(--rsyncable)-R[make rsync-friendly archive]' + "($excl)"{-F,--first}'[do iterations first, before block split]' + "($excl)"{-I+,--iterations}'[specify number of iterations for optimization]:iterations [15]' + "($excl)"{-M+,--maxsplits}'[specify maximum number of split blocks]:split blocks [15]' + "($excl)"{-O,--oneblock}"[don't split into smaller blocks]" + ) +;| *GZIP*) compset -q words=( fake "$words[@]" ) (( CURRENT++ )) files=() ;& -gunzip|zcat) +gunzip|zcat|unpigz) decompress=yes ;& -gzip) +gzip|pigz) _arguments -C -s -S \ '(--to-stdout --stdout)-c[write on standard output]' \ '(-c --stdout)--to-stdout[write on standard output]' \ '(-c --to-stdout)--stdout[write on standard output]' \ - '(--decompress --uncompress)-d[decompress]' \ - '(-d --uncompress)--decompress[decompress]' \ - '(-d --decompress)--uncompress[decompress]' \ + "($excl)"{-d,--decompress,--uncompress}'[decompress]' \ '(--force)-f[force overwrite]' \ '(-f)--force[force overwrite]' \ - '(--help)-h[display help message]' \ - '(-h)--help[display help message]' \ + '(- *)'{-h,--help}'[display help message]' \ + "(--keep)-k[don't delete input files]" \ + "(-k)--keep[don't delete input files]" \ '(--list)-l[list compressed file contents]' \ '(-l)--list[list compressed file contents]' \ - '(--license)-L[display software license]' \ - '(-L)--license[display software license]' \ - '(--no-name)-n[do not save or restore the original name and time stamp]' \ - '(-n)--no-name[do not save or restore the original name and time stamp]' \ + '(- *)'{-L,--license}'[display software license]' \ + "(--no-name)-n[don't save or restore the original name and time stamp]" \ + "(-n)--no-name[don't save or restore the original name and time stamp]" \ '(--name)-N[save or restore the original name and time stamp]' \ '(-N)--name[save or restore the original name and time stamp]' \ '(--quiet --silent)-q[suppress all warnings]' \ @@ -39,27 +59,16 @@ gzip) '(-q --quiet)--silent[suppress all warnings]' \ '(--recursive)-r[operate recursively on directories]' \ '(-r)--recursive[operate recursively on directories]' \ - '--rsyncable[make rsync-friendly archive]' \ + '(-R)--rsyncable[make rsync-friendly archive]' \ '(--suffix)-S+[specify suffix for compressed files]:suffix:' \ '(-S)--suffix=[specify suffix for compressed files]:suffix:' \ '(--test)-t[test compressed file integrity]' \ '(-t)--test[test compressed file integrity]' \ '(--verbose)-v[verbose mode]' \ '(-v)--verbose[verbose mode]' \ - '(--version)-V[display version number]' \ - '(-V)--version[display version number]' \ - '( -1 -2 -3 -4 -5 -6 -7 -8 -9 --best)--fast' \ - '(--fast -2 -3 -4 -5 -6 -7 -8 -9 --best)-1' \ - '(--fast -1 -3 -4 -5 -6 -7 -8 -9 --best)-2' \ - '(--fast -1 -2 -4 -5 -6 -7 -8 -9 --best)-3' \ - '(--fast -1 -2 -3 -5 -6 -7 -8 -9 --best)-4' \ - '(--fast -1 -2 -3 -4 -6 -7 -8 -9 --best)-5' \ - '(--fast -1 -2 -3 -4 -5 -7 -8 -9 --best)-6' \ - '(--fast -1 -2 -3 -4 -5 -6 -8 -9 --best)-7' \ - '(--fast -1 -2 -3 -4 -5 -6 -7 -9 --best)-8' \ - '(--fast -1 -2 -3 -4 -5 -6 -7 -8 --best)-9' \ - '(--fast -1 -2 -3 -4 -5 -6 -7 -8 -9 )--best' \ - "$files[@]" && ret=0 + '(- *)'{-V,--version}'[display version number]' \ + "($excl)"-{-fast,1,2,3,4,5,6,7,8,9,-best} \ + "$pigz[@]" "$files[@]" && ret=0 ;; esac diff --git a/Completion/Unix/Command/_zcat b/Completion/Unix/Command/_zcat index 6dd4ecd7b..cf927507b 100644 --- a/Completion/Unix/Command/_zcat +++ b/Completion/Unix/Command/_zcat @@ -1,6 +1,6 @@ #compdef zcat -if _pick_variant gnu=GNU unix --license; then +if _pick_variant gz='(GNU|NetBSD)' unix --license; then _gzip "$@" else _compress "$@" -- cgit v1.2.3 From c55fe219990e948a9f5bf09f9ffc462a9da086ea Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 23 Jul 2015 07:12:01 +0200 Subject: 35867: new patchutils (interdiff etc) completion --- ChangeLog | 2 + Completion/Unix/Command/_patchutils | 106 ++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 Completion/Unix/Command/_patchutils (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 2aa3fb98b..0bfdc789a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2015-07-23 Oliver Kiddle + * 35867: Completion/Unix/Command/_patchutils: new completion + * 35866: Completion/Unix/Command/_gzip: complete also for pigz * 35866: Completion/Unix/Command/_zcat: allow for NetBSD gzip diff --git a/Completion/Unix/Command/_patchutils b/Completion/Unix/Command/_patchutils new file mode 100644 index 000000000..323c0a730 --- /dev/null +++ b/Completion/Unix/Command/_patchutils @@ -0,0 +1,106 @@ +#compdef combinediff interdiff filterdiff flipdiff grepdiff lsdiff splitdiff unwrapdiff + +local args +args=( + '(-)--help[display help information]' + '(-)--version[display version information]' +) + +case $service in + (inter|combine|filter|flip|ls|grep)diff) + args+=( + '(-p --strip-match=)'{-p,--strip-match=}'[specify number of path prefix components to strip]:number of path prefix components to strip' + '(-z --decompress)'{-z,--decompress}'[decompress .gz and .bz2 files]' + ) + ;| + interdiff|combinediff|flipdiff) + args+=( + '(-q --quiet)'{-q,--quiet}'[quieter output]' + '(-U --unified)'{-U,--unified=}'[specify lines of context to include]:lines of context' + \*{-d,--drop-context=}"[don't include context on files matching pattern]:pattern:_files" + '(-w --ignore-all-space)'{-w,--ignore-all-space}'[ignore all whitespace changes in patches]' + '(-B --ignore-blank-lines)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]' + '(-i --ignore-case)'{-i,--ignore-case}'[ignore case differences]' + '(-b --ignore-space-change)'{-b,--ignore-space-change}'[ignore changes in the amount of whitespace]' + '!(--in-place)--interpolate' '!-h' + '!(--no-revert-omitted --in-place)--combinediff' + '!(--no-revert-omitted)--flip' + '1:diff 1:_files' '2:diff 2:_files' + ) + ;| + interdiff) + args+=( + "--no-revert-omitted[don't revert files changed in only the first patch]" + ) + ;; + flipdiff) args+=( '--in-place[write output to original input files]' ) ;; + filterdiff|grepdiff|lsdiff) + args+=( + '(-i --include)'{-i,--include}'[include only files matching pattern]:pattern:_files' + '(-x --exclude)'{-x,--exclude}'[exclude files matching pattern]:pattern:_files' + '(-# --hunks)'{-#+,--hunks=}'[only list hunks within specified range]:range' + '--lines=[only list hunks containing lines within specified range]:range' + '(-F --files)'{-F+,--files=}'[only list files within specified range]:range' + '--strip=[remove specified number of pathname components before displaying]:components' + '--addprefix=[insert specified path prefix before displaying path names]:prefix:_directories' + ) + ;| + grepdiff|lsdiff) + args+=( + '(-n --line-number)'{-n,--line-number}'[show line number at which each patch begins]' + '(-N --number-files)'{-N,--number-files}'[show file number before each filename]' + '(-s --status)'{-s,--status}'[mark added, modified and removed files]' + ) + ;| + lsdiff) + args+=( + '(-E --empty-files-as-removed)'{-E,--empty-files-as-removed}'[treat empty files as absent]' + \*{-v,--verbose}'[verbose operation]' + '(-H --with-filename -h --no-filename)'{-H,--with-filename}'[print the name of the patch file containing each patch]' + '!--filter' '!--grep' + '*:diff file:_files' + ) + ;; + grepdiff|filterdiff) + args+=( + '(-I --include-from-file)'{-I+,--include-from-file=}'[include only files matching pattern listed in specified file]:file:_files' + '--annotate[annotate each hunk with the filename and hunk number]' + '--format=[use specified output format]:format:(unified context)' + '--addnewprefix=[insert specified path prefix before new file path names]:prefix:_directories' + '--addoldprefix=[insert specified path prefix before original file path names]:prefix:_directories' + '--as-numbered-lines=[display lines of selected hunks]:line numbers:(before after)' + "--remove-timestamps[don't include timestamps in output]" + ) + ;; + filterdiff) + args+=( + '(-X --exclude-from-file)'{-X+,--exclude-from-file=}'[exclude files matching any pattern listed in specified file]:file:_files' + '(-v --verbose --clean)'{-v,--verbose}'[always show non-diff lines in output]' + '(-v --verbose)--clean[always remove all non-diff lines from output]' + ) + ;; + grepdiff) + args+=( + '(-E --extended-regexp)'{-E,--extended-regexp}'[use extended regular expressions]' + '(-H --with-filename -h --no-filename)'{-h,--no-filename}"[don't print the name of the patch file containing each patch]" + '(-f --file)'{-f+,--file=}'[read regular expressions from file]:file:_files' + '--output-matching=[display the matching hunk- or file-level diffs]:level:(hunk file)' + ) + ;; + splitdiff) + args+=( + '-a[split every single file level patch]' + '-d[create file names such as a_b.c.patch for a patch that modifies a/b.c]' + '-D[write output files into specified directory]:_directories' + '-p[specify number of path prefix components to strip]:number of path prefix components to strip' + "-E[don't use .patch filename extension when writing output files]" + '1:diff file:_files' + ) + ;; + unwrapdiff) + args+=( '-v[verbose operation]' '*:diff file:_files' ) + ;; +esac + +_arguments -s $args + -- cgit v1.2.3 From d470453d76a3ff0c4816752630bf70733cfbc8b5 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 24 Jul 2015 16:43:14 +0000 Subject: 35274: completion: Add FreeBSD's watch(1) Review-by: Oliver Kiddle --- ChangeLog | 6 ++++++ Completion/BSD/Command/_watch-snoop | 13 +++++++++++++ Completion/Unix/Command/_watch | 9 +++++++++ 3 files changed, 28 insertions(+) create mode 100644 Completion/BSD/Command/_watch-snoop create mode 100644 Completion/Unix/Command/_watch (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index dddfb2b31..5fbd907b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-07-26 Daniel Shahaf + + * 35274 (plus tweaks): Completion/BSD/Command/_watch-snoop + Completion/Unix/Command/_watch: completion: Add FreeBSD's + watch(1) + 2015-07-26 Oliver Kiddle * 35901: Completion/X/Type/_x_font: complete full names as removing diff --git a/Completion/BSD/Command/_watch-snoop b/Completion/BSD/Command/_watch-snoop new file mode 100644 index 000000000..182b6bb34 --- /dev/null +++ b/Completion/BSD/Command/_watch-snoop @@ -0,0 +1,13 @@ +#autoload + +# watch [-cinotW] [-f snpdev] [tty] + +_arguments -w -S -s : \ + "-c[reconnect on close]" \ + "-f:snp(4) device: " \ + "-i[force interactive mode even when stdout is not a tty]" \ + "-n[disable the ability to switch the watched tty interactively]" \ + "-o[reconnect on overflow]" \ + "-t[print date and time at start]" \ + "-W[allow write access to observed tty]" \ + ":tty device:_ttys -D" diff --git a/Completion/Unix/Command/_watch b/Completion/Unix/Command/_watch new file mode 100644 index 000000000..a8d29403f --- /dev/null +++ b/Completion/Unix/Command/_watch @@ -0,0 +1,9 @@ +#compdef watch + +# watch(1) has completely different semantics on freebsd compared to linux, hence: +case $OSTYPE in + (freebsd*|dragonfly*) _watch-snoop "$@";; + (*) _default;; +esac + +# NOTREACHED -- cgit v1.2.3 From 77a8cd73903b06e67b1f427b042a0a90b0191b84 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Fri, 31 Jul 2015 11:18:23 +0200 Subject: 35960 (tweaked): complete correct options for OpenBSD's find --- ChangeLog | 5 +++++ Completion/Unix/Command/_find | 22 +++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 208280570..fa46e98ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-07-31 Oliver Kiddle + + * Matthew Martin: 35960 (tweaked): Completion/Unix/Command/_find: + complete correct options for OpenBSD's find + 2015-07-29 Barton E. Schaefer * 35953: Src/lex.c, Test/A01grammar.ztst: fix handling of command diff --git a/Completion/Unix/Command/_find b/Completion/Unix/Command/_find index aefca34f2..e736f32cb 100644 --- a/Completion/Unix/Command/_find +++ b/Completion/Unix/Command/_find @@ -27,12 +27,12 @@ case $variant in '*-print0' ) ;| + solaris*|freebsd*|dragonfly*|darwin*|gnu) + args+=( '*-mount' ) + ;| netbsd*|freebsd*|dragonfly*|darwin*|gnu) args+=( '(-H -L)-P[never follow symlinks]' ) ;| - netbsd*|freebsd*|dragonfly*|openbsd*|darwin*|gnu) - args+=( '-d[depth first traversal]' ) - ;| darwin*|freebsd*|gnu) args+=( '*-Bmin:birth time (minutes)' @@ -40,11 +40,13 @@ case $variant in '*-Btime:birth time (hours)' ) ;| - freebsd*|dragonfly*|darwin*|openbsd*|gnu) + netbsd*|freebsd*|dragonfly*|openbsd*|darwin*|gnu) args+=( + '-d[depth first traversal]' '*-anewer:file to compare (access time):_files' '*-cnewer:file to compare (inode change time):_files' - '*-mnewer:file to compare (modification time):_files' + '*-empty' + '*-execdir:program: _command_names -e:*\;::program arguments: _normal' '*-maxdepth:maximum search depth' '*-mindepth:minimum search depth' '*-path:path pattern to search:' @@ -53,8 +55,6 @@ case $variant in freebsd*|dragonfly*|darwin*|gnu) args+=( '*-delete' - '*-empty' - '*-execdir:program: _command_names -e:*\;::program arguments: _normal' '*-gid:numeric group ID' '*-uid:numeric user ID' '*-noleaf' @@ -66,6 +66,7 @@ case $variant in '*-wholename:full path pattern to search' \ '*-iwholename:full path pattern to search (case insensitive)' '*-ignore_readdir_race' + '*-mnewer:file to compare (modification time):_files' '*-noignore_readdir_race' '*-okdir:program: _command_names -e:*\;::program arguments: _normal' '*-samefile:file to compare inode:_files' \ @@ -80,9 +81,13 @@ case $variant in netbsd*|freebsd*|dragonfly*|darwin*) args+=( '-E[use extended regular expressions with -regex/-iregex]' + '-s[traverse directories in sorted order]' + ) + ;| + netbsd*|freebsd*|dragonfly*|openbsd*|darwin*) + args+=( '-X[warn if filename contains characters special to xargs]' '-f[specify file hierarchy to traverse]:path:_directories' - '-s[traverse directories in sorted order]' "-x[don't span filesystems]" '*-flags:flags:_chflags' ) @@ -128,7 +133,6 @@ _arguments -C $args \ '*-inum:inode number:' \ '*-links:number of links:' \ '*-ls' \ - '*-mount' \ '*-mtime:modification time (days):->times' \ '*-name:name pattern' \ '*-newer:file to compare (modification time):_files' \ -- cgit v1.2.3 From f4723a0c08ecb9e9260cfac499fb642c0fd5a6bf Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Sun, 2 Aug 2015 20:51:06 +0900 Subject: 35957: fix _make-expandVars() Also use variables set in the command line and environment. --- ChangeLog | 5 ++ Completion/Unix/Command/_make | 132 +++++++++++++++++++++++------------------- 2 files changed, 77 insertions(+), 60 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index c638e5f43..7f7bb892f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-08-01 Jun-ichi Takimoto + + * 35957: Completion/Unix/Command/_make: fix _make-expandVars(), + and use variables set in the command line and environment. + 2015-07-31 Oliver Kiddle * 35963: Src/Modules/system.c: simplify condition found by diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make index c14a34c58..48befa749 100644 --- a/Completion/Unix/Command/_make +++ b/Completion/Unix/Command/_make @@ -4,58 +4,68 @@ # are used in those targets and their dependencies. _make-expandVars() { - local open close var val front ret tmp=$1 + local open close var val front='' rest=$1 - front=${tmp%%\$*} - case $tmp in - (\(*) # Variable of the form $(foobar) - open='(' - close=')' - ;; - - ({*) # ${foobar} - open='{' - close='}' - ;; - - ([[:alpha:]]*) # $foobar. This is exactly $(f)oobar. - open='' - close='' - var=${(s::)var[1]} - ;; - - (\$*) # Escaped $. - print -- "${front}\$$(_make-expandVars ${tmp#\$})" - return - ;; + while [[ $rest == (#b)[^$]#($)* ]]; do + front=$front${rest[1,$mbegin[1]-1]} + rest=${rest[$mbegin[1],-1]} - (*) # Nothing left to substitute. - print -- $tmp - return - ;; - esac - - if [[ -n $open ]] - then - var=${tmp#$open} - var=${var%%$close*} - fi + case $rest[2] in + ($) # '$$'. may not appear in target and variable's value + front=$front\$\$ + rest=${rest[3,-1]} + continue + ;; + (\() # Variable of the form $(foobar) + open='(' + close=')' + ;; + ({) # ${foobar} + open='{' + close='}' + ;; + ([[:alpha:]]) # $foobar. This is exactly $(f)oobar. + open='' + close='' + var=$rest[2] + ;; + (*) # bad parameter name + print -- $front$rest + return 1 + ;; + esac - case $var in - ([[:alnum:]_]#) - val=${VARIABLES[$var]} - ret=${ret//\$$open$var$close/$val} - ;; + if [[ -n $open ]]; then + if [[ $rest == \$$open(#b)([[:alnum:]_]##)(#B)$close* ]]; then + var=$match + else # unmatched () or {}, or bad parameter name + print -- $front$rest + return 1 + fi + fi - (*) - # Improper variable name. No replacement. - # I'm not sure if this is desired behavior. - front+="\$$open$var$close" - ret=${ret/\$$open$var$close/} - ;; - esac + val='' + if [[ -n ${VAR_ARGS[(i)$var]} ]]; then + val=${VAR_ARGS[$var]} + else + if [[ -n $opt_args[(I)(-e|--environment-overrides)] ]]; then + if [[ $parameters[$var] == scalar-export* ]]; then + val=${(P)var} + elif [[ -n ${VARIABLES[(i)$var]} ]]; then + val=${VARIABLES[$var]} + fi + else + if [[ -n ${VARIABLES[(i)$var]} ]]; then + val=${VARIABLES[$var]} + elif [[ $parameters[$var] == scalar-export* ]]; then + val=${(P)var} + fi + fi + fi + rest=${rest//\$$open$var$close/$val} + done - print -- "${front}$(_make-expandVars ${ret})" + print -- ${front}${rest} } _make-parseMakefile () { @@ -84,16 +94,9 @@ _make-parseMakefile () { # TARGET: dependencies # TARGET1 TARGET2 TARGET3: dependencies - ([[:alnum:]][^$TAB:=]#:[^=]*) - input=$(_make-expandVars $input) - target=${input%%:*} - dep=${input#*:} - dep=${(z)dep} - dep="$dep" - for tmp in ${(z)target} - do - TARGETS[$tmp]=$dep - done + ([[*?[:alnum:]$][^$TAB:=%]#:[^=]*) + target=$(_make-expandVars ${input%%:*}) + TARGETS+=( ${(z)target} ) ;; # Include another makefile @@ -150,9 +153,18 @@ _make() { local prev="$words[CURRENT-1]" file expl tmp is_gnu dir incl match local context state state_descr line local -a option_specs - local -A TARGETS VARIABLES opt_args + local -A VARIABLES VAR_ARGS opt_args + local -aU TARGETS keys local ret=1 + # VAR=VAL on the current command line + for tmp in $words; do + if [[ $tmp == (#b)([[:alnum:]_]##)=(*) ]]; then + VAR_ARGS[${tmp[$mbegin[1],$mend[1]]}]=${(e)tmp[$mbegin[2],$mend[2]]} + fi + done + keys=( ${(k)VAR_ARGS} ) # to be used in 'compadd -F keys' + _pick_variant -r is_gnu gnu=GNU unix -v -f if [[ $is_gnu == gnu ]] @@ -275,9 +287,9 @@ _make() { while _tags do _requested targets expl 'make targets' \ - compadd -- ${(k)TARGETS} && ret=0 + compadd -Q -- $TARGETS && ret=0 _requested variables expl 'make variables' \ - compadd -S '=' -- ${(k)VARIABLES} && ret=0 + compadd -S '=' -F keys -- ${(k)VARIABLES} && ret=0 done fi esac -- cgit v1.2.3 From d90f92194fe42973046b02da93f97f82d6a1aa13 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 2 Aug 2015 17:45:35 +0200 Subject: 35970: completion: fix typos in _git and _brace_parameter --- ChangeLog | 6 ++++++ Completion/Unix/Command/_git | 4 ++-- Completion/Zsh/Context/_brace_parameter | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 7f7bb892f..373ff3cd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-08-02 Daniel Hahler + + * 35970: Completion/Unix/Command/_git, + Completion/Zsh/Context/_brace_parameter: completion: fix typos in _git + and _brace_parameter. + 2015-08-01 Jun-ichi Takimoto * 35957: Completion/Unix/Command/_make: fix _make-expandVars(), diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 26f108fbd..5b78a2b81 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -922,7 +922,7 @@ _git-grep () { # TODO: Need to implement - as a shorthand for -C _arguments -C -A '-*' \ '(-O --open-files-in-pager --no-index)--cached[search blobs registered in index file instead of working tree]' \ - '(--cached)--no-index[search files in current directory, not just treacked files]' \ + '(--cached)--no-index[search files in current directory, not just tracked files]' \ '(--exclude-standard)--no-exclude-standard[also search in ignored files]' \ '(--no-exclude-standard)--exclude-standard[exclude files standard ignore mechanisms]' \ '--untracked[search in untracked files]' \ @@ -948,7 +948,7 @@ _git-grep () { '(-z --null)'{-z,--null}'[output \0 after filenames]' \ '(-c --count)'{-c,--count}'[show number of matching lines in files]' \ '( --no-color)--color=-[color matches]:: :__git_color_whens' \ - '(--color )---no-color[do not color matches]' \ + '(--color )--no-color[do not color matches]' \ '--break[prefix the line number to matching lines]' \ '--heading[show the filename above the matches]' \ '(-A --after-context)'{-A,--after-context=}'[show trailing lines, and separate groups of matches]: :__git_guard_number lines' \ diff --git a/Completion/Zsh/Context/_brace_parameter b/Completion/Zsh/Context/_brace_parameter index 3955cb7a4..4097895ee 100644 --- a/Completion/Zsh/Context/_brace_parameter +++ b/Completion/Zsh/Context/_brace_parameter @@ -192,7 +192,7 @@ elif compset -P '*:([\|\*\^]|\^\^)'; then elif compset -P '*:'; then flags=( '-:substitute alternate value if parameter is null' - '+:susbtitute alternate value if parameter is non-null' + '+:substitute alternate value if parameter is non-null' '=:substitute and assign alternate value if parameter is null' '\:=:unconditionally assign value to parameter' '?:print error if parameter is set and non-null' -- cgit v1.2.3 From db7b2f12d84426a309f4f9d21fc8f66cd2576e25 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 5 Aug 2015 15:47:14 +0200 Subject: 35986: add ssh option UpdateHostKeys --- ChangeLog | 3 +++ Completion/Unix/Command/_ssh | 1 + 2 files changed, 4 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 65c9153d7..acfbc7b3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-08-05 Oliver Kiddle + * Christian Hesse: 35986: Completion/Unix/Command/_ssh: + add ssh option UpdateHostKeys + * unposted (c.f. 35902): Functions/Zle/incremental-complete-word: use - after zle -U in case $key starts with - diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index 2be5672da..b23ce3b4e 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -425,6 +425,7 @@ _ssh () { TCPKeepAlive \ Tunnel \ TunnelDevice \ + UpdateHostKeys \ UsePrivilegedPort \ User \ UserKnownHostsFile \ -- cgit v1.2.3 From 764c48f54dfe0a04f18330b0b12f16a894ff34cb Mon Sep 17 00:00:00 2001 From: Eric Cook Date: Wed, 5 Aug 2015 15:57:24 +0200 Subject: 35972: allow for Directive=Value format in .ssh/config --- ChangeLog | 3 +++ Completion/Unix/Command/_ssh | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index acfbc7b3f..4bac3a807 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-08-05 Oliver Kiddle + * Eric Cook: 35972: Completion/Unix/Command/_ssh: allow for + Directive=Value format in .ssh/config + * Christian Hesse: 35986: Completion/Unix/Command/_ssh: add ssh option UpdateHostKeys diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index b23ce3b4e..8649521fa 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -574,8 +574,8 @@ _ssh_hosts () { config="$HOME/.ssh/config" fi if [[ -r $config ]]; then - local IFS=$'\t ' key hosts host - while read key hosts; do + local key hosts host + while IFS=$'=\t ' read -r key hosts; do if [[ "$key" == (#i)host ]]; then for host in ${(z)hosts}; do case $host in -- cgit v1.2.3 From 31c1ebe7b297b63e0fd8c8c134b895dcdad91628 Mon Sep 17 00:00:00 2001 From: Eric Cook Date: Wed, 5 Aug 2015 16:04:31 +0200 Subject: 35973: new systat and vmstat completions --- ChangeLog | 3 ++ Completion/BSD/Command/_systat | 88 +++++++++++++++++++++++++++++++++++++++++ Completion/Unix/Command/_vmstat | 83 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 174 insertions(+) create mode 100644 Completion/BSD/Command/_systat create mode 100644 Completion/Unix/Command/_vmstat (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 4bac3a807..020f5ec9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-08-05 Oliver Kiddle + * Eric Cook: 35973: Completion/BSD/Command/_systat, + Completion/Unix/Command/_vmstat: new completions + * Eric Cook: 35972: Completion/Unix/Command/_ssh: allow for Directive=Value format in .ssh/config diff --git a/Completion/BSD/Command/_systat b/Completion/BSD/Command/_systat new file mode 100644 index 000000000..c8348c7f7 --- /dev/null +++ b/Completion/BSD/Command/_systat @@ -0,0 +1,88 @@ +#compdef systat + +local -a screens args opts +local pre +case $OSTYPE in + freebsd*) + pre=- + screens=( + 'pigs:processes consuming the most CPU time' + icmp{6,}':ICMP statistics' + ip{6,}':IP and UDP statistics' + 'tcp:TCP statistics' + 'iostat:processor and disk statistics' + 'swap:swap space statistics' + 'vmstat:virtual memory statistics' + 'netstat:network connection statistics' + 'ifstat:network traffic statistics' + ) + ;; + openbsd*) + screens=( + 'buckets:kernel malloc(9) bucket statistics' + 'cpu:per CPU, usage statistics' + 'ifstat:interface statistics' + 'iostat:disk throughput statistics' + 'malloc:malloc(9) type statistics' + 'mbufs:mbuf usage statistics' + 'netstat:network connection statistics' + 'nfsclient:NFS client statistics' + 'nfsserver:NFS server statistics' + 'pf:pf(4) filter statistics' + 'pigs:processes consuming the most CPU time' + 'pool:pool(9) statistics' + 'queues:pf(4) queue statistics' + 'rules:pf(4) rule statistics' + 'sensors:display hardware sensors values' + 'states:pf(4) states statistics' + 'swap:swap space usage' + 'vmstat:virtual memory statistics' + ) + opts=( + '-a[display all lines]' + '-B[raw, non-interactive mode (two screen updates)]' + '-b[raw, non-interactive mode (one screen update)]' + '-d[exit after `count'\'' updates]:count' + '-i[interactive mode]' + '-N[resolve network addresses to names]' + '-n[do not resolve network addresses to names]' + '-s[screen refresh interval]:refresh interval (seconds)' + '-w[maximum width of output in raw mode]:width' + ) + ;; + netbsd*) + screens=( + 'all:cycle through all displays' + 'bufcache:filesystem buffer statistics' + 'df:disk usage statistics' + 'inet.icmp:ICMP statistics' + 'inet.ip:IPv4 and UDP statistics' + 'inet.tcp:TCP statistics' + 'inet.tcpsyn:TCP ``syncache'\'\'' statistics' + 'inet6.ip6:IPv6 statistics' + 'iostat:disk throughput statistics' + 'mbufs:mbuf usage statistics' + 'netstat:network connection statistics' + 'pigs:processes consuming the most CPU time' + 'ps:``ps -aux'\'\'' in a loop' + 'swap:swap space usage' + 'syscall:per system call statistics' + 'vmstat:virtual memory statistics' + ) + opts=( + '-M[alternative source to extract values from]:core:_files' + '-N[alternative source to extract the name list from]:system:_files' + '-n[do not resolve IP addresses]' + '-w[refresh interval]:refresh interval' + '-t[the amount of refreshes for each screen in '\''all'\'' display mode]:turns' + ) +esac + +if (( $#screens )); then + _arguments -M 'r:|.=* r:|=*' : $opts \ + '1:systat(1) displays:(( ${pre}$^screens ))' \ + '2:refresh interval' + return +fi + +_default diff --git a/Completion/Unix/Command/_vmstat b/Completion/Unix/Command/_vmstat new file mode 100644 index 000000000..02fa6be64 --- /dev/null +++ b/Completion/Unix/Command/_vmstat @@ -0,0 +1,83 @@ +#compdef vmstat + +local -a specs +case $OSTYPE in + *linux*) + specs=( + '(-a --active)'{-a,--active}'[active/inactive memory]' + '(-f --forks)'{-f,--forks}'[number of forks since boot]' + '(-m --slabs)'{-m,--slabs}'[slabinfo]' + '(-n --one-header)'{-n,--one-header}'[do not redisplay header]' + '(-s --stats)'{-s,--stats}'[event counter statistics]' + '(-d --disk)'{-d,--disk}'[disk statistics]' + '(-D --disk-sum)'{-D,--disk-sum}'[summarize disk statistics]' + '(-p --partition)'{-p,--partition}'[partition specific statistics]:partition:_files' + '(-S --unit)'{-S+,--unit}'[define display unit]:unit prefix:(( k\:1000 K\:1024 m\:1000000 M\:1048576 ))' + '(-w --wide)'{-w,--wide}'[wide output]' + '(-t --timestamp)'{-t,--timestamp}'[show timestamp]' + '1:delay' '2:count' + ) + ;; + freebsd*) + specs=( + '-a[include statistics about all interrupts]' + '-c[number of times to refresh the display]:count' + '-f[report on the number fork syscalls since boot and pages of virtual memory for each]' + '-h[human readable memory columns output]' + '-H[scriptable memory columns output]' + '-i[report the number of interrupts taken by devices since boot]' + '-M[source file to extract values associated with the name list from]:core:_files' + '-N[source file to extract the name list from]:system:_files' + '-m[report on the usage of kernel dynamic memory allocated using malloc(9) by type]' + '-n[change the maximum number of disks to display]:number of disks to display' + '-P[report per-cpu system/user/idle cpu statistics]' + '-p[specify which types of devices to display]: :->devices' + '-s[display the contents of the SUM structure]:sum' + '-w[delay N seconds between each display]:delay' + '-z[report on memory used by the kernel zone allocator, uma(9), by zone]' + '*:disks:_files' + ) + ;; + openbsd*) + specs=( + '-c[number of times to refresh the display]:count' + '-f[report on the number fork syscalls since boot and pages of virtual memory for each]' + '-i[report the number of interrupts taken by devices since boot]' + '-M[source file to extract values associated with the name list from]:core:_files' + '-m[report usage of kernel dynamic memory listed first by size of allocation then type of usage]' + '-N[source file to extract the name list from]:system:_files' + '-s[display the contents of the UVMEXP structure]:uvmexp' + '-t[report on the number of page in and page reclaims since boot]' + '-v[print more verbose information]' + '-w[delay N seconds between each display]:delay' + '-z[include statistics about all interrupts]' + '*:disks:_files' + ) + ;; +esac + +if (( $#specs )); then + local curcontext=$curcontext state state_descr line ret=1 + typeset -A {opt,val}_args + + _arguments -C -s -w -A '-*' : "$specs[@]" && ret=0 + + if [[ $state == devices ]]; then + local -a types + types=( + 'da[direct access devices]' 'sa[sequential access devices]' + 'printer[printers]' 'proc[processor devices]' + 'worm[write once read multiple devices]' 'cd[CD devices]' + 'scanner[scanner devices]' 'optical[optical memory devices]' + 'changer[medium changer devices]' 'comm[communication devices]' + 'array[storage array devices]' 'enclosure[enclosure services devices]' + 'floppy[floppy devices]' 'IDE[Integrated Drive Electronics devices]' + 'SCSI[Small Computer System Interface devices]' + 'other[any other device interface]' 'pass[passthrough devices]' + ) + _values -C -s , 'device type' "$types[@]" && ret=0 + fi + return ret +fi + +_default -- cgit v1.2.3 From 8ce0320d1b9bc64f50babab0a2dcfb85ce2cb1fc Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Wed, 5 Aug 2015 19:31:02 +0200 Subject: 35989: _ssh: update to 6.9 --- ChangeLog | 4 ++ Completion/Unix/Command/_ssh | 127 ++++++++++++++++++++++++++++--------------- 2 files changed, 86 insertions(+), 45 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 020f5ec9a..a7c4bf7d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-08-05 Mikael Magnusson + + * 35989: Completion/Unix/Command/_ssh: update to 6.9 + 2015-08-05 Oliver Kiddle * Eric Cook: 35973: Completion/BSD/Command/_systat, diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index 8649521fa..d00f1dfd6 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -1,6 +1,6 @@ #compdef ssh slogin=ssh scp ssh-add ssh-agent ssh-keygen sftp ssh-copy-id -# Completions currently based on OpenSSH 6.0 (released on 2012-04-22). +# Completions currently based on OpenSSH 6.9 (released on 2015-06-30). # # TODO: update ssh-keygen (not based on 5.9) # TODO: sshd, ssh-keyscan, ssh-keysign @@ -148,16 +148,28 @@ _ssh () { option) if compset -P '*='; then case "$IPREFIX" in - *(#i)(afstokenpassing|batchmode|challengeresponseauthentication|checkhostip|clearallforwardings|compression|enablesshkeysign|exitonforwardfailure|fallbacktorsh|forward(agent|x11)|forwardx11trusted|gatewayports|gssapiauthentication|gssapidelegatecredentials|gssapitrustdns|hashknownhosts|hostbasedauthentication|identitiesonly|kbdinteractiveauthentication|(tcp|)keepalive|nohostauthenticationforlocalhost|passwordauthentication|permitlocalcommand|pubkeyauthentication|rhosts(|rsa)authentication|rsaauthentication|usersh|kerberos(authentication|tgtpassing)|useprivilegedport|visualhostkey)=*) + (#i)(afstokenpassing|batchmode|canonicalizefallbacklocal|challengeresponseauthentication|checkhostip|clearallforwardings|compression|enablesshkeysign|exitonforwardfailure|fallbacktorsh|forward(agent|x11)|forwardx11trusted|gatewayports|gssapiauthentication|gssapidelegatecredentials|gssapitrustdns|hashknownhosts|hostbasedauthentication|identitiesonly|kbdinteractiveauthentication|(tcp|)keepalive|nohostauthenticationforlocalhost|passwordauthentication|permitlocalcommand|proxyusefdpass|pubkeyauthentication|rhosts(|rsa)authentication|rsaauthentication|streamlocalbindunlink|usersh|kerberos(authentication|tgtpassing)|useprivilegedport|visualhostkey)=*) _wanted values expl 'truth value' compadd yes no && ret=0 ;; - *(#i)addressfamily=*) + (#i)addressfamily=*) _wanted values expl 'address family' compadd any inet inet6 && ret=0 ;; - *(#i)bindaddress=*) + (#i)bindaddress=*) _wanted bind-addresses expl 'bind address' _bind_addresses && ret=0 ;; - *(#i)ciphers=*) + (#i)canonicaldomains=*) + _message -e 'canonical domains (space separated)' && ret=0 + ;; + (#i)canonicalizehostname=*) + _wanted values expl 'truthish value' compadd yes no always && ret=0 + ;; + (#i)canonicalizemaxdots=*) + _message -e 'number of dots' && ret=0 + ;; + (#i)canonicalizepermittedcnames=*) + _message -e 'CNAME rule list (source_domain_list:target_domain_list, each pattern list comma separated)' && ret=0 + ;; + (#i)ciphers=*) _values -s , 'encryption cipher' \ '3des-cbc' \ 'aes128-cbc' \ @@ -178,48 +190,48 @@ _ssh () { 'rijndael-cbc@lysator.liu.se' \ && ret=0 ;; - *(#i)cipher=*) + (#i)cipher=*) _wanted values expl 'encryption cipher (protocol version 1)' \ compadd blowfish 3des des idea arcfour tss none && ret=0 ;; - *(#i)compressionlevel=*) + (#i)compressionlevel=*) _values 'compression level' {1..9} && ret=0 ;; - *(#i)connectionattempts=*) + (#i)connectionattempts=*) _message -e 'connection attempts' && ret=0 ;; - *(#i)connecttimeout=*) + (#i)connecttimeout=*) _message -e 'connection timeout' && ret=0 ;; - *(#i)controlmaster=*) + (#i)controlmaster=*) _wanted values expl 'truthish value' compadd yes no auto autoask && ret=0 ;; - *(#i)controlpath=*) + (#i)controlpath=*) _description files expl 'path to control socket' _files "$expl[@]" && ret=0 ;; - *(#i)controlpersist=*) + (#i)controlpersist=*) _message -e 'timeout' ret=0 _wanted values expl 'truth value' compadd yes no && ret=0 ;; - *(#i)escapechar=*) + (#i)escapechar=*) _message -e 'escape character (or `none'\'')' ret=0 ;; - *(#i)forwardx11timeout=*) + (#i)forwardx11timeout=*) _message -e 'timeout' ret=0 ;; - *(#i)globalknownhostsfile=*) + (#i)globalknownhostsfile=*) _description files expl 'global file with known hosts' _files "$expl[@]" && ret=0 ;; - *(#i)hostname=*) + (#i)hostname=*) _wanted hosts expl 'real host name to log into' _ssh_hosts && ret=0 ;; - *(#i)hostkeyalgorithms=*) - _values -s , 'host key algorithms' \ + (#i)(hostbasedkeytypes|hostkeyalgorithms)=*) + _values -s , 'key types' \ 'ecdsa-sha2-nistp256-cert-v01@openssh.com' \ 'ecdsa-sha2-nistp384-cert-v01@openssh.com' \ 'ecdsa-sha2-nistp521-cert-v01@openssh.com' \ @@ -235,11 +247,14 @@ _ssh () { 'ssh-rsa' \ 'ssh-dss' && ret=0 ;; - *(#i)identityfile=*) + (#i)identityfile=*) _description files expl 'SSH identity file' _files "$expl[@]" && ret=0 ;; - *(#i)ipqos=*) + (#i)ignoreunknown=*) + _message -e 'pattern list' && ret=0 + ;; + (#i)ipqos=*) local descr if [[ $PREFIX = *\ *\ * ]]; then return 1; fi if compset -P '* '; then @@ -252,105 +267,115 @@ _ssh () { 'cs0' 'cs1' 'cs2' 'cs3' 'cs4' 'cs5' 'cs6' 'cs7' 'ef' \ 'lowdelay' 'throughput' 'reliability' && ret=0 ;; - *(#i)(local|remote)forward=*) + (#i)(local|remote)forward=*) state=forward ;; - *(#i)dynamicforward=*) + (#i)dynamicforward=*) state=dynforward ;; - *(#i)kbdinteractivedevices=*) + (#i)kbdinteractivedevices=*) _values -s , 'keyboard-interactive authentication methods' \ 'bsdauth' 'pam' 'skey' && ret=0 ;; - *(#i)kexalgorithms=*) + (#i)kexalgorithms=*) _values -s , 'KEX algorithms' \ ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 \ diffie-hellman-group-exchange-sha256 \ diffie-hellman-group-exchange-sha1 \ diffie-hellman-group14-sha1 diffie-hellman-group1-sha1 && ret=0 ;; - *(#i)localcommand=*) + (#i)localcommand=*) _description commands expl 'run command locally after connecting' _command_names && ret=0 ;; - *(#i)loglevel=*) + (#i)loglevel=*) _values 'log level' QUIET FATAL ERROR INFO VERBOSE\ DEBUG DEBUG1 DEBUG2 DEBUG3 && ret=0 ;; - *(#i)macs=*) + (#i)macs=*) state=macs ;; - *(#i)numberofpasswordprompts=*) + (#i)numberofpasswordprompts=*) _message -e 'number of password prompts' ret=0 ;; - *(#i)pkcs11provider=*) + (#i)pkcs11provider=*) _description files expl 'PKCS#11 shared library' _files -g '*.so' "$expl[@]" && ret=0 ;; - *(#i)port=*) + (#i)port=*) _message -e 'port number on remote host' ret=0 ;; - *(#i)preferredauthentications=*) + (#i)preferredauthentications=*) _values -s , 'authentication method' gssapi-with-mic \ hostbased publickey keyboard-interactive password && ret=0 ;; - *(#i)protocol=*) + (#i)protocol=*) _values -s , 'protocol version' \ '1' \ '2' && ret=0 ;; - *(#i)proxycommand=*) + (#i)proxycommand=*) compset -q shift 1 words (( CURRENT-- )) _normal && ret=0 ;; - *(#i)rekeylimit=*) + (#i)rekeylimit=*) _message -e 'maximum number of bytes transmitted before renegotiating session key' ret=0 ;; - *(#i)requesttty=*) + (#i)requesttty=*) _values 'request a pseudo-tty' \ 'no[never request a TTY]' \ 'yes[always request a TTY when stdin is a TTY]' \ 'force[always request a TTY]' \ 'auto[request a TTY when opening a login session]' && ret=0 ;; - *(#i)sendenv=*) + (#i)revokedhostkeys=*) + _description files expl 'revoked host keys file' + _files "$expl[@]" && ret=0 + ;; + (#i)sendenv=*) _wanted envs expl 'environment variable' _parameters -g 'scalar*export*' && ret=0 ;; - *(#i)serveralivecountmax=*) + (#i)serveralivecountmax=*) _message -e 'number of alive messages without replies before disconnecting' ret=0 ;; - *(#i)serveraliveinterval=*) + (#i)serveraliveinterval=*) _message -e 'timeout in seconds since last data was received to send alive message' ret=0 ;; - *(#i)(stricthostkeychecking|verifyhostkeydns)=*) - _wanted values expl 'checking type' compadd yes no ask && ret=0 + (#i)streamlocalbindmask=*) + _message -e 'octal mask' && ret=0 + ;; + (#i)(stricthostkeychecking|verifyhostkeydns|updatehostkeys)=*) + _wanted values expl 'truthish value' compadd yes no ask && ret=0 + ;; + (#i)transport=*) + _values 'transport protocol' TCP SCTP && ret=0 ;; - *(#i)tunnel=*) + (#i)tunnel=*) _values 'request device forwarding' \ 'yes' \ 'point-to-point' \ 'ethernet' \ 'no' && ret=0 ;; - *(#i)tunneldevice=*) + (#i)tunneldevice=*) _message -e 'local_tun[:remote_tun] (integer or "any")' ret=0 ;; - *(#i)userknownhostsfile=*) + (#i)userknownhostsfile=*) _description files expl 'user file with known hosts' _files "$expl[@]" && ret=0 ;; - *(#i)user=*) + (#i)user=*) _wanted users expl 'user to log in as' _ssh_users && ret=0 ;; - *(#i)xauthlocation=*) + (#i)xauthlocation=*) _description files expl 'xauth program' _files "$expl[@]" -g '*(-*)' && ret=0 ;; @@ -362,6 +387,11 @@ _ssh () { AddressFamily \ BatchMode \ BindAddress \ + CanonicalDomains \ + CanonicalizeFallbackLocal \ + CanonicalizeHostname \ + CanonicalizeMaxDots \ + CanonicalizePermittedCNAMEs \ ChallengeResponseAuthentication \ CheckHostIP \ Cipher \ @@ -390,11 +420,13 @@ _ssh () { HashKnownHosts \ Host \ HostbasedAuthentication \ + HostbasedKeyTypes \ HostKeyAlgorithms \ HostKeyAlias \ HostName \ IdentitiesOnly \ IdentityFile \ + IgnoreUnknown \ IPQoS \ KbdInteractiveAuthentication \ KbdInteractiveDevices \ @@ -412,17 +444,22 @@ _ssh () { PreferredAuthentications \ Protocol \ ProxyCommand \ + ProxyUseFdpass \ PubkeyAuthentication \ RekeyLimit \ RemoteForward \ RequestTTY \ + RevokedHostKeys \ RhostsRSAAuthentication \ RSAAuthentication \ SendEnv \ ServerAliveCountMax \ ServerAliveInterval \ + StreamLocalBindMask \ + StreamLocalBindUnlink \ StrictHostKeyChecking \ TCPKeepAlive \ + Transport \ Tunnel \ TunnelDevice \ UpdateHostKeys \ -- cgit v1.2.3 From fb0b6483a08300e6d72e6079d0e402603f73255d Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Wed, 5 Aug 2015 19:45:35 +0200 Subject: unposted: _ssh: use the -q option for the = suffix This way, you can press = to start completing the values instead of the space, backspace, tab dance --- ChangeLog | 3 +++ Completion/Unix/Command/_ssh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index a7c4bf7d5..c39e3bb3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * 35989: Completion/Unix/Command/_ssh: update to 6.9 + * unposted: Completion/Unix/Command/_ssh: use -q for the + option suffix + 2015-08-05 Oliver Kiddle * Eric Cook: 35973: Completion/BSD/Command/_systat, diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index d00f1dfd6..fb8fe57b0 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -383,7 +383,7 @@ _ssh () { else # old options are after the empty "\"-line _wanted values expl 'configure file option' \ - compadd -M 'm:{a-z}={A-Z}' -S '=' - \ + compadd -M 'm:{a-z}={A-Z}' -q -S '=' - \ AddressFamily \ BatchMode \ BindAddress \ -- cgit v1.2.3 From 2fc05d522fa2bf4cab0ebe57bee02093ba6b1382 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 5 Aug 2015 20:41:14 +0200 Subject: 35991: _ssh: add ssh option FingerprintHash Signed-off-by: Christian Hesse --- ChangeLog | 3 +++ Completion/Unix/Command/_ssh | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index c39e3bb3f..337a1f31f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ * unposted: Completion/Unix/Command/_ssh: use -q for the option suffix + * Christian Hesse: 35991: Completion/Unix/Command/_ssh: add ssh + option FingerprintHash + 2015-08-05 Oliver Kiddle * Eric Cook: 35973: Completion/BSD/Command/_systat, diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index fb8fe57b0..b7b7e41dc 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -219,6 +219,10 @@ _ssh () { _message -e 'escape character (or `none'\'')' ret=0 ;; + (#i)fingerprinthash=*) + _values 'fingerprint hash algorithm' \ + md5 ripemd160 sha1 sha256 sha384 sha512 && ret=0 + ;; (#i)forwardx11timeout=*) _message -e 'timeout' ret=0 @@ -408,6 +412,7 @@ _ssh () { EnableSSHKeysign \ EscapeChar \ ExitOnForwardFailure \ + FingerprintHash \ ForwardAgent \ ForwardX11 \ ForwardX11Timeout \ -- cgit v1.2.3 From 783ce79a11c62eee75ce5cba458f0e26726ef5a7 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:21 +0200 Subject: 36046: _tmux: Update command line options New: -C and -V Removed: -q (tmux still excepts it for backward compatibility, but it does nothing) --- ChangeLog | 5 +++++ Completion/Unix/Command/_tmux | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 1f8c732e5..772db4074 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-08-10 Frank Terbeck + + * 36046: Completion/Unix/Command/_tmux: _tmux: Update command line + options + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index f0cc4be37..7e192ab13 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1499,13 +1499,14 @@ function _tmux() { '-2[force using 256 colours]' '-8[force using 88 colours]' '-c[execute a shell command]:command name:_command_names' + '-C[start tmux in contol mode. -CC disables echo]' '-f[specify configuration file]:tmux config file:_files -g "*(-.)"' '-l[behave like a login shell]' '-L[specify socket name]:socket name:__tmux-socket-name' - '-q[do not send informational messages]' '-S[specify socket path]:server socket:_path_files -g "*(=,/)"' '-u[force using UTF-8]' '-v[request verbose logging]' + '-V[report tmux version]' '*:: :->subcommand_or_options' ) _arguments -C -s -w ${args} && ret=0 -- cgit v1.2.3 From 742f4da3d9d4006e843a55535f9b4ec0f0175a8a Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:22 +0200 Subject: 36048: _tmux: Update options for supported commands This also adds a little TODO on top about what is missing. --- ChangeLog | 3 + Completion/Unix/Command/_tmux | 339 ++++++++++++++++++++++++------------------ 2 files changed, 197 insertions(+), 145 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 772db4074..c5be09bb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * 36046: Completion/Unix/Command/_tmux: _tmux: Update command line options + * 36048: Completion/Unix/Command/_tmux: _tmux: Update options for + supported commands + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 7e192ab13..7fb328e3e 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -40,6 +40,21 @@ # # The configuration for subcommand completions may be done in # this context: ':completion:*:*:tmux-:*:*' +# +# TODO: +# +# Missing sub-commands: +# +# - choose-tree +# - last-pane +# - move-pane +# - respawn-pane +# - choose-buffer +# - wait-for +# +# In addition, the way options (set/show etc) are handled needs to be reviewed. +# For example, set-option can set every type of option now. I hope this is +# rather simple to improve. # Global variables; setup the first time _tmux is called. # For $_tmux_commands[] generation, see the very end of this file. @@ -154,6 +169,7 @@ function _tmux-attach-session() { local -a args args=( + '-c[specify working directory for the session]:directory:_path_files -g "*(-/)"' '-d[detach other clients attached to target session]' '-r[put the client into read-only mode]' '-t[choose a target session]:target session:__tmux-sessions' @@ -189,6 +205,8 @@ function _tmux-break-pane() { local -a args args=( '-d[do not make the new window become the active one]' + '-F[specify format of output]:format:__tmux-format' + '-P[print information of new window after it has been created]' '-t[choose a target pane]:panes:__tmux-panes' ) _arguments ${args} @@ -198,7 +216,16 @@ function _tmux-capture-pane() { [[ -n ${tmux_describe} ]] && print "Capture the contents of a pane to a buffer" && return local -a args args=( + '-a[use alternate screen]' '-b[choose target buffer]:target buffer:__tmux-buffers' + '-C[escape non-printable characters as octal \ooo]' + '-e[include escape sequences for attributes etc]' + '-E[specify last line to capture. - means last line of pane]' + '-J[join wrapped lines and preserver trailing space]' + '-q[ignore errors when trying to access alternate screen]' + '-p[print data to stdout]' + '-P[only capture that is the beginning of an as-yet incomplete esc seq]' + '-S[specify start line to capture. - means first line of scrollback]' '-t[choose source pane]:source pane:__tmux-panes' ) _arguments ${args} @@ -206,17 +233,35 @@ function _tmux-capture-pane() { function _tmux-choose-client() { [[ -n ${tmux_describe} ]] && print "Put a window into client choice mode" && return - __tmux-choose-stuff + local -a args + args=( + '-F[specify format of output]:format:__tmux-format' + '-t[choose a target window]:sessions:__tmux-windows' + '*:: :->tmpl' + ) + _arguments ${args} && return } function _tmux-choose-session() { [[ -n ${tmux_describe} ]] && print "Put a window into session choice mode" && return - __tmux-choose-stuff + local -a args + args=( + '-F[specify format of output]:format:__tmux-format' + '-t[choose a target window]:sessions:__tmux-windows' + '*:: :->tmpl' + ) + _arguments ${args} && return } function _tmux-choose-window() { [[ -n ${tmux_describe} ]] && print "Put a window into window choice mode" && return - __tmux-choose-stuff + local -a args + args=( + '-F[specify format of output]:format:__tmux-format' + '-t[choose a target window]:sessions:__tmux-windows' + '*:: :->tmpl' + ) + _arguments ${args} && return } function _tmux-clear-history() { @@ -238,6 +283,7 @@ function _tmux-command-prompt() { local state local -a args args=( + '-I[comma separated list of initial inputs]:initial-text:->ilist' '-p[list of prompts]:prompts:->plist' '-t[choose a target client]:clients:__tmux-clients' '*:: :->tmpl' @@ -246,6 +292,9 @@ function _tmux-command-prompt() { if [[ ${state} == 'plist' ]]; then _message "comma seperated list of prompts" return + elif [[ ${state} == 'ilist' ]]; then + _message "comma seperated list of initial text" + return fi __tmux-lastarg ${state} 'tmpl' 1 "command template" } @@ -255,10 +304,15 @@ function _tmux-confirm-before() { local state local -a args args=( + '-p[specify prompt]:prompt:->prompt' '-t[choose a target client]:clients:__tmux-clients' '*:: :->command_and_args' ) _arguments -C ${args} && return + if [[ ${state} == 'prompt' ]]; then + _message 'prompt string' + return + fi __tmux-lastarg ${state} 'command_and_args' 1 "command string" } @@ -309,39 +363,20 @@ function _tmux-copy-mode() { function _tmux-delete-buffer() { [[ -n ${tmux_describe} ]] && print "Delete a paste buffer" && return - local state session local -a args - local -ax bopts - - args=( - '-b[choose a target buffer index]:panes:->buffer' - '-t[choose a target session]:panes:->session' - ) - _arguments ${args} - - case ${state} in - (session) - __tmux-sessions - return - ;; - (buffer) - session="$(__tmux-get-optarg -t "${words[@]}")" - ;; - (*) return ;; - esac - if [[ -n ${session} ]]; then - bopts=( -t ${session} ) - __tmux-buffers - return - fi - bopts=() - __tmux-buffers + args=('-b[choose a target buffer index]:buffers:__tmux-buffers') + _arguments ${args} && return } function _tmux-detach-client() { [[ -n ${tmux_describe} ]] && print "Detach a client from the server" && return local -a args - args=('-t[choose a target client]:clients:__tmux-clients') + args=( + '-a[kill all clients except for the named by -t]' + '-P[send SIGHUP to parent process]' + '-s[choose a target session and kill its clients]:sessions:__tmux-sessions' + '-t[choose a target client]:clients:__tmux-clients' + ) _arguments ${args} } @@ -349,6 +384,7 @@ function _tmux-display-message() { [[ -n ${tmux_describe} ]] && print "Display a message in the status line" && return local -a args args=( + '-c[choose a target client]:clients:__tmux-clients' '-p[print message to stdout]' '-t[choose a target client]:clients:__tmux-clients' '*:: :->msg' @@ -376,6 +412,10 @@ function _tmux-find-window() { local curcontext="${curcontext}" state local -a args args=( + '-C[match visible contents]' + '-F[specify format of output]:format:__tmux-format' + '-N[match window name]' + '-T[match window title]' '-t[choose a target window]:windows:__tmux-windows' '*:: :->pattern' ) @@ -394,6 +434,8 @@ function _tmux-if-shell() { [[ -n ${tmux_describe} ]] && print "Execute a tmux command if a shell-command succeeded" && return local -a args args=( + '-b[run shell command in background]' + '-F[do not execute shell command but use it as a string-value]' '1:shell command:' '2:tmux command:' ) @@ -404,6 +446,7 @@ function _tmux-join-pane() { [[ -n ${tmux_describe} ]] && print "Split a pane and move an existing one into the new space" && return local -a args args=( + '-b[join source pane left of or above target pane]' '-d[do not make the new window become the active one]' '-h[split horizontally]' '-v[split vertically]' @@ -419,7 +462,7 @@ function _tmux-kill-pane() { [[ -n ${tmux_describe} ]] && print "Destroy a given pane" && return local -a args args=( - '-a[kill all panes, except current]' + '-a[kill all panes except the one specified by -t]' '-t[choose a target pane]:panes:__tmux-panes' ) _arguments ${args} @@ -433,14 +476,20 @@ function _tmux-kill-server() { function _tmux-kill-session() { [[ -n ${tmux_describe} ]] && print "Destroy a given session" && return local -a args - args=('-t[choose a target session]:sessions:__tmux-sessions') + args=( + '-a[kill all session except the one specified by -t]' + '-t[choose a target session]:sessions:__tmux-sessions' + ) _arguments ${args} } function _tmux-kill-window() { [[ -n ${tmux_describe} ]] && print "Destroy a given window" && return local -a args - args=('-t[choose a target window]:windows:__tmux-windows') + args=( + '-a[kill all windows except the one specified by -t]' + '-t[choose a target window]:windows:__tmux-windows' + ) _arguments ${args} } @@ -466,13 +515,18 @@ function _tmux-link-window() { function _tmux-list-buffers() { [[ -n ${tmux_describe} ]] && print "List paste buffers of a session" && return local -a args - args=('-t[choose a session]:sessions:__tmux-sessions') + args=('-F[specify format of output]:format:__tmux-format') _arguments ${args} && return } function _tmux-list-clients() { [[ -n ${tmux_describe} ]] && print "List clients attached to server" && return - __tmux-nothing-else + local -a args + args=( + '-F[specify format of output]:format:__tmux-format' + '-t[choose a session]:sessions:__tmux-sessions' + ) + _arguments ${args} && return } function _tmux-list-commands() { @@ -490,52 +544,43 @@ function _tmux-list-keys() { function _tmux-list-panes() { [[ -n ${tmux_describe} ]] && print "List panes of a window" && return local -a args - args=('-t[choose a window]:windows:__tmux-windows') + args=( + '-a[list all panes the server possesses]' + '-F[specify format of output]:format:__tmux-format' + '-s[if specified, -t chooses a session]' + # TODO: Use __tmux-windows or __tmux-sessions depending on -s. + '-t[choose a window]:windows:__tmux-windows' + ) _arguments ${args} && return } function _tmux-list-sessions() { [[ -n ${tmux_describe} ]] && print "List sessions managed by server" && return - __tmux-nothing-else + local -a args + args=('-F[specify format of output]:format:__tmux-format') + _arguments ${args} && return } function _tmux-list-windows() { [[ -n ${tmux_describe} ]] && print "List windows of a session" && return local -a args - args=('-t[choose a session]:sessions:__tmux-sessions') + args=( + '-a[list all windows the tmux server possesses]' + '-F[specify format of output]:format:__tmux-format' + '-t[choose a session]:sessions:__tmux-sessions' + ) _arguments ${args} && return } function _tmux-load-buffer() { [[ -n ${tmux_describe} ]] && print "Load a file into a paste buffer" && return - local state session local -a args - local -ax bopts args=( - '-b[choose a target buffer index]:panes:->buffer' - '-t[choose a target session]:panes:->session' + '-b[choose a target buffer index]:panes:__tmux-buffers' '1:file name:_files -g "*(-.)"' ) - _arguments ${args} - - case ${state} in - (session) - __tmux-sessions - return - ;; - (buffer) - session="$(__tmux-get-optarg -t "${words[@]}")" - ;; - (*) return ;; - esac - if [[ -n ${session} ]]; then - bopts=( -t ${session} ) - __tmux-buffers - return - fi - bopts=() - __tmux-buffers + _arguments ${args} && return } function _tmux-lock-client() { @@ -562,7 +607,9 @@ function _tmux-move-window() { local -a args args=( '-d[do not make the new window become the active one]' + '-k[kill the target window if it exists]' '-s[choose source window]:window:__tmux-windows' + '-r[renumber windows in session in sequential order]' '-t[choose destination window]:window:__tmux-windows' ) _arguments ${args} @@ -572,11 +619,17 @@ function _tmux-new-session() { [[ -n ${tmux_describe} ]] && print "Create a new session" && return local -a args args=( - '-d[do not attach new session to current terminal]' '-A[attach to existing session if it already exists]' + '-c[specify working directory for the session]:directory:_path_files -g "*(-/)"' + '-d[do not attach new session to current terminal]' + '-D[in case of -A behave like attach-session'\''s -d]' + '-F[specify format of output]:format:__tmux-format' '-n[name the initial window]:window name' + '-P[print information about new session after it is created]' '-s[name the session]:session name:__tmux-sessions' '-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' ) _arguments -s ${args} @@ -586,9 +639,13 @@ function _tmux-new-window() { [[ -n ${tmux_describe} ]] && print "Create a new window" && return local -a args args=( + '-a[insert new window at next free index from -t]' + '-c[specify working directory for the session]:directory:_path_files -g "*(-/)"' '-d[do not make the new window become the active one]' + '-F[specify format of output]:format:__tmux-format' '-k[destroy it if the specified window exists]' '-n[specify a window name]:window name:' + '-P[print information about new window after it is created]' '-t[specify target window]:windows:__tmux-windows' '*:: :_command' ) @@ -606,7 +663,7 @@ function _tmux-next-window() { [[ -n ${tmux_describe} ]] && print "Move to the next window in a session" && return local -a args args=( - '-a[move to the next window with activity]' + '-a[move to the next window with an alert]' '-t[choose target session]:session:__tmux-sessions' ) _arguments ${args} @@ -616,9 +673,11 @@ function _tmux-paste-buffer() { [[ -n ${tmux_describe} ]] && print "Insert a paste buffer into the window" && return local -a args args=( + '-b[choose buffer]:source buffer:__tmux-buffers' '-d[remove buffer from stack after pasting]' + '-p[use bracketed paste mode if the application requested it]' '-r[do not replace LF with CR when pasting]' - '-b[choose buffer]:source buffer:__tmux-buffers' + '-s[specify separator]:separator:' '-t[choose target window]:window:__tmux-windows' ) _arguments ${args} @@ -647,7 +706,7 @@ function _tmux-previous-window() { [[ -n ${tmux_describe} ]] && print "Move to the previous window in a session" && return local -a args args=( - '-a[move to the previous window with activity]' + '-a[move to the previous window with an alert]' '-t[choose target session]:session:__tmux-sessions' ) _arguments ${args} @@ -656,7 +715,10 @@ function _tmux-previous-window() { function _tmux-refresh-client() { [[ -n ${tmux_describe} ]] && print "Refresh a client" && return local -a args - args=('-t[choose target client]:client:__tmux-clients') + args=( + '-S[Only update the client'\''s status bar]' + '-t[choose target client]:client:__tmux-clients' + ) _arguments ${args} } @@ -690,6 +752,9 @@ function _tmux-resize-pane() { '-R[resize to the right]' '-U[resize upward]' '-t[choose target pane]:pane:__tmux-panes' + '-x[specify width]:width:_guard "[0-9]#" "numeric value"' + '-y[specify height]:height:_guard "[0-9]#" "numeric value"' + '-Z[toggle zoom of pane]' '1::adjustment (defaults to one):_guard "[0-9]#" "numeric value"' ) _arguments ${args} @@ -719,43 +784,31 @@ function _tmux-rotate-window() { function _tmux-run-shell() { [[ -n ${tmux_describe} ]] && print "Execute a command without creating a new window" && return - _command + local -a args + args=( + '-b[run shell command in background]' + '-t[choose target pane]:pane:__tmux-panes' + '*::command:_command' + ) + _arguments ${args} } function _tmux-save-buffer() { [[ -n ${tmux_describe} ]] && print "Save a paste buffer to a file" && return - local state session local -a args - local -ax bopts args=( - '-b[choose a target buffer index]:buffer:->buffer' - '-t[choose a target session]:buffer:->session' + '-a[append to rather than overwriting file]' + '-b[choose a target buffer index]:buffer:__tmux-buffers' ) - _arguments ${args} - - case ${state} in - (session) - __tmux-sessions - return - ;; - (buffer) - session="$(__tmux-get-optarg -t "${words[@]}")" - ;; - (*) return ;; - esac - if [[ -n ${session} ]]; then - bopts=( -t ${session} ) - __tmux-buffers - return - fi - bopts=() - __tmux-buffers + _arguments ${args} && return } function _tmux-select-layout() { [[ -n ${tmux_describe} ]] && print "Choose a layout for a window" && return args=( + '-n[behave like next-layout]' + '-p[behave like previous-layout]' '-t[choose a target window]:target window:__tmux-windows' '*::layout name:__tmux-layouts' ) @@ -765,7 +818,16 @@ function _tmux-select-layout() { function _tmux-select-pane() { [[ -n ${tmux_describe} ]] && print "Make a pane the active one in the window" && return local -a args - args=('-t[choose a target pane]:panes:__tmux-panes') + args=( + '-D[Move to the pane down of this]' + '-d[disable input to the pane]' + '-e[enable input to the pane]' + '-l[behave like last-pane]' + '-L[Move to the pane left of this]' + '-R[Move to the pane right of this]' + '-U[Move to the pane above this]' + '-t[choose a target pane]:panes:__tmux-panes' + ) _arguments ${args} && return } @@ -779,7 +841,13 @@ function _tmux-select-prompt() { function _tmux-select-window() { [[ -n ${tmux_describe} ]] && print "Select a window" && return local -a args - args=('-t[choose a target window]:windows:__tmux-windows') + args=( + '-l[behave like last-window]' + '-n[behave like next-window]' + '-p[behave like previous-window]' + '-T[if selected window is the current behave like last-window]' + '-t[choose a target window]:windows:__tmux-windows' + ) _arguments ${args} && return } @@ -788,6 +856,8 @@ function _tmux-send-keys() { local curcontext="${curcontext}" state local -a args args=( + '-l[disable key name lookup and send data literally]' + '-R[reset terminal state]' '-t[choose a target pane]:panes:__tmux-panes' '*:: :->key' ) @@ -798,7 +868,10 @@ function _tmux-send-keys() { function _tmux-send-prefix() { [[ -n ${tmux_describe} ]] && print "Send the prefix key to a window" && return local -a args - args=('-t[choose a target pane]:panes:__tmux-panes') + args=( + '-2[send secondary prefix key]' + '-t[choose a target pane]:panes:__tmux-panes' + ) _arguments ${args} } @@ -809,33 +882,16 @@ function _tmux-server-info() { function _tmux-set-buffer() { [[ -n ${tmux_describe} ]] && print "Set contents of a paster buffer" && return - local state session + local state local -a args - local -ax bopts - args=( - '-b[choose a target buffer index]:panes:->buffer' - '-t[choose a target session]:panes:->session' + '-a[append to rather than overwriting target buffer]' + '-b[choose a target buffer index]:panes:__tmux-buffer' + '-n[specify new buffer name]:buffer-name:' + '*:: :->data' ) - _arguments ${args} - - case ${state} in - (session) - __tmux-sessions - return - ;; - (buffer) - session="$(__tmux-get-optarg -t "${words[@]}")" - ;; - (*) return ;; - esac - if [[ -n ${session} ]]; then - bopts=( -t ${session} ) - __tmux-buffers - return - fi - bopts=() - __tmux-buffers + _arguments ${args} && return + __tmux-lastarg ${state} 'data' 1 "data" } function _tmux-set-environment() { @@ -904,33 +960,9 @@ function _tmux-set-window-option() { function _tmux-show-buffer() { [[ -n ${tmux_describe} ]] && print "Display the contents of a paste buffer" && return - local state session local -a args - local -ax bopts - - args=( - '-b[choose a target buffer index]:panes:->buffer' - '-t[choose a target session]:panes:->session' - ) - _arguments ${args} - - case ${state} in - (session) - __tmux-sessions - return - ;; - (buffer) - session="$(__tmux-get-optarg -t "${words[@]}")" - ;; - (*) return ;; - esac - if [[ -n ${session} ]]; then - bopts=( -t ${session} ) - __tmux-buffers - return - fi - bopts=() - __tmux-buffers + args=('-b[choose a target buffer index]:panes:->buffer') + _arguments ${args} && return } function _tmux-show-environment() { @@ -945,7 +977,13 @@ function _tmux-show-environment() { function _tmux-show-messages() { [[ -n ${tmux_describe} ]] && print "Show client"\'"s message log" && return - args=('-t[choose target client]:client:__tmux-clients') + local -a args + args=( + '-I[show debugging information about the tmux server]' + '-J[show debugging information about running jobs]' + '-T[show debugging information about involved terminals]' + '-t[choose target client]:client:__tmux-clients' + ) _arguments ${args} } @@ -978,12 +1016,14 @@ function _tmux-split-window() { [[ -n ${tmux_describe} ]] && print "Splits a pane into two" && return local -a args args=( + '-b[create new pane left of or above target pane]' '-d[do not make the new window become the active one]' + '-F[specify format of output]:format:__tmux-format' '-h[split horizontally]' '-v[split vertically]' '-l[define new pane'\''s size]: :_guard "[0-9]#" "numeric value"' '-p[define new pane'\''s size in percent]: :_guard "[0-9]#" "numeric value"' - # Yes, __tmux_pane is correct here. The behaviour was changed + # Yes, __tmux-panes is correct here. The behaviour was changed # in recent tmux versions and makes more sense. Except that # changing the command's name might annoy users. So it stays like # this. @@ -1034,6 +1074,10 @@ function _tmux-switch-client() { local -a args args=( '-c[choose a target client]:client:__tmux-clients' + '-l[move client to last session]' + '-n[move client to next session]' + '-p[move client to previous session]' + '-r[toggle read-only flag of client]' '-t[choose a target window]:window:__tmux-windows' ) _arguments ${args} @@ -1046,6 +1090,7 @@ function _tmux-unbind-key() { ow=( "${words[@]}" ) args=( + '-a[Remove all key bindings]' '-c[kill the window if it is only in one session]' '-n[remove a non-prefix binding]' '-t[choose a key table]:key table:__tmux-key-tables' @@ -1129,6 +1174,10 @@ function __tmux-clients() { _describe -t clients 'clients' clients } +function __tmux-format() { + _message 'not implemented yet' +} + function __tmux-colours() { local -a colnames colnames=( default black red green yellow blue magenta cyan white colourN:"replace N by a number between 0 and 255" ) -- cgit v1.2.3 From e2495da3c2a2aaa76952413e73da5b866d8b50e1 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:23 +0200 Subject: 36062: _tmux: Add support for new sub-commands --- ChangeLog | 3 ++ Completion/Unix/Command/_tmux | 100 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 91 insertions(+), 12 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index c5be09bb7..a6fd0070d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ * 36048: Completion/Unix/Command/_tmux: _tmux: Update options for supported commands + * 36062: Completion/Unix/Command/_tmux: _tmux: Add support for new + sub-commands + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 7fb328e3e..92c919068 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -43,18 +43,10 @@ # # TODO: # -# Missing sub-commands: -# -# - choose-tree -# - last-pane -# - move-pane -# - respawn-pane -# - choose-buffer -# - wait-for -# -# In addition, the way options (set/show etc) are handled needs to be reviewed. -# For example, set-option can set every type of option now. I hope this is -# rather simple to improve. +# The way options (set/show etc) are handled needs to be reviewed. +# For example, set-option can set every type of option now. I hope +# this is rather simple to improve. Also, there are new options that +# need to be supported. # Global variables; setup the first time _tmux is called. # For $_tmux_commands[] generation, see the very end of this file. @@ -88,9 +80,11 @@ _tmux_aliasmap=( killp kill-pane killw kill-window last last-window + lastp last-pane linkw link-window lsp list-panes lsw list-windows + movep move-pane movew move-window neww new-window nextl next-layout @@ -99,6 +93,7 @@ _tmux_aliasmap=( prev previous-window renamew rename-window resizep resize-pane + respawnp respawn-pane respawnw respawn-window rotatew rotate-window selectl select-layout @@ -146,6 +141,7 @@ _tmux_aliasmap=( lock lock-server run run-shell info server-info + wait wait-for ) # --- Sub-command functions --- @@ -231,6 +227,17 @@ function _tmux-capture-pane() { _arguments ${args} } +function _tmux-choose-buffer() { + [[ -n ${tmux_describe} ]] && print "Put a window into buffer choice mode" && return + local -a args + args=( + '-F[specify format of output]:format:__tmux-format' + '-t[choose a target window]:sessions:__tmux-windows' + '*:: :->tmpl' + ) + _arguments ${args} && return +} + function _tmux-choose-client() { [[ -n ${tmux_describe} ]] && print "Put a window into client choice mode" && return local -a args @@ -253,6 +260,23 @@ function _tmux-choose-session() { _arguments ${args} && return } +function _tmux-choose-tree() { + [[ -n ${tmux_describe} ]] && print "Put a window into tree choice mode" && return + local -a args + args=( + '-b[override default session command]:session-command:' + '-c[override default window command]:window-command:' + '-S[specify session format]:session-format:__tmux-formats' + '-s[choose among sessions]' + '-t[choose a target window]:sessions:__tmux-windows' + '-u[show generated tree uncollapsed at startup]' + '-W[specify window format]:window-format:__tmux-formats' + '-w[choose among windows]' + '*:: :->tmpl' + ) + _arguments ${args} && return +} + function _tmux-choose-window() { [[ -n ${tmux_describe} ]] && print "Put a window into window choice mode" && return local -a args @@ -493,6 +517,17 @@ function _tmux-kill-window() { _arguments ${args} } +function _tmux-last-pane() { + [[ -n ${tmux_describe} ]] && print "Select the previously selected pane" && return + local -a args + args=( + '-d[disable input to the pane]' + '-e[enable input to the pane]' + '-t[choose a session]:sessions:__tmux-sessions' + ) + _arguments ${args} && return +} + function _tmux-last-window() { [[ -n ${tmux_describe} ]] && print "Select the previously selected window" && return local -a args @@ -602,6 +637,22 @@ function _tmux-lock-session() { _arguments ${args} && return } +function _tmux-move-pane() { + [[ -n ${tmux_describe} ]] && print "Move a pane into a new space" && return + local -a args + args=( + '-b[join source pane left of or above target pane]' + '-d[do not make the new window become the active one]' + '-h[split horizontally]' + '-v[split vertically]' + '-l[define new pane'\''s size]: :_guard "[0-9]#" "numeric value"' + '-p[define new pane'\''s size in percent]: :_guard "[0-9]#" "numeric value"' + '-s[choose source pane]:window:__tmux-panes' + '-t[choose target pane]:window:__tmux-panes' + ) + _arguments ${args} && return +} + function _tmux-move-window() { [[ -n ${tmux_describe} ]] && print "Move a window to another" && return local -a args @@ -760,6 +811,17 @@ function _tmux-resize-pane() { _arguments ${args} } +function _tmux-respawn-pane() { + [[ -n ${tmux_describe} ]] && print "Reuse a pane in which a command has exited" && return + local -a args + args=( + '-k[kill window if it is in use]' + '-t[choose target pane]:window:__tmux-pane' + '*::command:_command' + ) + _arguments ${args} +} + function _tmux-respawn-window() { [[ -n ${tmux_describe} ]] && print "Reuse a window in which a command has exited" && return local -a args @@ -1123,6 +1185,20 @@ function _tmux-up-pane() { _arguments ${args} } +function _tmux-wait-for() { + [[ -n ${tmux_describe} ]] && print "Wait for an event or trigger it" && return + local state + local -a args + args=( + '-L[lock the named channel]' + '-S[send signal to channel]' + '-U[unlock the named channel]' + '*:: :->channel' + ) + _arguments ${args} && return + __tmux-lastarg ${state} 'channel' 1 "event channel" +} + # --- Utility functions --- # They should be called __tmux-*() and kept seperate from the # sub-command functions. -- cgit v1.2.3 From 75530dc965c25b1469b74cbd55224b09602e4120 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:24 +0200 Subject: 36063: _tmux: Remove dead code --- ChangeLog | 2 ++ Completion/Unix/Command/_tmux | 12 ------------ 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index a6fd0070d..e24165ed4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ * 36062: Completion/Unix/Command/_tmux: _tmux: Add support for new sub-commands + * 36063: Completion/Unix/Command/_tmux: _tmux: Remove dead code + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 92c919068..a6e5e4a59 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1231,18 +1231,6 @@ function __tmux-bound-keys() { _describe -t keys 'keys' keys } -function __tmux-choose-stuff() { - # choose-{client,session,window} accept exactly the same arguments, so... - local curcontext="${curcontext}" state - local -a args - args=( - '-t[choose a target pane]:panes:__tmux-panes' - '*:: :->tmpl' - ) - _arguments ${args} && return - __tmux-lastarg ${state} 'tmpl' 1 "tmux command template" -} - function __tmux-clients() { local expl local -a clients -- cgit v1.2.3 From ab234991b7fadbf04bae3158c714c3105439e644 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:25 +0200 Subject: 36050: _tmux: Don't unset, set empty in local scope --- 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 e24165ed4..4433f5bc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,9 @@ * 36063: Completion/Unix/Command/_tmux: _tmux: Remove dead code + * 36050: Completion/Unix/Command/_tmux: _tmux: Don't unset, set + empty in local scope + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index a6e5e4a59..91d74b8e4 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1606,7 +1606,7 @@ function _tmux() { local mode state ret=1 local -a args local -x tmuxcommand - unset tmux_describe + local tmux_describe= args=( '-2[force using 256 colours]' -- cgit v1.2.3 From ca53f8a7ca796f321ecfd631f9809aa69ca53cc5 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:26 +0200 Subject: 36058: _tmux: No need to unset local variables --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 4433f5bc9..8518a08b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,9 @@ * 36050: Completion/Unix/Command/_tmux: _tmux: Don't unset, set empty in local scope + * 36058: Completion/Unix/Command/_tmux: _tmux: No need to unset + local variables + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 91d74b8e4..a59ffde1c 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1675,6 +1675,5 @@ for f in ${(M)${(k)functions}:#_tmux-*} ; do _tmux_commands+=( "${f#_tmux-}${desc:+:$desc}" ) [[ -n ${rev[${f#_tmux-}]} ]] && _tmux_aliases+=( "${rev[${f#_tmux-}]}${desc:+:$desc}" ) done -unset desc f rev tmux_describe _tmux -- cgit v1.2.3 From c7c15410b56fc13fa0bb26e5ffc8c0614a90580b Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:27 +0200 Subject: 36057: _tmux: Replay all arguments when dispatching to new _tmux() --- 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 8518a08b8..5aeccb4f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,9 @@ * 36058: Completion/Unix/Command/_tmux: _tmux: No need to unset local variables + * 36057: Completion/Unix/Command/_tmux: _tmux: Replay all + arguments when dispatching to new _tmux() + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index a59ffde1c..2eaf0cd0d 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1676,4 +1676,4 @@ for f in ${(M)${(k)functions}:#_tmux-*} ; do [[ -n ${rev[${f#_tmux-}]} ]] && _tmux_aliases+=( "${rev[${f#_tmux-}]}${desc:+:$desc}" ) done -_tmux +_tmux "$@" -- cgit v1.2.3 From ad7ef9cf1fb4284ece5176a3e83a930f139f3ea1 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:28 +0200 Subject: 36054: _tmux: "local -x" serves no purpose --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 5aeccb4f8..20d0fea3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,9 @@ * 36057: Completion/Unix/Command/_tmux: _tmux: Replay all arguments when dispatching to new _tmux() + * 36054: Completion/Unix/Command/_tmux: _tmux: "local -x" serves + no purpose + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 2eaf0cd0d..76dce0644 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1605,7 +1605,7 @@ function _tmux() { local curcontext="${curcontext}" local mode state ret=1 local -a args - local -x tmuxcommand + local tmuxcommand local tmux_describe= args=( @@ -1665,7 +1665,7 @@ function _tmux() { # description generation follows; only done on 1st _tmux call. local f desc local -A rev -local -x tmux_describe +local tmux_describe tmux_describe='yes, please' for f in ${(k)_tmux_aliasmap} ; do rev+=( ${_tmux_aliasmap[$f]} $f ) -- cgit v1.2.3 From 1afcae59e621534d5a4cabbdcc5f1f7f6ee4b84c Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:29 +0200 Subject: 36049: _tmux: options => session_options --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 20d0fea3f..705ab5b54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,9 @@ * 36054: Completion/Unix/Command/_tmux: _tmux: "local -x" serves no purpose + * 36049: Completion/Unix/Command/_tmux: _tmux: options => + session_options + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 76dce0644..18cbe27b7 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1423,9 +1423,9 @@ function __tmux-option-guard() { esac } -function __tmux-options() { - local -a tmux_options - tmux_options=( +function __tmux-session-options() { + local -a tmux_session_options + tmux_session_options=( 'base-index:define where to start numbering' 'bell-action:set action on window bell' 'buffer-limit:number of buffers kept per session' @@ -1479,7 +1479,7 @@ function __tmux-options() { 'visual-bell:use visual bell instead of audible' 'visual-content:display status line messages upon content changes' ) - _describe -t tmux-options 'tmux option' tmux_options + _describe -t tmux-options 'tmux session option' tmux_session_options } function __tmux-options-complete() { @@ -1488,7 +1488,7 @@ function __tmux-options-complete() { case ${state} in name_or_value) if (( CURRENT == 1 )) && [[ ${mode} == 'session' ]]; then - __tmux-options + __tmux-session-options elif (( CURRENT == 1 )) && [[ ${mode} == 'server' ]]; then __tmux-server-options elif (( CURRENT == 1 )) && [[ ${mode} == 'window' ]]; then -- cgit v1.2.3 From 61ba1a92fdec7d8bfd76aa3a27e7a7e67ada2eab Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:31 +0200 Subject: 36052: _tmux: Remove old sub-commands and their aliases --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 59 ------------------------------------------- 2 files changed, 3 insertions(+), 59 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 474d210ff..977370a2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,9 @@ * 36056: Util/check-tmux-state: Add helper script to check state of _tmux completion + * 36052: Completion/Unix/Command/_tmux: _tmux: Remove old + sub-commands and their aliases + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 18cbe27b7..55f6144a0 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -74,7 +74,6 @@ _tmux_aliasmap=( breakp break-pane capturep capture-pane displayp display-panes - downp down-pane findw find-window joinp join-pane killp kill-pane @@ -103,7 +102,6 @@ _tmux_aliasmap=( swapp swap-pane swapw swap-window unlinkw unlink-window - upp up-pane # key bindings bind bind-key @@ -127,7 +125,6 @@ _tmux_aliasmap=( # buffers clearhist clear-history - copyb copy-buffer deleteb delete-buffer lsb list-buffers loadb load-buffer @@ -340,41 +337,6 @@ function _tmux-confirm-before() { __tmux-lastarg ${state} 'command_and_args' 1 "command string" } -function _tmux-copy-buffer() { - [[ -n ${tmux_describe} ]] && print "Copy session paste buffers" && return - local state session - local -a args - local -ax bopts - - args=( - '-a[choose a source buffer index]:buffer:->srcbuf' - '-b[choose a destination buffer index]:buffer:->dstbuf' - '-s[choose a source session]:session:->srcsession' - '-t[choose a destination session]:session:->dstsession' - ) - _arguments ${args} - - case ${state} in - ((src|dst)session) - __tmux-sessions - return - ;; - (srcbuf) - session="$(__tmux-get-optarg -s "${words[@]}")" - ;; - (srcbuf) - session="$(__tmux-get-optarg -t "${words[@]}")" - ;; - esac - if [[ -n ${session} ]]; then - bopts=( -t ${session} ) - __tmux-buffers - return - fi - bopts=() - __tmux-buffers -} - function _tmux-copy-mode() { [[ -n ${tmux_describe} ]] && print "Enter copy mode" && return local -a args @@ -424,13 +386,6 @@ function _tmux-display-panes() { _arguments ${args} } -function _tmux-down-pane() { - [[ -n ${tmux_describe} ]] && print "Move down a pane" && return - local -a args - args=('-t[choose a target pane]:panes:__tmux-panes') - _arguments ${args} -} - function _tmux-find-window() { [[ -n ${tmux_describe} ]] && print "Search for a pattern in windows" && return local curcontext="${curcontext}" state @@ -893,13 +848,6 @@ function _tmux-select-pane() { _arguments ${args} && return } -function _tmux-select-prompt() { - [[ -n ${tmux_describe} ]] && print "Open a prompt to enter a window index" && return - local -a args - args=('-t[choose a target client]:clients:__tmux-clients') - _arguments ${args} && return -} - function _tmux-select-window() { [[ -n ${tmux_describe} ]] && print "Select a window" && return local -a args @@ -1178,13 +1126,6 @@ function _tmux-unlink-window() { _arguments ${args} } -function _tmux-up-pane() { - [[ -n ${tmux_describe} ]] && print "Move up a pane" && return - local -a args - args=('-t[choose a target pane]:panes:__tmux-panes') - _arguments ${args} -} - function _tmux-wait-for() { [[ -n ${tmux_describe} ]] && print "Wait for an event or trigger it" && return local state -- cgit v1.2.3 From 761044e5c45bbe353705e79dededc3b5a30f0de7 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:32 +0200 Subject: 36064: _tmux: Add new command aliases --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 3 +++ 2 files changed, 6 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 977370a2d..8432b3e45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -32,6 +32,9 @@ * 36052: Completion/Unix/Command/_tmux: _tmux: Remove old sub-commands and their aliases + * 36064: Completion/Unix/Command/_tmux: _tmux: Add new command + aliases + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 55f6144a0..ce15e916b 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -58,6 +58,8 @@ _tmux_aliasmap=( attach attach-session detach detach-client has has-session + lockc lock-client + locks lock-session lsc list-clients lscm list-commands ls list-sessions @@ -90,6 +92,7 @@ _tmux_aliasmap=( next next-window pipep pipe-pane prev previous-window + prevl previous-layout renamew rename-window resizep resize-pane respawnp respawn-pane -- cgit v1.2.3 From 4dbc1af529dc5b60e3869d0aebb96e7036f41d6b Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:33 +0200 Subject: 36047: _tmux: Fix options with changed scope --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 8432b3e45..061e954e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,9 @@ * 36064: Completion/Unix/Command/_tmux: _tmux: Add new command aliases + * 36047: Completion/Unix/Command/_tmux: _tmux: Fix options with + changed scope + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index ce15e916b..70a9f262b 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1256,11 +1256,9 @@ function __tmux-option-guard() { options=( 'base-index:'${int_guard} 'bell-action:DESC:any none current' - 'buffer-limit:'${int_guard} 'default-command:MSG:command string' 'default-path:MSG:path name' 'default-shell:MSG:shell executable' - 'default-terminal:MSG:terminal string' 'display-panes-colour:__tmux-colours' 'display-panes-active-colour:__tmux-colours' 'display-panes-time:'${int_guard} @@ -1272,7 +1270,6 @@ function __tmux-option-guard() { 'message-attr:__tmux-attributes' 'message-bg:__tmux-colours' 'message-fg:__tmux-colours' - 'message-limit:'${int_guard} 'mouse-select-pane:DESC:on off' 'pane-border-bg:__tmux-colours' 'pane-border-fg:__tmux-colours' @@ -1301,7 +1298,6 @@ function __tmux-option-guard() { 'status-right-fg:__tmux-colours' 'status-right-length:'${int_guard} 'status-utf8:DESC:on off' - 'terminal-overrides:MSG:overrides string' 'update-environment:MSG:string listing env. variables' 'visual-activity:DESC:on off' 'visual-bell:DESC:on off' @@ -1309,8 +1305,12 @@ function __tmux-option-guard() { ) elif [[ ${mode} == 'server' ]]; then options=( + 'buffer-limit:'${int_guard} + 'default-terminal:MSG:terminal string' 'escape-time:'${int_guard} + 'message-limit:'${int_guard} 'quiet:DESC:on off' + 'terminal-overrides:MSG:overrides string' ) else options=( @@ -1372,11 +1372,9 @@ function __tmux-session-options() { tmux_session_options=( 'base-index:define where to start numbering' 'bell-action:set action on window bell' - 'buffer-limit:number of buffers kept per session' 'default-command:default command for new windows' 'default-path:default working directory' 'default-shell:default shell executable' - 'default-terminal:default terminal definition string' 'display-panes-colour:colour used for display-panes' 'display-panes-active-colour:colour for active pane in display-panes' 'display-panes-time:time (in msecs) of display-panes output' @@ -1388,7 +1386,6 @@ function __tmux-session-options() { 'message-attr:set status line message attributes' 'message-bg:set status line message background colour' 'message-fg:set status line message foreground colour' - 'message-limit:set size of message log per client' 'mouse-select-pane:make mouse clicks select window panes' 'pane-border-bg:set pane border foreground colour' 'pane-border-fg:set pane border background colour' @@ -1417,7 +1414,6 @@ function __tmux-session-options() { 'status-right-fg:foreground colour of the right part of the status bar' 'status-right-length:maximum length of the right part of the status bar' 'status-utf8:assume UTF-8 sequences to appear in status bar' - 'terminal-overrides:override terminal descriptions' 'update-environment:list of variables to be copied to a session'\''s environment' 'visual-activity:display status line messages upon activity' 'visual-bell:use visual bell instead of audible' @@ -1470,8 +1466,12 @@ function __tmux-panes() { function __tmux-server-options() { local -a tmux_server_options tmux_server_options=( + 'buffer-limit:number of buffers kept per session' + 'default-terminal:default terminal definition string' 'escape-time:set timeout to detect single escape characters (in msecs)' + 'message-limit:set size of message log per client' 'quiet:enable/disable the display of various informational messages' + 'terminal-overrides:override terminal descriptions' ) _describe -t tmux-server-options 'tmux server option' tmux_server_options } -- cgit v1.2.3 From 333df34d7bb6a16a5374daaba3290cb290ba7853 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:34 +0200 Subject: 36051: _tmux: Remove support for old options --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 60 ------------------------------------------- 2 files changed, 3 insertions(+), 60 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 061e954e2..db11451c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -38,6 +38,9 @@ * 36047: Completion/Unix/Command/_tmux: _tmux: Fix options with changed scope + * 36051: Completion/Unix/Command/_tmux: _tmux: Remove support for + old options + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 70a9f262b..517342e47 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1257,7 +1257,6 @@ function __tmux-option-guard() { 'base-index:'${int_guard} 'bell-action:DESC:any none current' 'default-command:MSG:command string' - 'default-path:MSG:path name' 'default-shell:MSG:shell executable' 'display-panes-colour:__tmux-colours' 'display-panes-active-colour:__tmux-colours' @@ -1267,41 +1266,23 @@ function __tmux-option-guard() { 'lock-after-time:'${int_guard} 'lock-command:MSG:command string' 'lock-server:DESC:on off' - 'message-attr:__tmux-attributes' - 'message-bg:__tmux-colours' - 'message-fg:__tmux-colours' - 'mouse-select-pane:DESC:on off' - 'pane-border-bg:__tmux-colours' - 'pane-border-fg:__tmux-colours' - 'pane-active-border-bg:__tmux-colours' - 'pane-active-border-fg:__tmux-colours' 'prefix:MSG:comma-seperated key list' 'repeat-time:'${int_guard} 'set-remain-on-exit:DESC:on off' 'set-titles:DESC:on off' 'set-titles-string:MSG:title format string' 'status:DESC:on off' - 'status-attr:__tmux-attributes' - 'status-bg:__tmux-colours' - 'status-fg:__tmux-colours' 'status-interval:'${int_guard} 'status-justify:DESC:left centre right' 'status-keys:DESC:vi emacs' 'status-left:MSG:format string' - 'status-left-attr:__tmux-attributes' - 'status-left-bg:__tmux-colours' - 'status-left-fg:__tmux-colours' 'status-left-length:'${int_guard} 'status-right:MSG:format string' - 'status-right-attr:__tmux-attributes' - 'status-right-bg:__tmux-colours' - 'status-right-fg:__tmux-colours' 'status-right-length:'${int_guard} 'status-utf8:DESC:on off' 'update-environment:MSG:string listing env. variables' 'visual-activity:DESC:on off' 'visual-bell:DESC:on off' - 'visual-content:DESC:on off' ) elif [[ ${mode} == 'server' ]]; then options=( @@ -1323,23 +1304,12 @@ function __tmux-option-guard() { 'force-width:'${int_guard} 'main-pane-height:'${int_guard} 'main-pane-width:'${int_guard} - 'mode-attr:__tmux-attributes' - 'mode-bg:__tmux-colours' - 'mode-fg:__tmux-colours' 'mode-keys:DESC:vi emacs' - 'mode-mouse:DESC:on off' 'monitor-activity:DESC:on off' - 'monitor-content:MSG:fnmatch(3) pattern' 'remain-on-exit:DESC:on off' 'synchronize-panes:DESC:on off' 'utf8:DESC:on off' - 'window-status-attr:__tmux-attributes' - 'window-status-bg:__tmux-colours' - 'window-status-current-attr:__tmux-attributes' - 'window-status-current-bg:__tmux-colours' - 'window-status-current-fg:__tmux-colours' 'window-status-current-format:MSG:status format string' - 'window-status-fg:__tmux-colours' 'window-status-format:MSG:status format string' 'xterm-keys:DESC:on off' ) @@ -1373,7 +1343,6 @@ function __tmux-session-options() { 'base-index:define where to start numbering' 'bell-action:set action on window bell' 'default-command:default command for new windows' - 'default-path:default working directory' 'default-shell:default shell executable' 'display-panes-colour:colour used for display-panes' 'display-panes-active-colour:colour for active pane in display-panes' @@ -1383,41 +1352,23 @@ function __tmux-session-options() { '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-attr:set status line message attributes' - 'message-bg:set status line message background colour' - 'message-fg:set status line message foreground colour' - 'mouse-select-pane:make mouse clicks select window panes' - 'pane-border-bg:set pane border foreground colour' - 'pane-border-fg:set pane border background colour' - 'pane-active-border-bg:set active pane border foreground colour' - 'pane-active-border-fg:set active pane border background colour' 'prefix:comma seperated line of keys accepted as prefix key' 'repeat-time:time for multiple commands without prefix-key presses' 'set-remain-on-exit:set remain-on-exit window option' 'set-titles:try to set xterm window titles' 'set-titles-string:format used by set-titles' 'status:show or hide the status bar' - 'status-attr:status bar attributes' - 'status-bg:status bar background colour' - 'status-fg:status bar foreground colour' 'status-interval:interval (in seconds) for status bar updates' 'status-justify:position of the window list in status bar' 'status-keys:mode to use in status bar modes (vi/emacs)' 'status-left:format to use left in status bar' - 'status-left-attr:attribute for the left part of the status bar' - 'status-left-bg:background colour of the left part of the status bar' - 'status-left-fg:foreground colour of the left part of the status bar' 'status-left-length:maximum length of the left part of the status bar' 'status-right:format to use right in status bar' - 'status-right-attr:attribute for the right part of the status bar' - 'status-right-bg:background colour of the right part of the status bar' - 'status-right-fg:foreground colour of the right part of the status bar' 'status-right-length:maximum length of the right part of the status bar' 'status-utf8:assume UTF-8 sequences to appear in status bar' 'update-environment:list of variables to be copied to a session'\''s environment' 'visual-activity:display status line messages upon activity' 'visual-bell:use visual bell instead of audible' - 'visual-content:display status line messages upon content changes' ) _describe -t tmux-options 'tmux session option' tmux_session_options } @@ -1504,23 +1455,12 @@ function __tmux-window-options() { 'force-width:force a windows to a certain width' 'main-pane-height:set height for main-* layouts' 'main-pane-width:set width for main-* layouts' - 'mode-attr:set window modes attributes' - 'mode-bg:set window modes background colour' - 'mode-fg:set window modes foreground colour' 'mode-keys:mode to use in copy and choice modes (vi/emacs)' - 'mode-mouse:use mouse in modes' 'monitor-activity:monitor window activity' - 'monitor-content:monitor window contents for a fnmatch(3) pattern' 'remain-on-exit:do not destroy windows after the program exits' 'synchronize-panes:send input to all panes of a window' 'utf8:assume UTF-8 sequences to appear in a window' - 'window-status-attr:set status line attributes for a window' - 'window-status-bg:set status line background for a window' - 'window-status-current-attr:set status line attributes for active window' - 'window-status-current-bg:set status line background for active window' - 'window-status-current-fg:set status line foreground for active window' 'window-status-current-format:set status line format for active window' - 'window-status-fg:set status line foreground for a window' 'window-status-format:set status line format for all but the active window' 'xterm-keys:generate xterm-style function key sequences' ) -- cgit v1.2.3 From 5fc821cbbd7c13d1a26773d61a40a7d0206077be Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:35 +0200 Subject: 36059: _tmux: Add new session options --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index db11451c2..9047eac1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -41,6 +41,9 @@ * 36051: Completion/Unix/Command/_tmux: _tmux: Remove support for old options + * 36059: Completion/Unix/Command/_tmux: _tmux: Add new session + options + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 517342e47..6e8f0fa91 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1254,10 +1254,14 @@ function __tmux-option-guard() { int_guard='_guard "[0-9]#" "'${opt}': numeric value"' if [[ ${mode} == 'session' ]]; then options=( + 'assume-paste-time:'${int_guard} 'base-index:'${int_guard} 'bell-action:DESC:any none current' + 'bell-on-alert:DESC:on off' 'default-command:MSG:command string' 'default-shell:MSG:shell executable' + 'destroy-unattached:DESC:on off' + 'detach-on-destroy:DESC:on off' 'display-panes-colour:__tmux-colours' 'display-panes-active-colour:__tmux-colours' 'display-panes-time:'${int_guard} @@ -1266,7 +1270,13 @@ function __tmux-option-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' + 'mouse-utf8:DESC:on off' 'prefix:MSG:comma-seperated key list' + 'prefix2:MSG:secondary prefix key' + 'renumber-windows:DESC:on off' 'repeat-time:'${int_guard} 'set-remain-on-exit:DESC:on off' 'set-titles:DESC:on off' @@ -1277,12 +1287,18 @@ function __tmux-option-guard() { 'status-keys:DESC:vi emacs' 'status-left:MSG:format string' 'status-left-length:'${int_guard} + 'status-left-style:__tmux-style' + 'status-position:DESC:top bottom' 'status-right:MSG:format string' 'status-right-length:'${int_guard} + 'status-right-style:__tmux-style' + 'status-style:__tmux-style' 'status-utf8:DESC:on off' 'update-environment:MSG:string listing env. variables' 'visual-activity:DESC:on off' 'visual-bell:DESC:on off' + 'visual-silence:DESC:on off' + 'word-separators:MSG:separator string' ) elif [[ ${mode} == 'server' ]]; then options=( @@ -1340,10 +1356,14 @@ function __tmux-option-guard() { function __tmux-session-options() { local -a tmux_session_options tmux_session_options=( + 'assume-paste-time:assume keys are pasted instead of typed if this fast' 'base-index:define where to start numbering' 'bell-action:set action on window bell' + 'bell-on-alert:ring the terminal bell when an alert occurs' 'default-command:default command for new windows' 'default-shell:default shell executable' + 'destroy-unattached:destroy session if no client is attached' + 'detach-on-destroy:detach client if attached session is destroyed' 'display-panes-colour:colour used for display-panes' 'display-panes-active-colour:colour for active pane in display-panes' 'display-panes-time:time (in msecs) of display-panes output' @@ -1352,7 +1372,13 @@ function __tmux-session-options() { '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' + 'mouse-utf8:request utf8 mouse support' 'prefix:comma seperated line of keys accepted as prefix key' + 'prefix2:secondary prefix key' + 'renumber-windows:renumber windows if a window is closed' 'repeat-time:time for multiple commands without prefix-key presses' 'set-remain-on-exit:set remain-on-exit window option' 'set-titles:try to set xterm window titles' @@ -1363,12 +1389,18 @@ function __tmux-session-options() { 'status-keys:mode to use in status bar modes (vi/emacs)' 'status-left:format to use left in status bar' 'status-left-length:maximum length of the left part of the status bar' + 'status-left-style:style of left part of status line' + 'status-position:status line position' 'status-right:format to use right in status bar' 'status-right-length:maximum length of the right part of the status bar' + 'status-right-style:style of right part of status line' + 'status-style:style status line' 'status-utf8:assume UTF-8 sequences to appear in status bar' 'update-environment:list of variables to be copied to a session'\''s environment' 'visual-activity:display status line messages upon activity' 'visual-bell:use visual bell instead of audible' + 'visual-silence:print a message if monitor-silence is on' + 'word-separators:string of characters considered word separators' ) _describe -t tmux-options 'tmux session option' tmux_session_options } @@ -1443,6 +1475,10 @@ function __tmux-socket-name() { _wanted socket expl 'socket name' compadd ${expl} -- ${socks} } +function __tmux-style() { + _message 'not implemented yet' +} + function __tmux-window-options() { local -a tmux_window_options tmux_window_options=( -- cgit v1.2.3 From 5c19edb44b4e282a261ec921eee6f290f19a6753 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:36 +0200 Subject: 36055: _tmux: Add support for new server options --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 8 ++++++++ 2 files changed, 11 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 9047eac1b..69fade9d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -44,6 +44,9 @@ * 36059: Completion/Unix/Command/_tmux: _tmux: Add new session options + * 36055: Completion/Unix/Command/_tmux: _tmux: Add support for new + server options + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 6e8f0fa91..36416b0b9 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1305,8 +1305,12 @@ function __tmux-option-guard() { 'buffer-limit:'${int_guard} 'default-terminal:MSG:terminal string' 'escape-time:'${int_guard} + 'exit-unattached:DESC:on off' + 'focus-events:DESC:on off' + 'history-file:_path-files -g "*(-.)"' 'message-limit:'${int_guard} 'quiet:DESC:on off' + 'set-clipboard:DESC:on off' 'terminal-overrides:MSG:overrides string' ) else @@ -1452,8 +1456,12 @@ function __tmux-server-options() { 'buffer-limit:number of buffers kept per session' 'default-terminal:default terminal definition string' 'escape-time:set timeout to detect single escape characters (in msecs)' + 'exit-unattached:make server exit if it has no attached clients' + 'focus-events:request focus events from terminal' + 'history-file:tmux command history file name' 'message-limit:set size of message log per client' 'quiet:enable/disable the display of various informational messages' + 'set-clipboard:use esc sequences to set terminal clipboard' 'terminal-overrides:override terminal descriptions' ) _describe -t tmux-server-options 'tmux server option' tmux_server_options -- cgit v1.2.3 From e3df5dff863928f233a405ebe0176322ea979658 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:37 +0200 Subject: 36061: _tmux: Add support for new window options --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 69fade9d5..6a879f387 100644 --- a/ChangeLog +++ b/ChangeLog @@ -47,6 +47,9 @@ * 36055: Completion/Unix/Command/_tmux: _tmux: Add support for new server options + * 36061: Completion/Unix/Command/_tmux: _tmux: Add support for new + window options + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 36416b0b9..3b2812530 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1316,8 +1316,10 @@ function __tmux-option-guard() { else options=( 'aggressive-resize:DESC:on off' + 'allow-rename:DESC:on off' 'alternate-screen:DESC:on off' 'automatic-rename:DESC:on off' + 'automatic-rename-format:DESC:__tmux-format' 'clock-mode-colour:__tmux-colours' 'clock-mode-style:DESC:12 24' 'force-height:'${int_guard} @@ -1325,12 +1327,28 @@ function __tmux-option-guard() { 'main-pane-height:'${int_guard} 'main-pane-width:'${int_guard} 'mode-keys:DESC:vi emacs' + 'mode-style:__tmux-style' 'monitor-activity:DESC:on off' + 'monitor-silence:DESC:on off' + 'other-pane-height:'${int_guard} + 'other-pane-width:'${int_guard} + 'pane-active-border-style:__tmux-style' + 'pane-base-index:'${int_guard} + 'pane-border-style:__tmux-style' 'remain-on-exit:DESC:on off' 'synchronize-panes:DESC:on off' 'utf8:DESC:on off' + 'window-active-style:__tmux-style' + 'window-status-activity-style:__tmux-style' + 'window-status-bell-style:__tmux-style' 'window-status-current-format:MSG:status format string' + 'window-status-current-style:__tmux-style' 'window-status-format:MSG:status format string' + 'window-status-last-style:__tmux-style' + 'window-status-separator:MSG:separator string' + 'window-status-style:__tmux-style' + 'window-style:__tmux-style' + 'wrap-seach:DESC:on off' 'xterm-keys:DESC:on off' ) fi @@ -1491,8 +1509,10 @@ function __tmux-window-options() { local -a tmux_window_options tmux_window_options=( 'aggressive-resize:aggressively resize windows' + 'allow-rename:allow programs to change window titles' 'alternate-screen:allow alternate screen feature to be used' 'automatic-rename:attempt to automatically rename windows' + 'automatic-rename-format:format for automatic renames' 'clock-mode-colour:set clock colour' 'clock-mode-style:set clock hour format (12/24)' 'force-height:force a windows to a certain height' @@ -1500,12 +1520,28 @@ function __tmux-window-options() { 'main-pane-height:set height for main-* layouts' 'main-pane-width:set width for main-* layouts' 'mode-keys:mode to use in copy and choice modes (vi/emacs)' + 'mode-style:set window modes style' 'monitor-activity:monitor window activity' + 'monitor-silence:monitor window for inactivity' + 'other-pane-height:height of other panes' + 'other-pane-width:width of other panes' + 'pane-active-border-style:style of border of active pane' + 'pane-base-index:integer at which to start indexing panes' + 'pane-border-style:style of border pane' 'remain-on-exit:do not destroy windows after the program exits' 'synchronize-panes:send input to all panes of a window' 'utf8:assume UTF-8 sequences to appear in a window' + 'window-active-style:style of active window' + 'window-status-activity-style:style of status bar activity tag' + 'window-status-bell-style:style of status bar bell tag' 'window-status-current-format:set status line format for active window' + 'window-status-current-style:style of current window in status bar' 'window-status-format:set status line format for all but the active window' + 'window-status-last-style:style of last window in status bar' + 'window-status-separator:separator drawn between windows in status line' + 'window-status-style:general status bar style' + 'window-style:style of window' + 'wrap-search:search wrap around at the end of a pane' 'xterm-keys:generate xterm-style function key sequences' ) _describe -t tmux-window-options 'tmux window option' tmux_window_options -- cgit v1.2.3 From b6d44f6c638ac9a4b477cd7d977caac8172687cd Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 15:27:38 +0200 Subject: 36060: _tmux: Update TODO --- ChangeLog | 2 ++ Completion/Unix/Command/_tmux | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 6a879f387..b7150af8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -50,6 +50,8 @@ * 36061: Completion/Unix/Command/_tmux: _tmux: Add support for new window options + * 36060: Completion/Unix/Command/_tmux: _tmux: Update TODO + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 3b2812530..d21fe0e99 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -43,10 +43,11 @@ # # TODO: # -# The way options (set/show etc) are handled needs to be reviewed. -# For example, set-option can set every type of option now. I hope -# this is rather simple to improve. Also, there are new options that -# need to be supported. +# - Implement __tmux-format +# - Implement __tmux-style (possibly using existing helpers like +# __tmux-attributes and __tmux-colours) +# - in _tmux-list-panes, use __tmux-windows or __tmux-sessions +# depending on -s is among the sub-commands current command line. # Global variables; setup the first time _tmux is called. # For $_tmux_commands[] generation, see the very end of this file. @@ -201,7 +202,7 @@ function _tmux-break-pane() { local -a args args=( '-d[do not make the new window become the active one]' - '-F[specify format of output]:format:__tmux-format' + '-F[specify format of output]:format:__tmux-format__tmux-format' '-P[print information of new window after it has been created]' '-t[choose a target pane]:panes:__tmux-panes' ) -- cgit v1.2.3 From 5d10851b7369828ca54e1021676d9bfce486c342 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 16:46:12 +0200 Subject: 36070: _tmux: Update bell-action and prefix options --- ChangeLog | 3 +++ Completion/Unix/Command/_tmux | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index b7150af8b..f1da5afa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -52,6 +52,9 @@ * 36060: Completion/Unix/Command/_tmux: _tmux: Update TODO + * 36070: Completion/Unix/Command/_tmux: _tmux: Update bell-action + and prefix options + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index d21fe0e99..ba1c03eef 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1257,7 +1257,7 @@ function __tmux-option-guard() { options=( 'assume-paste-time:'${int_guard} 'base-index:'${int_guard} - 'bell-action:DESC:any none current' + 'bell-action:DESC:any none current other' 'bell-on-alert:DESC:on off' 'default-command:MSG:command string' 'default-shell:MSG:shell executable' @@ -1275,7 +1275,7 @@ function __tmux-option-guard() { 'message-style:__tmux-style' 'mouse:DESC:on off' 'mouse-utf8:DESC:on off' - 'prefix:MSG:comma-seperated key list' + 'prefix:MSG:primary prefix key' 'prefix2:MSG:secondary prefix key' 'renumber-windows:DESC:on off' 'repeat-time:'${int_guard} @@ -1399,7 +1399,7 @@ function __tmux-session-options() { 'message-style:status line message style' 'mouse:enable mouse support' 'mouse-utf8:request utf8 mouse support' - 'prefix:comma seperated line of keys accepted as prefix key' + 'prefix:primary prefix key' 'prefix2:secondary prefix key' 'renumber-windows:renumber windows if a window is closed' 'repeat-time:time for multiple commands without prefix-key presses' -- cgit v1.2.3 From 8d849b9caf6bf9fcc0abbd049d158b88c391e9ac Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 10 Aug 2015 16:46:13 +0200 Subject: 36069: _tmux: Fix \ooo display in completion list --- 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 f1da5afa3..f6e90310f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -55,6 +55,9 @@ * 36070: Completion/Unix/Command/_tmux: _tmux: Update bell-action and prefix options + * 36069: Completion/Unix/Command/_tmux: _tmux: Fix \ooo display in + completion list + 2015-08-10 Peter Stephenson * 36045: Test/A05execution.ztst: make effect of failures diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index ba1c03eef..896fae7cb 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -215,7 +215,7 @@ function _tmux-capture-pane() { args=( '-a[use alternate screen]' '-b[choose target buffer]:target buffer:__tmux-buffers' - '-C[escape non-printable characters as octal \ooo]' + '-C[escape non-printable characters as octal \\ooo]' '-e[include escape sequences for attributes etc]' '-E[specify last line to capture. - means last line of pane]' '-J[join wrapped lines and preserver trailing space]' -- cgit v1.2.3 From 8815500f95aeb7599704877a80a392321f753f43 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 22 Sep 2011 18:13:23 +0200 Subject: 36116: _git: various fixes Add = to git checkout --conflict= completion fix transposed [- git push remote argument is not optional can use shorter syntax for a check --- ChangeLog | 2 ++ Completion/Unix/Command/_git | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 1d3ce244f..77e18c537 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,8 @@ * 36078: Doc/Zsh/contrib.yo: vcs_info: Adjust documentation for no longer exporting + * 36116: Completion/Unix/Command/_git: various fixes + 2015-08-11 Barton E. Schaefer * 36108: NEWS: list of major changes so far since 5.0.8 diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 5b78a2b81..4357b7448 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -132,7 +132,7 @@ _git-archive () { declare -a backend_args - if (( words[(I)--format=*] > 0 && words[(I)--format=*] < CURRENT )); then + if (( words[(b:CURRENT-1:I)--format=*] )); then case ${words[$words[(I)--format=*]]#--format=} in (zip) backend_args=( @@ -442,7 +442,7 @@ _git-checkout () { '(-b -B -t --track --patch --detach)--orphan[create a new orphan branch based at given commit]: :__git_branch_names' \ '--ignore-skip-worktree-bits[ignores patterns and adds back any files in ]' \ '(-q --quiet -f --force -m --merge --conflict --patch)'{-m,--merge}'[3way merge current branch, working tree and new branch]' \ - '(-q --quiet -f --force -m --merge --patch)--conflict[same as --merge, using given merge style]:style:(merge diff3)' \ + '(-q --quiet -f --force -m --merge --patch)--conflict=[same as --merge, using given merge style]:style:(merge diff3)' \ '(-)'{-p,--patch}'[interactively select hunks in diff between given tree-ish and working tree]' \ '(-)--[start file arguments]' \ '*:: :->branch-or-tree-ish-or-file' && ret=0 @@ -1285,7 +1285,7 @@ _git-push () { '(--verify)--no-verify[bybass the pre-push hook]' \ '--recurse-submodules=[submodule handling]:submodule handling:((check\:"refuse pushing of supermodule if submodule commit cannot be found on the remote" on-demand\:"push all changed submodules"))' \ - ':: :__git_any_repositories' \ + ': :__git_any_repositories' \ '*: :__git_ref_specs' && ret=0 case $state in @@ -6356,8 +6356,8 @@ __git_setup_revision_options () { '*--not[reverses meaning of ^ prefix for revisions that follow]' '--all[show all commits from refs]' '--branches=-[show all commits from refs/heads]::pattern' - '--tags=[-show all commits from refs/tags]::pattern' - '--remotes=[-show all commits from refs/remotes]::pattern' + '--tags=-[show all commits from refs/tags]::pattern' + '--remotes=-[show all commits from refs/remotes]::pattern' '--glob=[show all commits from refs matching glob]:pattern' '--exclude=[do not include refs matching glob]:pattern' '--exclude=[do not include refs matching glob]:pattern' -- cgit v1.2.3 From f6c3a2f86a0336ef40d69e6888b70b5b8b2ecfdf Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 10 Jun 2012 05:58:28 +0200 Subject: 36117: _wget: complete headers for --header and add --no-use-server-timestamps --- ChangeLog | 3 +++ Completion/Unix/Command/_wget | 41 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 77e18c537..4a5127ed0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,9 @@ * 36116: Completion/Unix/Command/_git: various fixes + * 36117: Completion/Unix/Command/_wget: complete headers for + --header and add --no-use-server-timestamps + 2015-08-11 Barton E. Schaefer * 36108: NEWS: list of major changes so far since 5.0.8 diff --git a/Completion/Unix/Command/_wget b/Completion/Unix/Command/_wget index b8ca2fd93..b6feab581 100644 --- a/Completion/Unix/Command/_wget +++ b/Completion/Unix/Command/_wget @@ -63,7 +63,7 @@ _arguments -C -s \ '--default-page=[specify default page name, normally index.html]' \ '(--adjust-extension -E)'{--adjust-extension,-E}'[save all HTML/CSS documents with proper extensions]' \ "--ignore-length[ignore \`Content-Length' header field]" \ - '*--header=:string' \ + '*--header=[send a custom HTTP header]:header:->header' \ '--max-redirect=:number' \ '--proxy-user=:user' \ '--proxy-password=:password' \ @@ -132,6 +132,7 @@ _arguments -C -s \ '--no-clobber' \ '--no-directories' \ '--no-host-directories' \ + '--no-use-server-timestamps[do not set timestamp to server provided value]' \ '--htmlify=:htmlify:' \ '--no:no:->noflags' \ '*:URL:_urls' && return 0 @@ -156,4 +157,42 @@ case "$state" in '(unix)windows' \ '(unix windows)nocontrol' ;; + header) + local -a headers + headers=( + Accept{,-{Charset,Encoding,Language,Datetime}} + Authorization + Cache-Control + Connection + Cookie + Content-{Length,MD5,Type} + Date + Expect + From + Host + If-Match + If-Modified-Since + If-None-Match + If-Range + If-Unmodified-Since + Max-Forwards + Pragma + Proxy-Authorization + Range + Referer + TE + Upgrade + User-Agent + Via + Warning + X-Requested-With + X-Do-Not-Track + DNT + X-Forwarded-For + X-ATT-DeviceId + X-Wap-Profile + ) + headers=($^headers\\:\ ) + _describe -t header 'HTTP header' headers + ;; esac -- cgit v1.2.3 From 64725416785a098139cdaca05b552379137a1360 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Tue, 15 Apr 2014 21:34:14 +0200 Subject: 36118: _imagemagick: complete all files if image files didn't match --- ChangeLog | 3 +++ Completion/Unix/Command/_imagemagick | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 4a5127ed0..f4de2b7b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,9 @@ * 36117: Completion/Unix/Command/_wget: complete headers for --header and add --no-use-server-timestamps + * 36118: Completion/Unix/Command/_imagemagick: complete all + files if image files didn't match + 2015-08-11 Barton E. Schaefer * 36108: NEWS: list of major changes so far since 5.0.8 diff --git a/Completion/Unix/Command/_imagemagick b/Completion/Unix/Command/_imagemagick index 115cb01e4..c43086c45 100644 --- a/Completion/Unix/Command/_imagemagick +++ b/Completion/Unix/Command/_imagemagick @@ -14,7 +14,7 @@ typeset -A opt_args formats=jpg:jpeg:jp2:j2k:jpc:jpx:jpf:tiff:miff:ras:bmp:cgm:dcx:ps:eps:fig:fits:fpx:gif:mpeg:pbm:pgm:ppm:pcd:pcl:pdf:pcx:png:rad:rgb:rgba:rle:sgi:html:shtml:tga:ttf:uil:xcf:xwd:xbm:xpm:yuv if (( $# )); then - _files "$@" -g "*.(#i)(${~formats//:/|})(-.)" + _files "$@" -g "*.(#i)(${~formats//:/|})(-.)" || _files "$@" return fi -- cgit v1.2.3 From aa722536ea6b3c2f417360c007db9da8b3adacac Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 26 Jul 2015 23:48:03 +0200 Subject: 36120: _sort: Fix syntax error --- ChangeLog | 2 ++ Completion/Unix/Command/_sort | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index f4de2b7b2..0d1fd009f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,8 @@ * 36118: Completion/Unix/Command/_imagemagick: complete all files if image files didn't match + * 36120: Completion/Unix/Command/_sort: Fix syntax error + 2015-08-11 Barton E. Schaefer * 36108: NEWS: list of major changes so far since 5.0.8 diff --git a/Completion/Unix/Command/_sort b/Completion/Unix/Command/_sort index 2e7f0a01a..1ad57f442 100644 --- a/Completion/Unix/Command/_sort +++ b/Completion/Unix/Command/_sort @@ -55,7 +55,7 @@ case $variant in netbsd*|dragonfly*) args+=( "${ordering}-l[sort by string length of field]" - "(-s)-S[don't use stable sort" + "(-s)-S[don't use stable sort]" ) ;| openbsd*) -- cgit v1.2.3 From cf77e28a3fe46035faf6c1815cb7dbc92207e5f4 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 12 Aug 2015 18:02:57 +0200 Subject: 36127: assorted minor completion function changes --- ChangeLog | 8 ++++++++ Completion/Unix/Command/_clay | 2 +- Completion/Unix/Command/_git | 5 +++-- Completion/Unix/Command/_ifconfig | 2 +- Completion/Unix/Command/_kvno | 3 +-- Completion/Unix/Command/_mh | 7 +++++-- Completion/Unix/Command/_rm | 2 +- Completion/Unix/Command/_ssh | 2 +- Completion/Unix/Command/_stty | 2 +- Completion/Unix/Command/_vim | 2 +- Completion/Unix/Type/_pdf | 2 +- Completion/Zsh/Context/_brace_parameter | 2 +- 12 files changed, 25 insertions(+), 14 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 468ba8f1e..be4874c27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2015-08-12 Oliver Kiddle + * 36127: Completion/Zsh/Context/_brace_parameter, + Completion/Unix/Command/_git, Completion/Unix/Command/_ifconfig, + Completion/Unix/Command/_kvno, Completion/Unix/Command/_mh, + Completion/Unix/Command/_rm, Completion/Unix/Command/_ssh, + Completion/Unix/Command/_stty, Completion/Unix/Command/_vim, + Completion/Unix/Type/_pdf, Completion/Unix/Command/_clay: + assorted minor completion function changes + * 36125: Src/Zle/zle_hist.c: don't set history context in get-line * 35834 (tweaked): Src/Zle/zle_misc.c: strip a final newline from diff --git a/Completion/Unix/Command/_clay b/Completion/Unix/Command/_clay index 71f05bf64..581338b8b 100644 --- a/Completion/Unix/Command/_clay +++ b/Completion/Unix/Command/_clay @@ -38,5 +38,5 @@ _arguments -C \ "-e:compile and run (implies -run)" \ "-M-:import .*; for -e" \ "-v[display version info]" \ - ":program file:_files -g '*.clay'" + ":program file:_files -g '*.clay(-.)'" diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 4357b7448..a5e44641b 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5188,7 +5188,7 @@ _git_commands () { local -a aliases __git_extract_aliases local cmdtype len dup sep - local -a allcmds allmatching alts disp + local -a allcmds allmatching alts disp expl zstyle -s ":completion:${curcontext}:" list-separator sep || sep=-- for cmdtype in $cmdtypes aliases; do @@ -5202,7 +5202,8 @@ _git_commands () { allcmds+=( ${(P)${:-${cmdtype}_m}} ) done zstyle -T ":completion:${curcontext}:" verbose && disp=(-ld '${cmdtype}_d') - compadd -O allmatching -a allcmds + _description '' expl '' # get applicable matchers + compadd "$expl[@]" -O allmatching -a allcmds len=${#${(O)allmatching//?/.}[1]} # length of longest match for cmdtype in aliases $cmdtypes; do local -a ${cmdtype}_d diff --git a/Completion/Unix/Command/_ifconfig b/Completion/Unix/Command/_ifconfig index 49b018841..0c81bce10 100644 --- a/Completion/Unix/Command/_ifconfig +++ b/Completion/Unix/Command/_ifconfig @@ -65,7 +65,7 @@ esac _arguments -C "$args[@]" \ '-a[apply to all interfaces]' \ - '1:network interface:_net_interfaces' \ + '1:network interface:_net_interfaces -r ": \t\n\-"' \ '::address family:(atalk ether inet inet6 ax25 ddp ipx netrom)' \ '*:option:->options' && ret=0 diff --git a/Completion/Unix/Command/_kvno b/Completion/Unix/Command/_kvno index 285aab3c8..782d9e6fc 100644 --- a/Completion/Unix/Command/_kvno +++ b/Completion/Unix/Command/_kvno @@ -11,8 +11,7 @@ _arguments -C \ ':principal:->principal' && ret=0 if [[ $state = principal ]]; then - if [[ -prefix host/ ]]; then - compset -P host/ + if compset -P host/; then _hosts && ret=0 else _alternative \ diff --git a/Completion/Unix/Command/_mh b/Completion/Unix/Command/_mh index 48177982e..3eddd41a6 100644 --- a/Completion/Unix/Command/_mh +++ b/Completion/Unix/Command/_mh @@ -1,4 +1,4 @@ -#compdef ali anno burst comp dist flist flists folder folders forw inc mark mhlist mhmail mhn mhparam mhpath mhshow mhstore msgchk next packf pick prev refile repl rmf rmm scan show sortm whom +#compdef ali anno burst comp dist flist flists fmttest folder folders forw fnext fprev inc mark mhfixmsg mhlist mhmail mhn mhparam mhpath mhshow mhstore msgchk new next packf pick prev refile repl rmf rmm scan show sortm whom if [[ -z $commands[mhpath] ]]; then _message "MH commands are not available" @@ -73,7 +73,9 @@ elif [[ $service = mhparam ]]; then elif [[ $service = ali ]]; then _email_addresses -n MH elif compset -P '*:'; then - _message -e number 'number of messages' + _alternative \ + 'sequences:sub-sequence:(first last cur prev next)' + 'number: : _message -e number "number of messages"' else # Generate sequences. local foldnam folddir f sequences mhneg ret=1 @@ -95,6 +97,7 @@ else sequences=( ${${(f)"$(mark $foldnam 2>/dev/null)"}%%:*} ) mhneg="$(mhparam Sequence-Negation)" && sequences=( {,$mhneg}$^sequences ) sequences+=( all first last prev next ) + [[ $service = mhpath ]] && sequences+=( new ) _tags sequences while _tags; do while _next_label sequences expl sequence; do diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm index 4728ad464..4d0dbdb3f 100644 --- a/Completion/Unix/Command/_rm +++ b/Completion/Unix/Command/_rm @@ -40,7 +40,7 @@ fi local curcontext=$curcontext state line ret=1 declare -A opt_args -_arguments -C $opts \ +_arguments -C -s $opts \ $args && ret=0 case $state in diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index b7b7e41dc..c2514a1a7 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -105,7 +105,7 @@ _ssh () { ;; ssh-keygen) cmds=( -p -i -e -y -c -l -B -D -U ) - _arguments \ + _arguments -s \ '-q[silence ssh-keygen]' \ "($cmds -P)-b[specify number of bits in key]:bits in key" \ "($cmds -P)-t[specify the type of the key to create]:key type:(rsa1 rsa dsa ecdsa ed25519)" \ diff --git a/Completion/Unix/Command/_stty b/Completion/Unix/Command/_stty index f40cd856e..b5545ebcd 100644 --- a/Completion/Unix/Command/_stty +++ b/Completion/Unix/Command/_stty @@ -14,5 +14,5 @@ else parmrk inpck istrip inlcr igncr icrnl iuclc ixon ixany ixoff \ imaxbel isig icanon xcase echo echoe echok echonl noflsh \ tostop echoctl echoprt echoke flusho pending iexten opost \ - olcuc onlcr ocrnl onocr onlret ofill ofdel + olcuc onlcr ocrnl onocr onlret ofill ofdel raw sane fi diff --git a/Completion/Unix/Command/_vim b/Completion/Unix/Command/_vim index 007671be8..dbc946cb1 100644 --- a/Completion/Unix/Command/_vim +++ b/Completion/Unix/Command/_vim @@ -1,4 +1,4 @@ -#compdef vim exim gvim gex gview nvim rvim rview rgvim rgview evim eview vimdiff gvimdiff +#compdef vim gvim gex gview nvim rvim rview rgvim rgview evim eview vimdiff gvimdiff (( $+functions[_vim_files] )) || _vim_files () { diff --git a/Completion/Unix/Type/_pdf b/Completion/Unix/Type/_pdf index 60cee84ee..5fda42a12 100644 --- a/Completion/Unix/Type/_pdf +++ b/Completion/Unix/Type/_pdf @@ -1,4 +1,4 @@ -#compdef pdf2dsc pdf2ps pdfimages pdfinfo pdftopbm pdftops pdftotext pdfopt pdffonts kpdf apvlv epdfview +#compdef pdf2dsc pdf2ps pdfimages pdfinfo pdftopbm pdftops pdftotext pdfopt pdffonts kpdf apvlv epdfview mupdf local expl ext='' diff --git a/Completion/Zsh/Context/_brace_parameter b/Completion/Zsh/Context/_brace_parameter index 4097895ee..9eb3465ae 100644 --- a/Completion/Zsh/Context/_brace_parameter +++ b/Completion/Zsh/Context/_brace_parameter @@ -152,7 +152,7 @@ if [[ $PREFIX = *'${('[^\)]# ]]; then "F:join arrays with newlines" "g:process echo array sequences (needs options)" "i:sort case-insensitively" - "k:subsitute keys of associative arrays" + "k:substitute keys of associative arrays" "L:lower case all letters" "n:sort decimal integers numerically" "o:sort in ascending order (lexically if no other sort option)" -- cgit v1.2.3 From 8e0b5e0e009271a7a9fc371e7278e9d9de22cfb3 Mon Sep 17 00:00:00 2001 From: Wieland Hoffmann Date: Thu, 13 Aug 2015 15:53:12 +0200 Subject: Wieland Hoffmann: 36123: protect against word splitting in __git_is_committish_range --- 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 c7444164b..1c847dbbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-08-13 Oliver Kiddle + + * Wieland Hoffmann: 36123: Completion/Unix/Command/_git: + protect against word splitting in __git_is_committish_range + 2015-08-12 Peter Stephenson * Kamil Dudka: 36106: Src/Zle/zle_keymap.c: fix const parameter. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index a5e44641b..92db67928 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -4973,8 +4973,8 @@ __git_is_treeish () { (( $+functions[__git_is_committish_range] )) || __git_is_committish_range () { [[ $1 == *..(.|)* ]] || return 1 - local first=$(__git_committish_range_first $1) - local last=$(__git_committish_range_last $1) + local first="$(__git_committish_range_first $1)" + local last="$(__git_committish_range_last $1)" [[ $first != *..* && $last != *..* ]] && \ __git_is_committish $first && \ __git_is_committish $last -- cgit v1.2.3 From 422dae7b1c71033113eb7e9bdd655b07858f71d8 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 11 Aug 2015 22:14:00 +0000 Subject: unposted: _subversion: Complete property names for propdel Previously, filenames would be completed. --- ChangeLog | 5 +++++ Completion/Unix/Command/_subversion | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index dfe254a21..6c0151992 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-08-13 Daniel Shahaf + + * unposted: Completion/Unix/Command/_subversion: _subversion: + Complete property names for propdel + 2015-08-13 Oliver Kiddle * 36131: Functions/Zle/narrow-to-region, Src/Zle/zle_utils.c: diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index 188a81367..8c3d8746f 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -98,7 +98,7 @@ _svn () { (mergeinfo) args[(r)--show-revs:arg:]=( '--show-revs=:revisions:(merged eligible)' ) ;; - (propget|propedit) + (propget|propedit|propdel) args+=( '1:property name:_svn_props' '2:target: _alternative "files:file:_files" "urls:URL:_svn_urls"' -- cgit v1.2.3 From 5f8a18a561ef83857b2cafdc6eaa19bad254fe89 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 14 Aug 2015 02:35:32 +0200 Subject: unposted: fix minor typos --- Completion/Unix/Command/_tmux | 2 +- Src/Zle/zle_misc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index 896fae7cb..49c2b63ed 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -1577,7 +1577,7 @@ function _tmux() { '-2[force using 256 colours]' '-8[force using 88 colours]' '-c[execute a shell command]:command name:_command_names' - '-C[start tmux in contol mode. -CC disables echo]' + '-C[start tmux in control mode. -CC disables echo]' '-f[specify configuration file]:tmux config file:_files -g "*(-.)"' '-l[behave like a login shell]' '-L[specify socket name]:socket name:__tmux-socket-name' diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c index 6f58af626..62fb8c86f 100644 --- a/Src/Zle/zle_misc.c +++ b/Src/Zle/zle_misc.c @@ -787,8 +787,8 @@ bracketedpaste(char **args) zmult = 1; if (region_active) killregion(zlenoargs); - /* chop a final newline if it's insertion would be hard to - * distinguish by the user from the line being accepted */ + /* Chop a final newline if its insertion would be hard to + * distinguish by the user from the line being accepted. */ else if (n > 1 && zlecontext != ZLCON_VARED && (zlecs + (insmode ? 0 : n - 1)) >= zlell && wpaste[n-1] == ZWC('\n')) -- cgit v1.2.3 From 019dbbf1663a25b257cbc8ab646de2bdc83d6b3a Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 15 Aug 2015 00:15:00 +0200 Subject: Revert 36118 This works already except if list-dirs-first is set, and that is being fixed separately. --- ChangeLog | 3 --- Completion/Unix/Command/_imagemagick | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index f7c734279..abba0622c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -63,9 +63,6 @@ * 36117: Completion/Unix/Command/_wget: complete headers for --header and add --no-use-server-timestamps - * 36118: Completion/Unix/Command/_imagemagick: complete all - files if image files didn't match - * 36120: Completion/Unix/Command/_sort: Fix syntax error * 36119: Completion/Zsh/Command/_strftime: Add completion for diff --git a/Completion/Unix/Command/_imagemagick b/Completion/Unix/Command/_imagemagick index c43086c45..115cb01e4 100644 --- a/Completion/Unix/Command/_imagemagick +++ b/Completion/Unix/Command/_imagemagick @@ -14,7 +14,7 @@ typeset -A opt_args formats=jpg:jpeg:jp2:j2k:jpc:jpx:jpf:tiff:miff:ras:bmp:cgm:dcx:ps:eps:fig:fits:fpx:gif:mpeg:pbm:pgm:ppm:pcd:pcl:pdf:pcx:png:rad:rgb:rgba:rle:sgi:html:shtml:tga:ttf:uil:xcf:xwd:xbm:xpm:yuv if (( $# )); then - _files "$@" -g "*.(#i)(${~formats//:/|})(-.)" || _files "$@" + _files "$@" -g "*.(#i)(${~formats//:/|})(-.)" return fi -- cgit v1.2.3 From 0204f5e17fd5a3e2448bcacb446bd11a497f63e2 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 15 Aug 2015 00:43:06 +0200 Subject: 36091: _ncftp: search XDG_DATA_HOME for bookmarks saved by lftp --- ChangeLog | 5 +++++ Completion/Unix/Command/_ncftp | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index abba0622c..a13e05d08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-08-15 Mikael Magnusson + + * Eric Cook: 36091: Completion/Unix/Command/_ncftp: search + XDG_DATA_HOME for bookmarks saved by lftp + 2015-08-14 Oliver Kiddle * 36146: Completion/Zsh/Type/_command_names, diff --git a/Completion/Unix/Command/_ncftp b/Completion/Unix/Command/_ncftp index 93de404aa..763a61344 100644 --- a/Completion/Unix/Command/_ncftp +++ b/Completion/Unix/Command/_ncftp @@ -1,6 +1,12 @@ #compdef ncftp lftp -local expl bookmarks=$HOME/.$service/bookmarks +local expl bookmarks XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share} + +if [[ $service = lftp ]]; then + bookmarks=$XDG_DATA_HOME/$service/bookmarks +else + bookmarks=$HOME/.$service/bookmarks +fi if [[ -f $bookmarks ]]; then bookmarks=(${"${(f)$(<$bookmarks)}"%%[[:space:],]*}) -- cgit v1.2.3 From a62e96822489d7af35e1463a4de1e82ad823ba84 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 15 Aug 2015 18:52:24 +0200 Subject: 36183: _ssh: update to 7.0 --- ChangeLog | 2 ++ Completion/Unix/Command/_ssh | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index bd5c0d6a0..e354016a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * 36177: Completion/Zsh/Command/_setopt: complete printexitvalue both ways + * 36183: Completion/Unix/Command/_ssh: update to 7.0 + 2015-08-15 Barton E. Schaefer * 36180: Src/jobs.c: avoid infinite job stop/continue loop on diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index c2514a1a7..a66702a65 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -1,6 +1,6 @@ #compdef ssh slogin=ssh scp ssh-add ssh-agent ssh-keygen sftp ssh-copy-id -# Completions currently based on OpenSSH 6.9 (released on 2015-06-30). +# Completions currently based on OpenSSH 7.0 (released on 2015-08-11). # # TODO: update ssh-keygen (not based on 5.9) # TODO: sshd, ssh-keyscan, ssh-keysign @@ -39,8 +39,10 @@ _ssh () { '(-P)-b+[specify interface to transmit on]:bind address:_bind_addresses' \ '-D+[specify a dynamic port forwarding]:dynamic port forwarding:->dynforward' \ '-e+[set escape character]:escape character (or `none'\''):' \ + '-E[append log output to file instead of stderr]:_files' \ '(-n)-f[go to background]' \ '-g[allow remote hosts to connect to local forwarded ports]' \ + '-G[output configuration and exit]' \ '-I+[specify smartcard device]:device:_files' \ '-K[enable GSSAPI-based authentication and forwarding]' \ '-k[disable forwarding of GSSAPI credentials]' \ @@ -56,11 +58,12 @@ _ssh () { '(-v)*-q[quiet operation]' \ '*-R[specify remote port forwarding]:remote port forwarding:->forward' \ '-S+[specify location of control socket for connection sharing]:path to control socket:_files' \ + '-Q[query parameters]:parameter type:((cipher\:"supported symmetric ciphers" cipher-auth\:"supported symmetric ciphers that support authenticated encryption" mac\:"supported message integrity codes" kex\:"key exchange algorithms" key\:"key types" protocol-version\:"supported SSH protocol versions"))' \ '(-1)-s[invoke subsystem]' \ '(-1 -t)-T[disable pseudo-tty allocation (protocol version 2 only)]' \ '(-T)-t[force pseudo-tty allocation]' \ '-V[show version number]' \ - '(-q)*-v[verbose mode]' \ + '(-q)*-v[verbose mode (multiple increase verbosity, up to 3)]' \ '-W[forward standard input and output to host]:stdinout forward:->hostport' \ '-w[request tunnel device forwarding]:local_tun[\:remote_tun] (integer or "any"):' \ '(-x -Y)-X[enable (untrusted) X11 forwarding]' \ @@ -147,7 +150,14 @@ _ssh () { case "$lstate" in option) if compset -P '*='; then - case "$IPREFIX" in + case "${IPREFIX#-o}" in + (#i)(ciphers|macs|kexalgorithms|hostkeyalgorithms|pubkeyacceptedkeytypes|hostbasedkeytypes)=) + if ! compset -P +; then + _wanted append expl 'append to default' compadd + && ret=0 + fi + ;; + esac + case "${IPREFIX#-o}" in (#i)(afstokenpassing|batchmode|canonicalizefallbacklocal|challengeresponseauthentication|checkhostip|clearallforwardings|compression|enablesshkeysign|exitonforwardfailure|fallbacktorsh|forward(agent|x11)|forwardx11trusted|gatewayports|gssapiauthentication|gssapidelegatecredentials|gssapitrustdns|hashknownhosts|hostbasedauthentication|identitiesonly|kbdinteractiveauthentication|(tcp|)keepalive|nohostauthenticationforlocalhost|passwordauthentication|permitlocalcommand|proxyusefdpass|pubkeyauthentication|rhosts(|rsa)authentication|rsaauthentication|streamlocalbindunlink|usersh|kerberos(authentication|tgtpassing)|useprivilegedport|visualhostkey)=*) _wanted values expl 'truth value' compadd yes no && ret=0 ;; @@ -234,7 +244,7 @@ _ssh () { (#i)hostname=*) _wanted hosts expl 'real host name to log into' _ssh_hosts && ret=0 ;; - (#i)(hostbasedkeytypes|hostkeyalgorithms)=*) + (#i)(hostbasedkeytypes|hostkeyalgorithms|pubkeyacceptedkeytypes)=*) _values -s , 'key types' \ 'ecdsa-sha2-nistp256-cert-v01@openssh.com' \ 'ecdsa-sha2-nistp384-cert-v01@openssh.com' \ @@ -450,6 +460,7 @@ _ssh () { Protocol \ ProxyCommand \ ProxyUseFdpass \ + PubkeyAcceptedKeyTypes \ PubkeyAuthentication \ RekeyLimit \ RemoteForward \ -- cgit v1.2.3 From fb063f964937728104865a7dcbe6c1682ef5a99a Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 15 Aug 2015 00:33:20 +0200 Subject: 36172: _imagemagick: Use $formats a bit more correctly --- ChangeLog | 5 +++++ Completion/Unix/Command/_imagemagick | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 83775b12b..857bf1046 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-08-17 Mikael Magnusson + + * 36172: Completion/Unix/Command/_imagemagick: Use $formats a + bit more correctly + 2015-08-17 Barton E. Schaefer * unposted (cf. 36200): Completion/Base/Completer/_expand: back out diff --git a/Completion/Unix/Command/_imagemagick b/Completion/Unix/Command/_imagemagick index 115cb01e4..1fc6089c8 100644 --- a/Completion/Unix/Command/_imagemagick +++ b/Completion/Unix/Command/_imagemagick @@ -1,6 +1,7 @@ #compdef animate composite combine convert display identify import mogrify montage xtp -local state line expl formats curcontext="$curcontext" +local state line expl curcontext="$curcontext" +local -a formats typeset -A opt_args # Things that could be improved: @@ -11,10 +12,10 @@ typeset -A opt_args # # and certainly many other things... -formats=jpg:jpeg:jp2:j2k:jpc:jpx:jpf:tiff:miff:ras:bmp:cgm:dcx:ps:eps:fig:fits:fpx:gif:mpeg:pbm:pgm:ppm:pcd:pcl:pdf:pcx:png:rad:rgb:rgba:rle:sgi:html:shtml:tga:ttf:uil:xcf:xwd:xbm:xpm:yuv +formats=(jpg jpeg jp2 j2k jpc jpx jpf tiff miff ras bmp cgm dcx ps eps fig fits fpx gif mpeg pbm pgm ppm pcd pcl pdf pcx png rad rgb rgba rle sgi html shtml tga ttf uil xcf xwd xbm xpm yuv) if (( $# )); then - _files "$@" -g "*.(#i)(${~formats//:/|})(-.)" + _files "$@" -g "*.(#i)(${(j:|:)formats})(-.)" return fi @@ -444,7 +445,7 @@ case "$service" in '*-filter:filter type for resizing:(Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc)' \ '*-flip[vertical mirror image]' \ '*-flop[horizontal mirror image]' \ - "*-format:output file format:(${formats//:/ })" \ + "*-format:output file format:($formats)" \ '*-font:annotation font:_x_font' \ '*-frame:border dimensions (x++)' \ '*-fuzz:maximum distance for equal colors' \ -- cgit v1.2.3 From 0c5f6e911b6e8e1e2a5be5103a8c2da72bfc8937 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 17 Aug 2015 22:03:56 +0000 Subject: 36208: _subversion: Complete a few more option switches The while (( idx )) form should guarantee that these switches are only added if the 'svn' binary supports them. (One of these switches isn't present in svn 1.8 or earlier.) --- ChangeLog | 5 +++++ Completion/Unix/Command/_subversion | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index aef8e9520..64e2f6d22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-08-19 Daniel Shahaf + + * 36208: Completion/Unix/Command/_subversion: _subversion: + Complete a few more option switches + 2015-08-18 Peter Stephenson * 36232: Src/compat.c: Unmeta an additional chdir(). diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index 8c3d8746f..1cffc3c04 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -50,9 +50,27 @@ _svn () { args=( ${=${${${(M)${(f)"$(_comp_locale; _call_program options svn help $cmd)"#(*Valid options:|(#e))}:#* :*}%% #:*}/ (arg|ARG)/:arg:}/(#b)(-##)([[:alpha:]]##) \[--([a-z-]##)\](:arg:)#/(--$match[3])$match[1]$match[2]$match[4] ($match[1]$match[2])--$match[3]$match[4]} ) + while (( idx=$args[(I)*--accept:arg:] )); do + args[(I)*--accept:arg:]=( --accept':automatic conflict resolution action:((working\:working base\:base '"`for i j in p postpone mc mine-conflict tc theirs-conflict mf mine-full tf theirs-full e edit l launch; print -rn $i\\\\:$j $j\\\\:$j "" `"'))' ) + done while (( idx=$args[(I)*--c(l|hangelist):arg:] )); do args[(I)*--c(l|hangelist):arg:]=( \*{--cl,--changelist}':change list:_svn_changelists' ) done + while (( idx=$args[(I)*--config-dir:arg:] )); do + args[(I)*--config-dir:arg:]=( --config-dir':config dir:_directories' ) + done + while (( idx=$args[(I)*--depth:arg:] )); do + args[(I)*--depth:arg:]=( --depth':operation depth (how far to recurse):(empty files immediates infinity)' ) + done + while (( idx=$args[(I)*(-F|--file):arg:] )); do + args[(I)*(-F|--file):arg:]=( '(-F --file)'{-F,--file}':log message file:_files' ) + done + while (( idx=$args[(I)*--set-depth:arg:] )); do + args[(I)*--set-depth:arg:]=( --set-depth'[make working copy deeper or shallower]:new depth:(exclude empty files immediates infinity)' ) + done + while (( idx=$args[(I)*--trust-server-cert-failures:arg:] )); do + args[(I)*--trust-server-cert-failures:arg:]=( --trust-server-cert-failures':failures:_values -s , "certificate failures to ignore" "unknown-ca[unknown authority]" "cn-mismatch[hostname mismatch]" "expired[certificate expired]" "not-yet-valid[certificate not yet valid]" "other[all other failures]"' ) + done _store_cache svn-${cmd}-args args fi -- cgit v1.2.3 From ea5d100643646af718309d54975424f08963fe6f Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 19 Aug 2015 23:27:33 +0000 Subject: 36148: _git-log: Complete flags after positional argument --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 48 +++++++++++++++++++++----------------------- 2 files changed, 28 insertions(+), 25 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 4f95ca5c8..21cd189fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-08-19 Oliver Kiddle + + * 36148: Completion/Unix/Command/_git: _git-log: Complete flags + after positional argument + 2015-08-19 Peter Stephenson * 36241: Test/V09datetime.ztst: Test for 36227. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 92db67928..3c20ca663 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1087,33 +1087,31 @@ _git-log () { $revision_options \ '-L+[trace the evolution of a line range or regex within a file]:range' \ '(-)--[start file arguments]' \ - '*:: :->commit-range-or-file' && ret=0 + '1: :->first-commit-ranges-or-files' \ + '*: :->commit-ranges-or-files' && ret=0 case $state in - (commit-range-or-file) - case $CURRENT in - (1) - if [[ -n ${opt_args[(I)--]} ]]; then - __git_cached_files && ret=0 - else - _alternative \ - 'commit-ranges::__git_commit_ranges' \ - 'cached-files::__git_cached_files' && ret=0 - fi - ;; - (*) - # TODO: Write a wrapper function that checks whether we have a - # committish range or comittish and calls __git_tree_files - # appropriately. - if __git_is_committish_range $line[1]; then - __git_tree_files ${PREFIX:-.} $(__git_committish_range_last $line[1]) && ret=0 - elif __git_is_committish $line[1]; then - __git_tree_files ${PREFIX:-.} $line[1] && ret=0 - else - __git_cached_files && ret=0 - fi - ;; - esac + (first-commit-ranges-or-files) + if [[ -n ${opt_args[(I)--]} ]]; then + __git_cached_files && ret=0 + else + _alternative \ + 'commit-ranges::__git_commit_ranges' \ + 'cached-files::__git_cached_files' && ret=0 + fi + ;; + (commit-ranges-or-files) + # TODO: Write a wrapper function that checks whether we have a + # committish range or comittish and calls __git_tree_files + # appropriately. + if __git_is_committish_range $line[1]; then + __git_tree_files ${PREFIX:-.} $(__git_committish_range_last $line[1]) && ret=0 + elif __git_is_committish $line[1]; then + __git_tree_files ${PREFIX:-.} $line[1] && ret=0 + else + __git_cached_files && ret=0 + fi + ;; esac return ret -- cgit v1.2.3 From d70e7149df96e94e747ea3ed9ae6787f5a04d8b5 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 18 Aug 2015 04:19:27 +0000 Subject: 36236: _git-log: complete 'git rm'd files --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 21cd189fa..3e361c5a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-08-19 Daniel Shahaf + + * 36236: Completion/Unix/Command/_git: _git-log: complete + 'git rm'd files + 2015-08-19 Oliver Kiddle * 36148: Completion/Unix/Command/_git: _git-log: Complete flags diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 3c20ca663..df9375ff4 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1093,11 +1093,11 @@ _git-log () { case $state in (first-commit-ranges-or-files) if [[ -n ${opt_args[(I)--]} ]]; then - __git_cached_files && ret=0 + __git_tree_files ${PREFIX:-.} HEAD && ret=0 else _alternative \ 'commit-ranges::__git_commit_ranges' \ - 'cached-files::__git_cached_files' && ret=0 + 'cached-files::__git_tree_files ${PREFIX:-.} HEAD' && ret=0 fi ;; (commit-ranges-or-files) @@ -1109,7 +1109,7 @@ _git-log () { elif __git_is_committish $line[1]; then __git_tree_files ${PREFIX:-.} $line[1] && ret=0 else - __git_cached_files && ret=0 + __git_tree_files ${PREFIX:-.} HEAD && ret=0 fi ;; esac -- cgit v1.2.3 From a4c41fff1261c4c0251fe969e7684c582160f93a Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 18 Aug 2015 04:26:48 +0000 Subject: 36236: _git-log: Complete multiple revspecs e.g., git log origin/master origin/foo origin/bar --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 3e361c5a7..ad64ca2df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-08-19 Daniel Shahaf + * 36236: Completion/Unix/Command/_git: _git-log: Complete + multiple revspecs + * 36236: Completion/Unix/Command/_git: _git-log: complete 'git rm'd files diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index df9375ff4..fc9d7ce9f 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1101,6 +1101,11 @@ _git-log () { fi ;; (commit-ranges-or-files) + # Multiple revspecs are permitted. + if [[ -z ${opt_args[(I)--]} ]]; then + __git_commit_ranges "$@" && ret=0 + fi + # TODO: Write a wrapper function that checks whether we have a # committish range or comittish and calls __git_tree_files # appropriately. -- cgit v1.2.3 From 663fa4092fcc492e49fbf4d396d0b5b0a2325a48 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 19 Aug 2015 21:17:50 +0000 Subject: 36237: __git_objects: Complete HEAD:foo correctly in worktree subdir --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index ad64ca2df..7479cfe6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-08-19 Daniel Shahaf + * 36237: Completion/Unix/Command/_git: __git_objects: Complete + HEAD:foo correctly in worktree subdir + * 36236: Completion/Unix/Command/_git: _git-log: Complete multiple revspecs diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index fc9d7ce9f..e1a38e935 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5740,7 +5740,7 @@ __git_tree_ishs () { __git_objects () { compset -P '*:' if [[ -n $IPREFIX ]]; then - __git_tree_files "$PREFIX" "${IPREFIX%:}" + __git_tree_files --root-relative "$PREFIX" "${IPREFIX%:}" else _alternative \ 'revisions::__git_revisions' \ @@ -5985,12 +5985,23 @@ __git_changed_files () { 'changed-in-working-tree-files::__git_changed-in-working-tree_files' } +# __git_tree_files [--root-relative] FSPATH TREEISH [TREEISH...] [COMPADD OPTIONS] +# +# Complete [presently: a single level of] repository files under FSPATH. +# FSPATH is interpreted as a directory path within each TREEISH. +# FSPATH is relative to cwd, unless --root-relative is specified, in +# which case it is relative to the repository root. (( $+functions[__git_tree_files] )) || __git_tree_files () { local multi_parts_opts local tree Path integer at_least_one_tree_added local -a tree_files compadd_opts + local -a extra_args + + if [[ $1 == --root-relative ]]; then + extra_args+=(--full-tree) + fi zparseopts -D -E -a compadd_opts V: J: 1 2 n f X: M: P: S: r: R: q F: @@ -5998,7 +6009,7 @@ __git_tree_files () { shift (( at_least_one_tree_added = 0 )) for tree in $*; do - tree_files+=(${(ps:\0:)"$(_call_program tree-files git ls-tree --name-only -z $tree $Path 2>/dev/null)"}) + tree_files+=(${(ps:\0:)"$(_call_program tree-files git ls-tree $extra_args --name-only -z $tree $Path 2>/dev/null)"}) __git_command_successful $pipestatus && (( at_least_one_tree_added = 1 )) done -- cgit v1.2.3 From a69994ede1ce9ba608e8deedad548b95235053c5 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 19 Aug 2015 21:18:08 +0000 Subject: 36247: __git_objects: Complete HEAD:./foo correctly in worktree subdir --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command') diff --git a/ChangeLog b/ChangeLog index 7479cfe6c..73dc3d5ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-08-19 Daniel Shahaf + * 36247: Completion/Unix/Command/_git: __git_objects: Complete + HEAD:./foo correctly in worktree subdir + * 36237: Completion/Unix/Command/_git: __git_objects: Complete HEAD:foo correctly in worktree subdir diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index e1a38e935..0d705a9da 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5740,7 +5740,11 @@ __git_tree_ishs () { __git_objects () { compset -P '*:' if [[ -n $IPREFIX ]]; then - __git_tree_files --root-relative "$PREFIX" "${IPREFIX%:}" + if compset -P ./ ; then + __git_tree_files "$PREFIX" "${IPREFIX%:./}" + else + __git_tree_files --root-relative "$PREFIX" "${IPREFIX%:}" + fi else _alternative \ 'revisions::__git_revisions' \ -- cgit v1.2.3