about summary refs log tree commit diff
path: root/Completion/Unix/Command/_look
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-09-03 12:31:22 +0200
committerOliver Kiddle <opk@zsh.org>2016-09-03 12:31:22 +0200
commit48c20d74a7aa5e91619d84fc36f9bd7831eb4174 (patch)
tree6fee0ad5faf89445b9bf1e3b5f4d2f0da870cdc9 /Completion/Unix/Command/_look
parent972423629f115b710c385cff0daa60182e5f33e6 (diff)
downloadzsh-48c20d74a7aa5e91619d84fc36f9bd7831eb4174.tar.gz
zsh-48c20d74a7aa5e91619d84fc36f9bd7831eb4174.tar.xz
zsh-48c20d74a7aa5e91619d84fc36f9bd7831eb4174.zip
39165: update options to correspond to latest versions of software in various functions
Diffstat (limited to 'Completion/Unix/Command/_look')
-rw-r--r--Completion/Unix/Command/_look34
1 files changed, 26 insertions, 8 deletions
diff --git a/Completion/Unix/Command/_look b/Completion/Unix/Command/_look
index 24a016af4..be8cf8c14 100644
--- a/Completion/Unix/Command/_look
+++ b/Completion/Unix/Command/_look
@@ -1,16 +1,34 @@
 #compdef look
 
-local curcontext="$curcontext" state line expl ret=1
+local curcontext="$curcontext" state line expl args sep='+' ret=1
 typeset -A opt_args
 
-_arguments -C -s \
-  '-t+[termination character]:termination character:' \
-  '-f[case insensitive]' \
-  '-d[dictionary order]' \
-  ':string:->string' \
-  ':dictionary file:_files' && ret=0
+case $OSTYPE in
+  linux*)
+    args=(
+      '(2 -a --alternative)'{-a,--alternative}'[use alternative dictionary file]'
+      '(-d --alphanum)'{-d,--alphanum}'[dictionary order]'
+      '(-f --ignore-case)'{-f,--ignore-case}'[case insensitive]'
+      '(-t --terminate)'{-t+,--terminate=}'[specify termination character]:termination character'
+      '(-)'{-h,--help}'[display help information]'
+      '(-)'{-V,--version}'[display version information]'
+    )
+  ;;
+  solaris*) sep='-' ;&
+  *)
+    args=( -A "-*"
+      "-t${sep}[specify termination character]:termination character"
+      '-f[case insensitive]'
+      '-d[dictionary order]'
+    )
+  ;;
+esac
+
+_arguments -C -s -S $args \
+  '1:string:->string' \
+  '2:dictionary file:_files' && ret=0
 
 [[ -n "$state" && ! -prefix - ]] && _wanted values expl 'word prefix' \
-    compadd - $(_call_program words $words[1] '"$PREFIX"' 2>/dev/null) && return
+    compadd - $(_call_program words $words[1] '"$PREFIX"') && return
 
 return ret