about summary refs log tree commit diff
path: root/Completion/Core/_files
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-09 13:14:59 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-09 13:14:59 +0000
commitc615397157e5efd7a81c8ce11b3f77fd7ccb5a19 (patch)
tree9f6e9081024370574ae18b5808ebedf6d653d672 /Completion/Core/_files
parent95af0ef9c4639763c8094d6e8cd5d8ec01a32f96 (diff)
downloadzsh-c615397157e5efd7a81c8ce11b3f77fd7ccb5a19.tar.gz
zsh-c615397157e5efd7a81c8ce11b3f77fd7ccb5a19.tar.xz
zsh-c615397157e5efd7a81c8ce11b3f77fd7ccb5a19.zip
zsh-workers/8603
Diffstat (limited to 'Completion/Core/_files')
-rw-r--r--Completion/Core/_files23
1 files changed, 16 insertions, 7 deletions
diff --git a/Completion/Core/_files b/Completion/Core/_files
index 4adae0f73..eb1ec3559 100644
--- a/Completion/Core/_files
+++ b/Completion/Core/_files
@@ -1,6 +1,6 @@
 #autoload
 
-local opts opt type=file tags
+local opts opt type=file
 
 opts=()
 while getopts "P:S:qr:R:W:F:J:V:X:f/g:M:" opt; do
@@ -13,15 +13,24 @@ while getopts "P:S:qr:R:W:F:J:V:X:f/g:M:" opt; do
 done
 
 case "$type" in
-file) _tags -f "$funcstack[2]" file           ;;
-dir)  _tags -f "$funcstack[2]" path file      ;;
-*)    _tags -f "$funcstack[2]" glob path file ;;
+file) _tags file           ;;
+dir)  _tags path file      ;;
+*)    _tags glob path file ;;
 esac
 
 while _tags; do
-  [[ "$tags" = *:file:* ]] && { _path_files "$opts[@]" -f         ;  return   }
-  [[ "$tags" = *:path:* ]] &&   _path_files "$opts[@]" -/         && return 0
-  [[ "$tags" = *:glob:* ]] &&   _path_files "$opts[@]" -g "$type" && return 0
+  if _requested file; then
+    _path_files "$opts[@]" -f
+    return
+  elif _requested path; then
+    if _requested glob; then
+      _path_files "$opts[@]" -/g "$type" && return 0
+    else
+      _path_files "$opts[@]" -/g "$type" && return 0
+    fi
+  elif _requested glob; then
+    _path_files "$opts[@]" -g "$type" && return 0
+  fi
 done
 
 return 1