about summary refs log tree commit diff
path: root/Completion/Builtins/_hash
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Builtins/_hash')
-rw-r--r--Completion/Builtins/_hash19
1 files changed, 11 insertions, 8 deletions
diff --git a/Completion/Builtins/_hash b/Completion/Builtins/_hash
index 171c5e2e8..c577fc4d7 100644
--- a/Completion/Builtins/_hash
+++ b/Completion/Builtins/_hash
@@ -1,13 +1,16 @@
-#defcomp hash
+#compdef hash
 
-if [[ -mword 1 -*d* ]]; then
-  if [[ -string 1 '=' ]]; then
-    _path_files -g '*(-/)'
+local expl
+
+if [[ "$words[2]" = -*d* ]]; then
+  if compset -P 1 '*='; then
+    _wanted -C -d-value files expl directories _path_files -/
   else
-    complist -n -q -S '='
+    _wanted -C -d named-directories expl 'named directory' \
+        compadd -q -S '=' - "${(@k)nameddirs}"
   fi
-elif [[ -string 1 '=' ]]; then
-  _files -/g '*(*)'
+elif compset -P 1 '*='; then
+  _wanted -C value values expl 'executable file' _files "$expl[@]" -g '*(-*)'
 else
-  complist -m -q -S '='
+  _wanted -C name commands expl command compadd -q -S '=' - "${(@k)commands}"
 fi