summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2017-04-26 16:32:10 +0200
committerOliver Kiddle <opk@zsh.org>2017-04-26 16:32:10 +0200
commit78afb218b0b2603db227667b616578bfe927518c (patch)
tree40277c76f6c347e144180b587a3e35c9fa0cbb5c /Completion/Unix/Command
parent408b92b168078a338f5fc2c2f95f39f8aa8e5f67 (diff)
downloadzsh-78afb218b0b2603db227667b616578bfe927518c.tar.gz
zsh-78afb218b0b2603db227667b616578bfe927518c.zip
40965: fix for missing local declarations of expl
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_cdrdao4
-rw-r--r--Completion/Unix/Command/_darcs2
-rw-r--r--Completion/Unix/Command/_iftop21
-rw-r--r--Completion/Unix/Command/_lha2
-rw-r--r--Completion/Unix/Command/_lsof2
-rw-r--r--Completion/Unix/Command/_pkg-config2
-rw-r--r--Completion/Unix/Command/_rrdtool26
-rw-r--r--Completion/Unix/Command/_stgit10
-rw-r--r--Completion/Unix/Command/_tcpdump15
-rw-r--r--Completion/Unix/Command/_texinfo2
-rw-r--r--Completion/Unix/Command/_units2
-rw-r--r--Completion/Unix/Command/_yafc2
12 files changed, 55 insertions, 35 deletions
diff --git a/Completion/Unix/Command/_cdrdao b/Completion/Unix/Command/_cdrdao
index 0c3cfb82e..ceb86267c 100644
--- a/Completion/Unix/Command/_cdrdao
+++ b/Completion/Unix/Command/_cdrdao
@@ -262,14 +262,14 @@ _cdrdao-copy () {
__cdrdao-device () {
# Use cdrdao scanbus and also check what OS we're running under and provide
# additional stuff, like devices (/dev/sg0)
- local -a devices
+ local -a expl devices
devices=(${${(f)"$(_call_program devices cdrdao scanbus -v 0 2>&1)"}%% :*})
_wanted devices expl 'device' compadd -a devices
}
__cdrdao-drivers () {
- local suf
+ local expl suf
local -Ua drivers
drivers=(${(f)"$(_call_program drivers cut -d'\|' -f4 /usr/share/cdrdao/drivers -s)"})
if compset -P \*:; then
diff --git a/Completion/Unix/Command/_darcs b/Completion/Unix/Command/_darcs
index d40ecda28..74734711d 100644
--- a/Completion/Unix/Command/_darcs
+++ b/Completion/Unix/Command/_darcs
@@ -13,6 +13,8 @@
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
+local expl
+
if (($CURRENT == 2)); then
# We're completing the first word after "darcs" -- the command.
_wanted command expl 'darcs command' \
diff --git a/Completion/Unix/Command/_iftop b/Completion/Unix/Command/_iftop
index 41ffb4ea1..05db3fa03 100644
--- a/Completion/Unix/Command/_iftop
+++ b/Completion/Unix/Command/_iftop
@@ -1,9 +1,16 @@
#compdef iftop
_interfaces () {
- _wanted interfaces expl 'network interface' \
- _net_interfaces
- _values "Pseudo-device that captures on all interfaces" "any"
+ local disp expl sep
+ _description interfaces expl 'network interface'
+ _net_interfaces "$expl[@]"
+ if zstyle -t ":completion:${curcontext}:interfaces" verbose; then
+ zstyle -s ":completion:${curcontext}:interfaces" list-separator sep || sep=--
+ disp=( "any $sep capture on all interfaces" )
+ compadd "$expl[@]" -ld disp any
+ else
+ compadd "$expl[@]" any
+ fi
}
_arguments \
@@ -14,7 +21,7 @@ _arguments \
-P'[turn on port display]' \
-b"[don't display bar graphs of traffic]" \
-B'[display bandwidth rates in bytes/sec rather than bits/sec]' \
- -i'[interface]:network interface:_interfaces' \
- -f'[filter]:BPF filter' \
- -F'[net/mask]:network/mask' \
- -c'[config file]:config file:_files'
+ '-i+[interface]:network interface:_interfaces' \
+ '-f+[filter]:BPF filter' \
+ '-F+[net/mask]:network/mask' \
+ '-c+[config file]:config file:_files'
diff --git a/Completion/Unix/Command/_lha b/Completion/Unix/Command/_lha
index c2d5e7d8d..e8d47fcdb 100644
--- a/Completion/Unix/Command/_lha
+++ b/Completion/Unix/Command/_lha
@@ -1,5 +1,7 @@
#compdef lha
+local expl
+
if (( CURRENT == 2 )); then
compset -P -
diff --git a/Completion/Unix/Command/_lsof b/Completion/Unix/Command/_lsof
index c12b9910a..bbb6eab59 100644
--- a/Completion/Unix/Command/_lsof
+++ b/Completion/Unix/Command/_lsof
@@ -1,6 +1,6 @@
#compdef lsof
-local curcontext="$curcontext" state line fields args
+local curcontext="$curcontext" state line expl fields args
case $OSTYPE in
linux*) args=( '-X[skip reporting of info on network connections]' ) ;;
diff --git a/Completion/Unix/Command/_pkg-config b/Completion/Unix/Command/_pkg-config
index dd73c79e9..43773967e 100644
--- a/Completion/Unix/Command/_pkg-config
+++ b/Completion/Unix/Command/_pkg-config
@@ -1,6 +1,6 @@
#compdef pkg-config
-local arguments packages curcontext="$curcontext" state line ret=1
+local arguments packages curcontext="$curcontext" state line expl ret=1
declare -A opt_args
# Up-to-date as of pkg-config 0.29-4 (debian package) man page synopsis
diff --git a/Completion/Unix/Command/_rrdtool b/Completion/Unix/Command/_rrdtool
index 9d097bd77..96bdaf0db 100644
--- a/Completion/Unix/Command/_rrdtool
+++ b/Completion/Unix/Command/_rrdtool
@@ -1,23 +1,25 @@
#compdef rrdtool
-_arguments \
+local curcontext="$curcontext" state line expl ret=1
+
+_arguments -C \
':rrdtool command:(create update updatev graph dump restore
last lastupdate first help info fetch tune
resize xport)' \
- '*::subcmd:->subcmd' && return 0
+ '*:: :->subcmds' && ret=0
+curcontext="${curcontext%:*}-$words[1]:"
case "$state" in
- (subcmd)
-
- case "$words[1]" in
+ (subcmds)
+ case "$words[1]" in
(help)
- _wanted -V 'subcommands' expl 'subcommand' compadd \
- create update updatev graph dump restore last lastupdate \
- first help info fetch tune resize xport
- ;;
+ _wanted -V 'subcommands' expl 'subcommand' compadd \
+ create update updatev graph dump restore last lastupdate \
+ first help info fetch tune resize xport
+ ;;
(*)
- _files
- ;;
- esac
+ _files
+ ;;
+ esac
;;
esac
diff --git a/Completion/Unix/Command/_stgit b/Completion/Unix/Command/_stgit
index f05591b88..e31af460a 100644
--- a/Completion/Unix/Command/_stgit
+++ b/Completion/Unix/Command/_stgit
@@ -4,7 +4,7 @@ typeset -a subcmds
subcmds=( ${${${(M)${(f)"$(stg help 2> /dev/null)"}## *}# }/#(#b)([^[:space:]]##)[[:space:]]##(*)/$match[1]:$match[2]} )
-local curcontext="$curcontext"
+local curcontext="$curcontext" expl
local subcmd
local ret=1
@@ -18,17 +18,17 @@ else
case $subcmd in
(push)
- _wanted -V "unapplied patches" expl "patch" \
+ _wanted -V unapplied-patches expl "patch" \
compadd ${${(M)${(f)"$(stg series 2> /dev/null)"}##- *}#- } \
&& ret=0
;;
(pop)
- _wanted -V "applied patches" expl "patch" \
+ _wanted -V applied-patches expl "patch" \
compadd ${${(M)${(f)"$(stg series 2> /dev/null)"}##[+>] *}#[+>] } \
&& ret=0
;;
(edit|files|goto|rename|log|float|delete|sink|mail|sync|show|pick|hide|squash)
- _wanted -V "patches" expl "patch" \
+ _wanted -V patches expl "patch" \
compadd $(stg series --noprefix 2> /dev/null) \
&& ret=0
;;
@@ -36,7 +36,7 @@ else
last_word="$words[$CURRENT-1]"
refresh_patch_options=( -p --patch )
if [[ -n ${refresh_patch_options[(r)$last_word]} ]]; then
- _wanted -V "applied patches" expl "patch" \
+ _wanted -V applied-patches expl "patch" \
compadd ${${(M)${(f)"$(stg series 2> /dev/null)"}##[+>] *}#[+>] } \
&& ret=0
else
diff --git a/Completion/Unix/Command/_tcpdump b/Completion/Unix/Command/_tcpdump
index d73956154..2c1d82226 100644
--- a/Completion/Unix/Command/_tcpdump
+++ b/Completion/Unix/Command/_tcpdump
@@ -2,10 +2,17 @@
typeset -A opt_args
-_interfaces () {
- _wanted interfaces expl 'network interface' \
- _net_interfaces
- _values "Pseudo-device that captures on all interfaces" "any"
+_interfaces() {
+ local disp expl sep
+ _description interfaces expl 'network interface'
+ _net_interfaces "$expl[@]"
+ if zstyle -t ":completion:${curcontext}:interfaces" verbose; then
+ zstyle -s ":completion:${curcontext}:interfaces" list-separator sep || sep=--
+ disp=( "any $sep capture on all interfaces" )
+ compadd "$expl[@]" -ld disp any
+ else
+ compadd "$expl[@]" any
+ fi
}
_esp_secrets () {
diff --git a/Completion/Unix/Command/_texinfo b/Completion/Unix/Command/_texinfo
index 7b66d6304..57e13bdc2 100644
--- a/Completion/Unix/Command/_texinfo
+++ b/Completion/Unix/Command/_texinfo
@@ -227,7 +227,7 @@ esac
if [[ -n $state ]]; then
local chr cache file q
- local -a suf tags
+ local -a expl suf tags
local -i36 hash=5381
local -aU infopath=( /usr/share/info ${commands[info]:h:h}/share/info ${(s.:.)INFOPATH} $infodirs )
infopath=( $^infopath(N) )
diff --git a/Completion/Unix/Command/_units b/Completion/Unix/Command/_units
index d049d22ab..bea77ae67 100644
--- a/Completion/Unix/Command/_units
+++ b/Completion/Unix/Command/_units
@@ -1,6 +1,6 @@
#compdef units
-local curcontext="$curcontext" state line
+local curcontext="$curcontext" state line expl
integer ret=1
typeset -A opt_args
diff --git a/Completion/Unix/Command/_yafc b/Completion/Unix/Command/_yafc
index edc7c417f..1e0a601a1 100644
--- a/Completion/Unix/Command/_yafc
+++ b/Completion/Unix/Command/_yafc
@@ -30,7 +30,7 @@ _yafc_bookmarks() {
local bkmfile=~/.yafc/bookmarks
if [[ -f $bkmfile ]]; then
- local -a bkms
+ local -a bkms expl
bkms=(${${${(M)"${(f)$(<$bkmfile)}":#machine*alias ##\'*\' #}##machine*alias ##\'}%%\' #}) #" vim syntax goes crazy
_wanted bookmarks expl 'bookmarks' compadd "$@" -a - bkms
fi