about summary refs log tree commit diff
path: root/Completion/Builtins/_hash
blob: b7e777a055a581b491b90d43af2eceaae0c0f365 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#compdef hash

local expl

if [[ "$words[2]" = -*d* ]]; then
  if compset -P 1 '*='; then
    _wanted -C -d-value files expl directories _path_files -/
  else
    _wanted -C -d named-directories expl 'named directory' \
        compadd -q -S '=' - "${(@k)nameddirs}"
  fi
elif compset -P 1 '*='; then
  _wanted -C value values expl 'executable file' &&
      _files "$expl[@]" -g '*(-*)'
else
  _wanted -C name commands expl command compadd -q -S '=' - "${(@k)commands}"
fi