about summary refs log tree commit diff
path: root/Completion/Builtins/_hash
blob: c8169c590baaeb6cae8e0d9c199b511812179c4c (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
    _path_files -g '*(-/)'
  else
    _description expl 'named directory'
    compgen "$expl[@]" -n -q -S '='
  fi
elif compset -P 1 '*\='; then
  _files -/g '*(*)'
else
  _description expl command
  compgen "$expl[@]" -m -q -S '='
fi