From 0161b1ca7752c4a768dd3dcf38493290b9d36ff7 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Fri, 27 Aug 1999 12:02:50 +0000 Subject: zsh-workers/7515 --- Completion/Base/_arguments | 26 ++++++++++++++++++++++++++ Completion/Pbmplus/_pnmtotiff | 2 +- Completion/Pbmplus/_ppmtomitsu | 2 +- Completion/User/_find | 4 ++-- 4 files changed, 30 insertions(+), 4 deletions(-) (limited to 'Completion') diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments index 60b07b2e4..5deef344b 100644 --- a/Completion/Base/_arguments +++ b/Completion/Base/_arguments @@ -533,8 +533,34 @@ else if [[ -z "$action" ]]; then # An empty action means that we should just display a message. + _message "$descr" return ret + + elif [[ "$action" = \(\(*\)\) ]]; then + + # ((...)) contains literal strings with descriptions. + + eval ws\=\( "${action[3,-3]}" \) + + compadd -D ws - "${(@)ws%%:*}" + + if (( $#ws )); then + beg=1 + for nth in "$ws[@]"; do + tmp="${#nth%%:*}" + [[ tmp -gt beg ]] && beg="$tmp" + done + tmp='' + for nth in "$ws[@]"; do + tmp="$tmp +${(r:beg:: :)nth%%:*} -- ${nth#*:}" + done + tmp="$tmp[2,-1]" + compadd "$expl[@]" -y tmp - "${(@)ws%%:*}" + else + _message "$descr" + fi elif [[ "$action" = \(*\) ]]; then # Anything inside `(...)' is added directly. diff --git a/Completion/Pbmplus/_pnmtotiff b/Completion/Pbmplus/_pnmtotiff index 5cc170190..af7cb14ac 100644 --- a/Completion/Pbmplus/_pnmtotiff +++ b/Completion/Pbmplus/_pnmtotiff @@ -1,5 +1,5 @@ #compdef pnmtotiff _arguments '-none' '-packbits' '-lzw' '-g3' '-g4' '-2d' '-fill' \ - '-predictor:LZW predictor:(1 2)' '-msb2lsb' '-lsb2msb' \ + '-predictor:LZW predictor:((1\:without\ differencing 2\:with\ differencing))' '-msb2lsb' '-lsb2msb' \ '-rowsperstrip:number of rows per strip:' ':file: _pbm_file' diff --git a/Completion/Pbmplus/_ppmtomitsu b/Completion/Pbmplus/_ppmtomitsu index e89047df1..16103f558 100644 --- a/Completion/Pbmplus/_ppmtomitsu +++ b/Completion/Pbmplus/_ppmtomitsu @@ -2,6 +2,6 @@ _arguments '-sharpness:sharpness:(1 2 3 4)' \ '-enlarge:enlargement factor:(1 2 3)' \ - '-media:output media:(A A4 AS A4S)' \ + '-media:output media (default\: 1184x1350):((A\:1216x1350 A4\:1184x1452 AS\:1216x1650 A4S\:1184x1754))' \ '-copy:number of copies:(1 2 3 4 5 6 7 8 9)' \ '-dpi300' '-tiny' ':file: _pbm_file' diff --git a/Completion/User/_find b/Completion/User/_find index 368cdcb16..4fe84a83a 100644 --- a/Completion/User/_find +++ b/Completion/User/_find @@ -43,8 +43,8 @@ _arguments \ '*-perm:file permission bits:' \ '*-size:file size:' \ '*-true' \ - '*-type:file type:(b c d p f l s)' \ - '*-xtype:file type:(b c d p f l s)' \ + '*-type:file type:((b\:block\ special\ file c\:character\ special\ file d\:directory p\:named\ pipe f\:normal\ file l\:symbolic\ link s\:socket))' \ + '*-xtype:file type:((b\:block\ special\ file c\:character\ special\ file d\:directory p\:named\ pipe f\:normal\ file l\:symbolic\ link s\:socket))' \ '*-exec:program: _command_names -e:*\;::program arguments: _normal' \ '*-ok:program: _command_names -e:*\;::program arguments: _normal' \ '*-fls:output file:_files' \ -- cgit 1.4.1