about summary refs log tree commit diff
path: root/Completion/Unix/Command/_look
blob: a0258c276c5493764a6e5d47cb8ee930331f8865 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#compdef look

local curcontext="$curcontext" state line 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 "$state" in
string)
  if [[ -n "$PREFIX" ]]; then
    _wanted values expl 'word prefix' compadd - $(_call_program values $words[1] $PREFIX) && return
  else
    _message 'word prefix'
  fi
  ;;
esac

return ret