about summary refs log tree commit diff
path: root/Completion/Core/_files
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-12-01 15:29:41 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-12-01 15:29:41 +0000
commitf844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca (patch)
treec2a3b06a34243abe3826eead259bb08900f011f1 /Completion/Core/_files
parent26cf7b8d50f1b7d9d0b9115018ef4dc8624b5030 (diff)
downloadzsh-f844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca.tar.gz
zsh-f844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca.tar.xz
zsh-f844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca.zip
zsh-workers/8840
Diffstat (limited to 'Completion/Core/_files')
-rw-r--r--Completion/Core/_files13
1 files changed, 12 insertions, 1 deletions
diff --git a/Completion/Core/_files b/Completion/Core/_files
index ba5445797..9c5b45693 100644
--- a/Completion/Core/_files
+++ b/Completion/Core/_files
@@ -1,17 +1,24 @@
 #autoload
 
-local opts opt type=file
+local opts opt type=file group
 
 opts=()
+group=()
 while getopts "P:S:qr:R:W:F:J:V:X:f/g:M:" opt; do
   case "$opt" in
   /)    [[ "$type" = file       ]] && type=dir       ;;
   g)    [[ "$type" = (file|dir) ]] && type="$OPTARG" ;;
   q)    opts=("$opts[@]" -q               )          ;;
+  [JV]) group=(          "-$opt" "$OPTARG")          ;;
   [^f]) opts=("$opts[@]" "-$opt" "$OPTARG")          ;;
   esac
 done
 
+if [[ "$group[2]" = files ]]; then
+  opts=("$opts[@]" "$group[@]")
+  group=()
+fi
+
 case "$type" in
 file) _tags all-files                           ;;
 dir)  _tags directories all-files               ;;
@@ -20,15 +27,19 @@ esac
 
 while _tags; do
   if _requested all-files; then
+    (( $#group )) && group[2]=all-files
     _path_files "$opts[@]" -f
     return
   elif _requested directories; then
     if _requested globbed-files; then
+      (( $#group )) && group[2]=globbed-files
       _path_files "$opts[@]" -/g "$type" && return 0
     else
+      (( $#group )) && group[2]=directories
       _path_files "$opts[@]" -/ && return 0
     fi
   elif _requested globbed-files; then
+    (( $#group )) && group[2]=globbed-files
     _path_files "$opts[@]" -g "$type" && return 0
   fi
 done