From ca585f812b02071cc261fb9dbe463bab6f8be602 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 15 Jan 2001 09:11:31 +0000 Subject: add `services', allowing easier re-use of (parts of) completion functions (13346) --- Completion/User/_pbm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Completion/User/_pbm') 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:' \ -- cgit 1.4.1