about summary refs log tree commit diff
path: root/Completion/Builtins/_hash
blob: 24a9964b9c77fd0319e6416d7bc904ca8893cef5 (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
24
25
26
#compdef hash

local expl

if [[ "$words[2]" = -*d* ]]; then
  if compset -P 1 '*\='; then
    _tags - -d-value files || return 1

    _path_files -g '*(-/)'
  else
    _tags - -d named-directories || return 1

    _description expl 'named directory'
    compadd "$expl[@]" -q -S '=' - "${(@k)nameddirs}"
  fi
elif compset -P 1 '*\='; then
  _tags value executables || return 1

  _description expl 'executable file'
  _files "$expl[@]" -g '*(*)'
else
  _tags any:argument commands || return 1

  _description expl command
  compadd "$expl[@]" -q -S '=' - "${(@k)commands}"
fi