diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2015-05-28 02:27:03 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2015-05-28 02:27:03 +0200 |
commit | fd2ef9a80430c1f4f4ae222af228b485c484dd64 (patch) | |
tree | 58e2e652beebfed85a7e0545cf81a24f2c74cf09 /Completion | |
parent | f14d3594049e553de8d61e5fc1d2fa245410a867 (diff) | |
parent | fd786a5c8abf1942a05ed8c470b06cc0b4aa5174 (diff) | |
download | zsh-fd2ef9a80430c1f4f4ae222af228b485c484dd64.tar.gz zsh-fd2ef9a80430c1f4f4ae222af228b485c484dd64.zip |
Merge branch 'upstream' and tag 'zsh-5.0.7-dev-4' into 'debian'
Diffstat (limited to 'Completion')
27 files changed, 290 insertions, 72 deletions
diff --git a/Completion/BSD/Command/_bsdconfig b/Completion/BSD/Command/_bsdconfig new file mode 100644 index 000000000..8c7597e0f --- /dev/null +++ b/Completion/BSD/Command/_bsdconfig @@ -0,0 +1,55 @@ +#compdef bsdconfig + +local -a shortcuts +shortcuts=( + 'console:utilities to customize the behavior of the system console' + 'defaultrouter:default router/gateway' + 'diskmgmt:manage disk partitions and/or labels using sade(8)' + 'docsinstall:install/reinstall FreeBSD documentation set(s)' + 'dot:generate a graphviz dot(1) language file(printed on stdout)' + 'groupadd:add groups' + 'groupdel:delete groups' + 'groupedit:edit/view groups' + 'groupmgmt:utilities to add/change/view/delete group accounts' + 'hostname:set hostname/domainname' + 'kern_securelevel:set kern.securelevel variable' + 'mouse:utilities for configuring, exploring, and enabling console mouse support' + 'mouse_disable:disable mouse support' + 'mouse_enable:enable mouse support' + 'mouse_flags:set mouse daemon flags' + 'mouse_port:select mouse port' + 'mouse_type:select mouse type' + 'nameservers:DNS Nameservers menu under networking' + 'netdev:configure network interfaces' + 'networking:utilities for network related settings' + 'packages:browse, install, uninstall, or re-install packaged software' + 'password:set the system administrator (root) password' + 'security:configure various system security settings' + 'startup:configure various aspects of system startup' + 'startup_misc:miscellaneous startup services' + 'startup_rcadd:add directives to rc.conf(5)' + 'startup_rcconf:view/edit directives to rc.conf(5)' + 'startup_rcdelete:delete directives from rc.conf(5)' + 'startup_rcvar:toggle directives on/off' + 'syscons_font:select console font' + 'syscons_keymap:select console keymap' + 'syscons_repeat:set key repeat speed' + 'syscons_saver:select console screensaver' + 'syscons_screenmap:select console screenmap' + 'syscons_ttys:select console TTY type' + 'timezone:set the regional timezone of the local machine' + 'ttys:edit the ttys(5) database with your favorite editor' + 'useradd:add users' + 'userdel:delete users' + 'useredit:edit/view users' + 'usermgmt:utilities to add/edit/view/delete user accounts' +) + +_arguments -s -w -A '-*' : \ + '-d[debug mode]' \ + '-D[send debug info to file]: :{ compset -P 1 +; _files }' \ + '-f[load file as script then exit]: : _files' \ + '-h[print usage then exit]' \ + '-S[secure X11 mode]' \ + '-X[use Xdialog(1)]' \ + '1:bsdconfig(8) menus:(( $shortcuts ))' diff --git a/Completion/BSD/Command/_bsdinstall b/Completion/BSD/Command/_bsdinstall new file mode 100644 index 000000000..e0589d720 --- /dev/null +++ b/Completion/BSD/Command/_bsdinstall @@ -0,0 +1,46 @@ +#compdef bsdinstall + +local -a _bsdinstall_targets +_bsdinstall_targets=( + 'auto:standard interactive installation, including disk partitioning' + "entropy:stores a small amount of data from /dev/random in the new system's root" + 'jail:sets up a new chroot system at destination, suitable for use with jail(8)' + 'script:run an installation script' + "keymap:set the keymap and save to the new system's rc.conf" + 'hostname:set the hostname for the new system' + 'netconfig:configure networking' + 'autopart:run the interactive guided disk partitioner' + 'zfsboot:run the interactive/scriptable ZFS partitioner' + 'scriptedpart:non-interactive partition setup' + 'mount:mount the file systems previously configured by autopart, partedit, or scriptedpart' + 'distfetch:fetches the distributions in DISTRIBUTIONS to BSDINSTALL_DISTDIR from BSDINSTALL_DISTSITE' + 'checksum:verifies the checksums of the distributions listed in DISTRIBUTIONS' + 'distextract:extracts the distributions listed in DISTRIBUTIONS into BSDINSTALL_CHROOT' + "rootpass:interactively invokes passwd(1) in the new system to set the root user's password" + 'adduser:interactively invokes adduser(8) in the new system' + 'time:interactively sets the time, date, and time zone of the new system' + 'services:queries the user for the system daemons to begin at system startup' + 'config:installs the configuration files destined for the new system' +) + +local context state state_descr line +typeset -A val_args +_arguments -A '-*' : \ + '-D[installation log file]: : _files' \ + '1: :->targets' \ + '*: :->args' + +case $state in + targets) _describe targets _bsdinstall_targets;; + args) + shift words + [[ $words[1] == '-D' ]] && shift 2 words + + case $words[1] in + jail) _files -/;; + script) _files;; + scriptedpart) _message "$words[1] parameters";; + *) _message "nothing to complete"; return 1;; + esac + ;; +esac diff --git a/Completion/BSD/Command/_jexec b/Completion/BSD/Command/_jexec new file mode 100644 index 000000000..f065ea1e0 --- /dev/null +++ b/Completion/BSD/Command/_jexec @@ -0,0 +1,19 @@ +#compdef jexec + +_jexec_normal() { + local PATH=$PATH + # relative paths are relative to the jail's root + path=( "$(command jls -j $words[1] path)"/$^path ) + shift 1 words; (( CURRENT-- )) + _normal +} + +_jexec() { + _arguments -s -w -A "-*" : \ + '(-U)-u[host environment user whom command runs as]:host user:_users' \ + '(-u)-U[jail environment user whom command runs as]:jail user:_users' \ + '1:jail:_jails' \ + '*:: : _jexec_normal' +} + +_jexec "$@" diff --git a/Completion/BSD/Command/_jls b/Completion/BSD/Command/_jls new file mode 100644 index 000000000..a6f8a7eb6 --- /dev/null +++ b/Completion/BSD/Command/_jls @@ -0,0 +1,19 @@ +#compdef jls + +local curcontext=$curcontext state state_descr line +typeset -A opt_args + +_arguments -C -s -w -A '-*' : \ + '-d[include diying jails]' \ + '-h[print header line]' \ + "-N[print jail's name instead of numeric ID]" \ + '-n[print parameters in ``name=value'\'\'' format]' \ + '-q[quote parameter value when it contains whitespace, quotes or empty string]' \ + '-s[print parameters suitable for passing to jail(8)]' \ + '-v[print a multiple-line summary per jail]' \ + '-j[the jid or name of the jail to list]:jail:_jails' \ + '*: :->parameters' + +if [[ $state == parameters ]]; then + _values -w -S ' ' 'jail parameter' ${${${(f)"$(sysctl -N security.jail.param)"}%.#}##security.jail.param.#} +fi diff --git a/Completion/BSD/Type/.distfiles b/Completion/BSD/Type/.distfiles new file mode 100644 index 000000000..f03668b3a --- /dev/null +++ b/Completion/BSD/Type/.distfiles @@ -0,0 +1,2 @@ +DISTFILES_SRC=' +' diff --git a/Completion/BSD/Type/_jails b/Completion/BSD/Type/_jails index 36bffeceb..89e34ba4f 100644 --- a/Completion/BSD/Type/_jails +++ b/Completion/BSD/Type/_jails @@ -1,5 +1,33 @@ #autoload -jails=( ${${${${(f)"$(_call_program jails jls -n)"}##*jid=}/ name=/:}%% *} ) +# Options: +# +# -0 include jid 0 as a match for the host system +# -o param jail parameter to complete instead of jid - +# e.g. name, path, ip4.addr, host.hostname -_describe -t jails jail jails "$@" +local addhost host param desc=1 +local -a jails args expl +zparseopts -D -K -E 0=addhost o:=param +param=${param[2]:-name} + +jails=( ${${(f)"$(_call_program jails jls $param name)"}/ /:} ) +case $param in + jid) host=0 ;; + name) + host=0 + desc=0 + ;; + path) + host=/ + args=( -M 'r:|/=* r:|=*' ) + ;; + ip4.addr) args=( -M 'r:|.=* r:|=*' ) ;; +esac +[[ -n $addhost && -n $host ]] && jails+=( "$host:$HOST" ) + +if (( desc )); then + _describe -t jails jail jails "$@" "$args[@]" +else + _wanted jails expl jail compadd "$@" "$args[@]" - ${jails%:*} +fi diff --git a/Completion/Base/Utility/_store_cache b/Completion/Base/Utility/_store_cache index 8feaee6f7..86e72e9a9 100644 --- a/Completion/Base/Utility/_store_cache +++ b/Completion/Base/Utility/_store_cache @@ -46,15 +46,8 @@ if zstyle -t ":completion:${curcontext}:" use-cache; then for var; do case ${(Pt)var} in (*readonly*) ;; - (*(association|array)*) - # Dump the array as a here-document to reduce parsing overhead - # when reloading the cache with "source" from _retrieve_cache - print -r "$var=( "'"${(zQ)$(<<\EO:'"$var" - print -r "${(kv@Pqq)^^var}" - print -r "EO:$var" - print -r ')}" )' - ;; - (*) print -r "$var=${(Pqq)^^var}";; + (*(association|array)*) print -r "$var=( ${(kv@Pqq)^^var} )";; + (*) print -r "$var=${(Pqq)^^var}";; esac done >! "$_cache_dir/$_cache_ident" else diff --git a/Completion/Redhat/Command/_yum b/Completion/Redhat/Command/_yum index a6983283c..f4538060e 100644 --- a/Completion/Redhat/Command/_yum +++ b/Completion/Redhat/Command/_yum @@ -173,20 +173,34 @@ yum_repos() { # Completion function for install (( $+functions[_yum_install] )) || _yum_install() { - _yum_available_pkgs - compadd "$@" -a -- _available_pkgs + if ! [[ $PREFIX == */* ]]; then + _yum_available_pkgs + fi + + local ret=1 + _tags files packages + while _tags; do + if _requested files; then + compadd "$@" -a -- _available_pkgs + fi + if _requested packages; then + _call_function - _yum_localinstall + fi + (( ret )) || break + done + return ret } # Completion function for localinstall (( $+functions[_yum_localinstall] )) || _yum_localinstall() { - _files -g '(#i)*.rpm(-.)' + _files -/ -g '(#i)*.rpm(-.)' } # Completion function for localupdate (( $+functions[_yum_localupdate] )) || _yum_localupdate() { - _files -g '(#i)*.rpm(-.)' + _files -/ -g '(#i)*.rpm(-.)' } # Completion function for update/upgrade diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant index 8e4bd82af..ee9f7d910 100644 --- a/Completion/Unix/Command/_ant +++ b/Completion/Unix/Command/_ant @@ -123,8 +123,7 @@ case $state in # Output target again indicating its the default one. print -n "'${default_target}:(Default target) ' " ;; - (Searching:*|Main:targets:|Subtargets:|BUILD:SUCCESSFUL|Total:time: - *) + (Searching:*|Main:targets:|Subtargets:|BUILD:SUCCESSFUL|Total:time:*) ;; (*) # Return target and description diff --git a/Completion/Unix/Command/_baz b/Completion/Unix/Command/_baz index 132c6e31d..6787f41e2 100644 --- a/Completion/Unix/Command/_baz +++ b/Completion/Unix/Command/_baz @@ -6,13 +6,13 @@ local baz_version local hide_short # ask the user which version of baz this is -if ! zstyle -s ":completion:${curcontext}" baz-version baz_version; then +if ! zstyle -s ":completion:${curcontext}:" baz-version baz_version; then # ask baz instead baz_version="${${$($BAZ --version)#baz Bazaar version }%% \(thelove@canonical.com*}" fi # test whether to hide short options from completion -if zstyle -s ":completion:${curcontext}" hide-shortopts hide_short; then +if zstyle -s ":completion:${curcontext}:" hide-shortopts hide_short; then case $hide_short in true|yes|on|1) hide_short='!' ;; *) hide_short='' ;; diff --git a/Completion/Unix/Command/_cp b/Completion/Unix/Command/_cp index 4c4dea2e9..7087b4e6c 100644 --- a/Completion/Unix/Command/_cp +++ b/Completion/Unix/Command/_cp @@ -13,7 +13,7 @@ if _pick_variant gnu=GNU unix --version; then '-H[follow command-line symbolic links]' \ '(-l --link)'{-l,--link}'[link files instead of copying]' \ '(-L --dereference)'{-L,--dereference}'[always follow symbolic links]' \ - (-n --no-clobber -i --interactive){-n,--no-clobber}"[don't overwrite an existing file]" \ + '(-n --no-clobber -i --interactive)'{-n,--no-clobber}"[don't overwrite an existing file]" \ '(-P --no-dereference)'{-P,--no-dereference}'[never follow symbolic links]' \ '-p[same as --preserve=mode,ownership,timestamps]' \ '--preserve=-[preserve specified attributes]:: :_values -s , attribute mode timestamps ownership links context xattr all' \ diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 979e3e76f..4403a48a8 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -714,12 +714,14 @@ _git-diff () { local curcontext=$curcontext state line ret=1 declare -A opt_args - local -a diff_options + local -a diff_options diff_stage_options __git_setup_diff_options + __git_setup_diff_stage_options _arguments -w -C -s \ $* \ $diff_options \ + $diff_stage_options \ '(--cached --staged)'{--cached,--staged}'[show diff between index and named commit]' \ '(-)--[start file arguments]' \ '*:: :->from-to-file' && ret=0 @@ -1081,12 +1083,10 @@ _git-log () { local -a log_options revision_options diff_options __git_setup_log_options __git_setup_revision_options - __git_setup_diff_options _arguments -w -C -s \ $log_options \ $revision_options \ - $diff_options \ '-L+[trace the evolution of a line range or regex within a file]:range' \ '(-)--[start file arguments]' \ '*:: :->commit-range-or-file' && ret=0 @@ -1484,10 +1484,9 @@ _git-show () { local curcontext=$curcontext state line ret=1 typeset -A opt_args - local -a log_options revision_options diff_options + local -a log_options revision_options __git_setup_log_options __git_setup_revision_options - __git_setup_diff_options _arguments -w -C -s \ $log_options \ @@ -1794,7 +1793,7 @@ _tig () { (( $+functions[_git-config] )) || _git-config () { local name_arg value_arg - local curcontext=$curcontext state line ret=1 + local curcontext=$curcontext state line expl ret=1 declare -A opt_args if (( words[(I)--get-regexp] )); then @@ -2554,7 +2553,7 @@ _git-config () { options -M 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' && ret=0 ;; (gettable-option) - _describe -t git-options option \ + _wanted git-options expl option compadd -M 'r:|.=* r:|=*' - \ ${${${(0)"$(_call_program gettable-options git config -z --list)"}%%$'\n'*}//:/\\:} && ret=0 ;; (gettable-colorbool-option) @@ -2948,7 +2947,8 @@ _git-fast-export () { '--progress=[insert progress statements]: :__git_guard_number interval' \ '--signed-tags=[specify how to handle signed tags]:action:((verbatim\:"silently export" warn\:"export, but warn" - strip\:"export unsigned tags instead" + warn-strip\:"export as unsigned tags, but warn" + strip\:"export as unsigned tags instead" abort\:"abort on signed tags (default)"))' \ '--tag-of-filtered-object=[specify how to handle tags whose tagged object is filtered out]:action:((abort\:"abort on such tags" drop\:"omit such tags" @@ -3733,7 +3733,9 @@ _git-send-email () { '( --no-validate)--validate[perform sanity checks on patches]' \ '(--validate )--no-validate[do not perform sanity checks on patches]' \ '--force[send emails even if safety checks would prevent it]' \ - '*: :_files' + '*: : _alternative -O expl + "files:file:_files" + "commits:recent commit object name:__git_commit_objects_prefer_recent"' } (( $+functions[_git-svn] )) || @@ -4341,11 +4343,13 @@ _git-cat-file () { (( $+functions[_git-diff-files] )) || _git-diff-files () { - declare -a revision_options + local -a revision_options diff_stage_options __git_setup_revision_options + __git_setup_diff_stage_options _arguments -w -S -s \ $revision_options \ + $diff_stage_options \ ': :__git_changed-in-working-tree_files' \ ': :__git_changed-in-working-tree_files' \ '*: :__git_changed-in-working-tree_files' @@ -5532,7 +5536,7 @@ __git_stashes () { local expl declare -a stashes - stashes=(${${(f)"$(_call_program stashes git stash list 2>/dev/null)"}/: */}) + stashes=(${(f)"$(_call_program stashes git stash list --pretty=format:%gd 2>/dev/null)"}) __git_command_successful $pipestatus || return 1 _wanted stashes expl stash compadd "$@" -a - stashes @@ -5585,7 +5589,7 @@ __git_remote_branch_names () { branch_names=(${${(f)"$(_call_program remote-branch-refs git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}#refs/remotes/}) __git_command_successful $pipestatus || return 1 - _wanted remote-branch-names expl 'remote branch name' compadd "$@" -a - branch_names + _wanted remote-branch-names expl 'remote branch name' compadd -M 'r:|/=**' "$@" -a - branch_names } (( $+functions[__git_remote_branch_names_noprefix] )) || @@ -5596,7 +5600,12 @@ __git_remote_branch_names_noprefix () { branch_names=(${${${(f)"$(_call_program remote-branch-refs-noprefix git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}##*/}:#HEAD}) __git_command_successful $pipestatus || return 1 - _wanted remote-branch-names-noprefix expl 'remote branch name' compadd "$@" -a - branch_names + _wanted remote-branch-names-noprefix expl 'remote branch name' compadd -M 'r:|/=**' "$@" -a - branch_names +} + +(( $+functions[__git_commit_objects_prefer_recent] )) || +__git_commit_objects_prefer_recent () { + __git_recent_commits || __git_commit_objects } (( $+functions[__git_commits] )) || @@ -5609,15 +5618,21 @@ __git_commits () { _alternative \ "heads::__git_heads $sopts" \ "commit-tags::__git_commit_tags $sopts" \ - 'commit-objects::__git_commit_objects' + 'commit-objects::__git_commit_objects_prefer_recent' } (( $+functions[__git_heads] )) || __git_heads () { + __git_heads_local + __git_heads_remote +} + +(( $+functions[__git_heads_local] )) || +__git_heads_local () { local gitdir expl start declare -a heads - heads=(${${(f)"$(_call_program headrefs git for-each-ref --format='"%(refname)"' refs/heads refs/remotes 2>/dev/null)"}#refs/(heads|remotes)/}) + heads=(${(f)"$(_call_program headrefs git for-each-ref --format='"%(refname:short)" refs/heads' 2>/dev/null)"}) gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) if __git_command_successful $pipestatus; then for f in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do @@ -5626,7 +5641,17 @@ __git_heads () { [[ -f $gitdir/refs/stash ]] && heads+=stash fi - _wanted heads expl head compadd "$@" -a - heads + _wanted heads-local expl "local head" compadd -M 'r:|/=**' "$@" -a - heads +} + +(( $+functions[__git_heads_remote] )) || +__git_heads_remote () { + local gitdir expl start + declare -a heads + + heads=(${(f)"$(_call_program headrefs git for-each-ref --format='"%(refname:short)" refs/remotes' 2>/dev/null)"}) + + _wanted heads-remote expl "remote head" compadd -M 'r:|/=**' "$@" -a - heads } (( $+functions[__git_commit_objects] )) || @@ -5634,29 +5659,47 @@ __git_commit_objects () { local gitdir expl start declare -a commits + # Abort if the argument does not match a commit hash (including empty). + [[ "$PREFIX$SUFFIX" == [[:xdigit:]](#c1,40) ]] || return 1 + # Note: the after-the-colon part must be unique across the entire array; # see workers/34768 - : ${(A)commits::=${(f)"$(_call_program commits git --no-pager log -20 --format='%h:\\\[%h\\\]\ %s')"}} + commits=(${(f)"$(_call_program commits git --no-pager log -1000 --all --reflog --format='%h:\[%h\]\ %s\ \(%cr\)')"}) __git_command_successful $pipestatus || return 1 - _describe -V -t commits 'commit object name' commits || _guard '[[:xdigit:]](#c,40)' 'commit object name' + _describe -V -t commits 'commit object name' commits } (( $+functions[__git_recent_commits] )) || __git_recent_commits () { local gitdir expl start declare -a descr tags heads commits - local i j k + local i j k ret + integer distance_from_head # Careful: most %d will expand to the empty string. Quote properly! - : "${(A)commits::=${(@f)"$(_call_program commits git --no-pager log -20 --format='%h%n%d%n%s')"}}" + # NOTE: we could use %D directly, but it's not available in git 1.9.1 at least. + commits=("${(f)"$(_call_program commits git --no-pager log -20 --format='%h%n%d%n%s\ \(%cr\)')"}") __git_command_successful $pipestatus || return 1 for i j k in "$commits[@]" ; do # Note: the after-the-colon part must be unique across the entire array; # see workers/34768 - descr+=("$i:[$i] $k") + if (( distance_from_head == 0 )); then + descr+=($i:"[HEAD] $k") + elif (( distance_from_head == 1 )); then + descr+=($i:"[HEAD^] $k") + elif (( distance_from_head == 2 )); then + descr+=($i:"[HEAD^^] $k") + elif (( distance_from_head < 10 )); then + descr+=($i:"[HEAD~$distance_from_head] $k") + else + descr+=($i:"[HEAD~$distance_from_head] $k") + fi + (( ++distance_from_head )) + j=${${j# \(}%\)} # strip leading ' (' and trailing ')' + j=${j/ ->/,} # Convert " -> master, origin/master". for j in ${(s:, :)j}; do if [[ $j == 'tag: '* ]] ; then tags+=( ${j#tag: } ) @@ -5673,7 +5716,8 @@ __git_recent_commits () { expl=() _wanted heads expl 'head' compadd "$@" -a - heads && ret=0 expl=() - _describe -2Vx -t commits 'commit object name' descr && ret=0 + _describe -Vx -t commits 'recent commit object name' descr && ret=0 + return $ret } (( $+functions[__git_blob_objects] )) || @@ -6214,14 +6258,20 @@ __git_setup_diff_options () { '(--no-prefix)--dst-prefix=[use given prefix for destination]:prefix' '(--src-prefix --dst-prefix)--no-prefix[do not show any source or destination prefix]' + '(-c,--cc)'{-c,--cc}'[combined diff format for merge commits]' + + # TODO: --output is undocumented. + '--output[undocumented]:undocumented') +} + +(( $+functions[__git_setup_diff_stage_options] )) || +__git_setup_diff_stage_options () { + diff_stage_options=( '(-0 -1 -2 -3 --base --ours --theirs -c --cc --no-index)'{-1,--base}'[diff against "base" version]' '(-0 -1 -2 -3 --base --ours --theirs -c --cc --no-index)'{-2,--ours}'[diff against "our branch" version]' '(-0 -1 -2 -3 --base --ours --theirs -c --cc --no-index)'{-3,--theirs}'[diff against "their branch" version]' '(-0 -1 -2 -3 --base --ours --theirs -c --cc --no-index)-0[omit diff output for unmerged entries]' - '(-0 -1 -2 -3 --base --ours --theirs -c --cc --no-index)'{-c,--cc}'[compare "our branch", "their branch" and working tree files]' - - # TODO: --output is undocumented. - '--output[undocumented]:undocumented') + ) } (( $+functions[__git_setup_revision_options] )) || diff --git a/Completion/Unix/Command/_ip b/Completion/Unix/Command/_ip index bfa7d995b..1e3949148 100644 --- a/Completion/Unix/Command/_ip +++ b/Completion/Unix/Command/_ip @@ -531,6 +531,8 @@ args=( ) _regex_words options "ip options" \ + '-h*uman:output statistics with human readable values' \ + '-i*ec:print human readable rates in IEC units (ie. 1K = 1024)' \ '-s*tatistics:output statistics' \ '-f*amily:select protocol family:$subcmd_family' \ '-4:IPv4' \ diff --git a/Completion/Unix/Command/_locate b/Completion/Unix/Command/_locate index 0b35b7cdd..694f506c3 100644 --- a/Completion/Unix/Command/_locate +++ b/Completion/Unix/Command/_locate @@ -25,7 +25,7 @@ case $basename in ltype=gnu ;; - (*illegal option*) + (*"illegal option"*) if [[ $OSTYPE == (freebsd|openbsd|dragonfly|darwin)* ]]; then ltype=bsd else diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make index 225c0af85..c14a34c58 100644 --- a/Completion/Unix/Command/_make +++ b/Completion/Unix/Command/_make @@ -65,7 +65,7 @@ _make-parseMakefile () { do case "$input " in # VARIABLE = value OR VARIABLE ?= value - ([[:alnum:]][[:alnum:]_]#[ $TAB]#(\?|)=*) + ([[:alnum:]][[:alnum:]_]#[" "$TAB]#(\?|)=*) var=${input%%[ $TAB]#(\?|)=*} val=${input#*=} val=${val##[ $TAB]#} @@ -74,7 +74,7 @@ _make-parseMakefile () { # VARIABLE := value OR VARIABLE ::= value # Evaluated immediately - ([[:alnum:]][[:alnum:]_]#[ $TAB]#:(:|)=*) + ([[:alnum:]][[:alnum:]_]#[" "$TAB]#:(:|)=*) var=${input%%[ $TAB]#:(:|)=*} val=${input#*=} val=${val##[ $TAB]#} @@ -97,7 +97,7 @@ _make-parseMakefile () { ;; # Include another makefile - (${~incl} *) + (${~incl}" "*) local f=${input##${~incl} ##} if [[ $incl == '.include' ]] then diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index 3af55a379..d3dcd1812 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -8,7 +8,7 @@ arguments=('-P[parent process id]:parent process id:->ppid' '-F[match only in process in pidfile]:files:_files' '-g[match only in process group ids]:group:->pgid' '-G[match only real group id]:group:_groups' - '-j[match only in processes inside jails]:jail id:->jid' + '-j[match only in processes inside jails]:jail id:_sequence _jails -0 -o jid' '-J[match only in project ids]:project id:->projid' '-M[extract the name list from the specified core]:files:_files' '-N[extract the name list from the specified system]:files:_files' @@ -93,16 +93,6 @@ case $state in _wanted sid expl 'session id' compadd -S ',' -q -F used $sid ;; - (jid) - compset -P '*,' - - local -a used jid - used=(${(s:,:)IPREFIX}) - jid=(${(uon)$(ps -ax -o jid=)}) - - _wanted jid expl 'jail id' compadd -S ',' -q -F used $jid - ;; - (ppid) compset -P '*,' diff --git a/Completion/Unix/Command/_php b/Completion/Unix/Command/_php index 5d7b84e28..4edcd1e57 100644 --- a/Completion/Unix/Command/_php +++ b/Completion/Unix/Command/_php @@ -9,7 +9,7 @@ typeset -A opt_args local -a args local exclusions php_suffix -zstyle -s ":completion:$curcontext" suffixes php_suffix '|' || php_suffix='php|phar' +zstyle -s ":completion:${curcontext}:" suffixes php_suffix '|' || php_suffix='php|phar' local php_files=":PHP file:_files -g '*.($php_suffix)(-.)'" if _pick_variant php5=PHP\ 5 php4 --version; then diff --git a/Completion/Unix/Command/_ps b/Completion/Unix/Command/_ps index 925f48390..e557b27b9 100644 --- a/Completion/Unix/Command/_ps +++ b/Completion/Unix/Command/_ps @@ -160,7 +160,7 @@ if (( CURRENT > 1 )) && [[ $OSTYPE != solaris* || ( $OSTYPE = linux-gnu && $word _wanted -C option-k-1 properties expl 'property' _sequence -s , _ps_props -s - && return ;; *G) _sequence -s , _groups && return ;; - *J) _sequence -s , _jails && return ;; + *J) _sequence _jails -0 && return ;; *[MNW]) _files && return ;; *t) _wanted -C option-t-1 ttys expl tty _sequence -s , \ diff --git a/Completion/Unix/Command/_python b/Completion/Unix/Command/_python index dedb9ceda..2fb4a915b 100644 --- a/Completion/Unix/Command/_python +++ b/Completion/Unix/Command/_python @@ -31,7 +31,7 @@ _arguments -C -s -S "$args[@]" \ '-E[ignore PYTHON* environment variables (such as PYTHONPATH)]' \ '(1 * -)-h[display help information]' \ '-i[inspect interactively after running script]' \ - '(1 -)-m[run library module as a script (terminates option list)]:module:_python_modules' \ + '(1 -)-m+[run library module as a script (terminates option list)]:module:_python_modules' \ '-O[optimize generated bytecode slightly]' \ '-OO[remove doc-strings in addition to the -O optimizations]' \ "-s[don't add user site directory to sys.path]" \ diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index 597f2325c..188a81367 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -96,7 +96,7 @@ _svn () { ) ;; (mergeinfo) - args[(r)--show-revs:arg:]=( '--show-revs:revisions:(merged eligible)' ) + args[(r)--show-revs:arg:]=( '--show-revs=:revisions:(merged eligible)' ) ;; (propget|propedit) args+=( diff --git a/Completion/Unix/Command/_tar b/Completion/Unix/Command/_tar index ce5852453..1e99ac013 100644 --- a/Completion/Unix/Command/_tar +++ b/Completion/Unix/Command/_tar @@ -23,7 +23,7 @@ local _tar_cmd tf tmp tmpb del index if _pick_variant gnu=GNU unix --version; then case "$($service --version)" in - (tar \(GNU tar\) (#b)([0-9.-]##)*) + ("tar (GNU tar) "(#b)([0-9.-]##)*) autoload -z is-at-least is-at-least 1.14.91 "$match[1]" || _cmd_variant[$service]="gnu-old" ;; diff --git a/Completion/Unix/Command/_tla b/Completion/Unix/Command/_tla index 358a6a736..1e4cdd8d9 100644 --- a/Completion/Unix/Command/_tla +++ b/Completion/Unix/Command/_tla @@ -6,7 +6,7 @@ local tla_version local hide_short # ask the user which version of tla this is -if ! zstyle -s ":completion:${curcontext}" tla-version tla_version; then +if ! zstyle -s ":completion:${curcontext}:" tla-version tla_version; then # ask tla instead tla_version="$($TLA --version)" if [[ "${${(f)tla_version}[1]}" == The\ GNU\ Arch\ Revision\ Control\ System\ \(tla\)\ (#b)([0-9.]##) ]]; then @@ -18,7 +18,7 @@ if ! zstyle -s ":completion:${curcontext}" tla-version tla_version; then fi # test whether to hide short options from completion -if zstyle -s ":completion:${curcontext}" hide-shortopts hide_short; then +if zstyle -s ":completion:${curcontext}:" hide-shortopts hide_short; then case $hide_short in true|yes|on|1) hide_short='!' ;; *) hide_short='' ;; diff --git a/Completion/Unix/Command/_vim b/Completion/Unix/Command/_vim index 021054d47..007671be8 100644 --- a/Completion/Unix/Command/_vim +++ b/Completion/Unix/Command/_vim @@ -4,7 +4,7 @@ _vim_files () { case $PREFIX in (+*) _files -P './' $* && return 0 ;; - (scp|http(|s)|(|s)ftp):*) _urls ;; + ((scp|http(|s)|(|s)ftp):*) _urls ;; (*) _files $* ;; esac case $PREFIX in diff --git a/Completion/Unix/Type/_path_commands b/Completion/Unix/Type/_path_commands index 22d2aaeba..423563c0d 100644 --- a/Completion/Unix/Type/_path_commands +++ b/Completion/Unix/Type/_path_commands @@ -25,7 +25,7 @@ return 1 _call_whatis() { case "$(whatis --version)" in - (whatis from *) + ("whatis from "*) local -A args zparseopts -D -A args s: r: apropos "${args[-r]:-"$@"}" | fgrep "($args[-s]" diff --git a/Completion/Unix/Type/_urls b/Completion/Unix/Type/_urls index 97b1a4402..6f23803ed 100644 --- a/Completion/Unix/Type/_urls +++ b/Completion/Unix/Type/_urls @@ -75,7 +75,7 @@ fi scheme="$match[1]" case "$scheme" in - http(|s)|(|s)ftp|scp|gopher) + (http(|s)|(|s)ftp|scp|gopher) if ! compset -P //; then _wanted -C "$scheme" prefixes expl 'end of prefix' compadd -S '' "$@" // return diff --git a/Completion/X/Command/_xrandr b/Completion/X/Command/_xrandr index 9d9323c69..b0851569e 100644 --- a/Completion/X/Command/_xrandr +++ b/Completion/X/Command/_xrandr @@ -51,7 +51,7 @@ _arguments -C \ case $state in value) case $words[CURRENT-1] in - (scaling* mode) + (scaling*" mode") _description value expl "output property 'scaling mode'" compadd "$@" "$expl[@]" None Full Center Full\ aspect && return 0 ;; diff --git a/Completion/Zsh/Context/_brace_parameter b/Completion/Zsh/Context/_brace_parameter index fcca4bf84..3955cb7a4 100644 --- a/Completion/Zsh/Context/_brace_parameter +++ b/Completion/Zsh/Context/_brace_parameter @@ -143,6 +143,7 @@ if [[ $PREFIX = *'${('[^\)]# ]]; then "@:double-quoted splitting of scalars" "A:create array parameter" "a:sort in array index order (with O to reverse)" + "b:backslash quote pattern characters only" "c:count characters in an array (with \${(c)#...})" "C:capitalize words" "D:perform directory name abbreviation" |