about summary refs log tree commit diff
path: root/Completion/User/_pbm
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-01-15 09:11:31 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-01-15 09:11:31 +0000
commitca585f812b02071cc261fb9dbe463bab6f8be602 (patch)
treee90c1af1169132098b62207ced35fdf83607e910 /Completion/User/_pbm
parenta11115ecee1b5fc02b4b714561ffdbc2d2a3e622 (diff)
downloadzsh-ca585f812b02071cc261fb9dbe463bab6f8be602.tar.gz
zsh-ca585f812b02071cc261fb9dbe463bab6f8be602.tar.xz
zsh-ca585f812b02071cc261fb9dbe463bab6f8be602.zip
add `services', allowing easier re-use of (parts of) completion functions (13346)
Diffstat (limited to 'Completion/User/_pbm')
-rw-r--r--Completion/User/_pbm12
1 files changed, 6 insertions, 6 deletions
diff --git a/Completion/User/_pbm b/Completion/User/_pbm
index 4b7163dcd..7980fc2b7 100644
--- a/Completion/User/_pbm
+++ b/Completion/User/_pbm
@@ -6,14 +6,14 @@
 # defaults can be overridden by simply defining completion functions
 # for those commands whose arguments you want to complete differently.
 
-local pat expl ret=1 cmd="${words[1]:t}"
+local pat expl ret=1
 
-if [[ "$cmd" = pnm* ]]; then
+if [[ "$service" = pnm* ]]; then
   pat='*.(#i)p[bgp]m'
-elif [[ "$cmd" = *top[bgpn]m ]]; then
-  pat="*.(#i)${cmd%%top[bgpn]m}"
+elif [[ "$service" = *top[bgpn]m ]]; then
+  pat="*.(#i)${service%%top[bgpn]m}"
 else
-  pat="*.(#i)${cmd[1,3]}"
+  pat="*.(#i)${service[1,3]}"
 fi
   
 if [[ $# -ne 0 || $+_in_pbm -ne 0 ]]; then
@@ -24,7 +24,7 @@ fi
 
 local _in_pbm=yes
 
-case "$cmd" in
+case "$service" in
 asciitop[gn]m)
   _arguments \
     '-d[specify divisor]:divisor:' \