about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_look21
1 files changed, 21 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_look b/Completion/Unix/Command/_look
new file mode 100644
index 000000000..06cf2c4ec
--- /dev/null
+++ b/Completion/Unix/Command/_look
@@ -0,0 +1,21 @@
+#compdef look
+
+local curcontext="$curcontext" state line
+typeset -A opt_args
+
+_arguments -C -s \
+  '-t+[termination character]:termination character:' \
+  '-f[case insensitive]' \
+  '-d[dictionary order]' \
+  ':string:->string' \
+  ':dictionary file:_files' && return 0
+
+case "$state" in
+string)
+  if [[ -n "$PREFIX" ]]; then
+    _wanted values expl 'word prefix' compadd - $(_call_program values $words[1] $PREFIX)
+  else
+    _message 'word prefix'
+  fi
+  ;;
+esac