about summary refs log tree commit diff
path: root/Completion/Core/_path_files
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-12-09 10:39:37 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-12-09 10:39:37 +0000
commit726e1f5545e35b2cc589d1e43202ae6c04fbffca (patch)
tree691efed5d248e10a35fb9c6f2d55e835f8d5c814 /Completion/Core/_path_files
parent837ee86a60421d19ad00cac1204bc94d0a96bc56 (diff)
downloadzsh-726e1f5545e35b2cc589d1e43202ae6c04fbffca.tar.gz
zsh-726e1f5545e35b2cc589d1e43202ae6c04fbffca.tar.xz
zsh-726e1f5545e35b2cc589d1e43202ae6c04fbffca.zip
zsh-workers/8965
Diffstat (limited to 'Completion/Core/_path_files')
-rw-r--r--Completion/Core/_path_files19
1 files changed, 11 insertions, 8 deletions
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files
index 79b1473c4..e5135a422 100644
--- a/Completion/Core/_path_files
+++ b/Completion/Core/_path_files
@@ -6,7 +6,7 @@
 local linepath realpath donepath prepath testpath exppath
 local tmp1 tmp2 tmp3 tmp4 i orig pre suf tpre tsuf opre osuf cpre
 local pats haspats=no ignore group expl addpfx addsfx remsfx
-local nm=$compstate[nmatches] menu match matcher
+local nm=$compstate[nmatches] menu match matcher mopts
 
 typeset -U prepaths exppaths
 
@@ -24,11 +24,14 @@ addsfx=()
 remsfx=()
 expl=()
 matcher=()
+mopts=()
 
 # Get the options.
 
-while getopts "P:S:qr:R:W:F:J:V:X:f/g:M:" opt; do
+while getopts "P:S:qr:R:W:F:J:V:X:f/g:M:12n" opt; do
   case "$opt" in
+  [12n]) mopts=( "$mopts[@]" "-$opt" )
+         ;;
   P)     addpfx=(-P "$OPTARG")
          ;;
   S)     addsfx=(-S "$OPTARG")
@@ -347,13 +350,13 @@ for prepath in "$prepaths[@]"; do
       if [[ -n $menu ]] || ! _style paths expand '*suffix*'; then
         _style paths cursor && compstate[to_end]=''
         if [[ "$tmp3" = */* ]]; then
-	  compadd -Qf -p "$linepath$tmp4" -s "/${tmp3#*/}" \
+	  compadd -Qf "$mopts[@]" -p "$linepath$tmp4" -s "/${tmp3#*/}" \
 	          -W "$prepath$realpath$testpath" "$ignore[@]" \
 		  "$addpfx[@]" "$addsfx[@]" "$remsfx[@]" \
                   -M "r:|/=* r:|=* $match" "$group[@]" "$expl[@]" \
 		  - "${(@)tmp1%%/*}"
 	else
-	  compadd -Qf -p "$linepath$tmp4" \
+	  compadd -Qf "$mopts[@]" -p "$linepath$tmp4" \
 	          -W "$prepath$realpath$testpath" "$ignore[@]" \
 		   "$addpfx[@]" "$addsfx[@]" "$remsfx[@]" \
                    -M "r:|/=* r:|=* $match" "$group[@]" "$expl[@]" \
@@ -362,14 +365,14 @@ for prepath in "$prepaths[@]"; do
       else
         if [[ "$tmp3" = */* ]]; then
           for i in "$tmp1[@]"; do
-	    compadd -Qf -p "$linepath$tmp4" -s "/${i#*/}" \
+	    compadd -Qf "$mopts[@]" -p "$linepath$tmp4" -s "/${i#*/}" \
 		    -W "$prepath$realpath$testpath" "$ignore[@]" \
 		    "$addpfx[@]" "$addsfx[@]" "$remsfx[@]" \
                     -M "r:|/=* r:|=* $match" "$group[@]" "$expl[@]" \
 		    - "${i%%/*}"
 	  done
         else
-	  compadd -Qf -p "$linepath$tmp4" \
+	  compadd -Qf "$mopts[@]" -p "$linepath$tmp4" \
 		  -W "$prepath$realpath$testpath" "$ignore[@]" \
 		  "$addpfx[@]" "$addsfx[@]" "$remsfx[@]" \
                   -M "r:|/=* r:|=* $match" "$group[@]" "$expl[@]" \
@@ -419,7 +422,7 @@ for prepath in "$prepaths[@]"; do
     fi
     tmp4="$testpath"
     compquote tmp4 tmp1
-    compadd -Qf -p "$linepath$tmp4" \
+    compadd -Qf "$mopts[@]" -p "$linepath$tmp4" \
 	    -W "$prepath$realpath$testpath" "$ignore[@]" \
 	    "$addpfx[@]" "$addsfx[@]" "$remsfx[@]" \
             -M "r:|/=* r:|=* $match" "$group[@]" "$expl[@]" \
@@ -437,7 +440,7 @@ if _style paths expand '*prefix*' &&
    [[ $#exppaths -gt 0 && nm -eq compstate[nmatches] ]]; then
   PREFIX="${opre}"
   SUFFIX="${osuf}"
-  compadd -Q -S '' "$group[@]" "$expl[@]" \
+  compadd -Q "$mopts[@]" -S '' "$group[@]" "$expl[@]" \
           -M "r:|/=* r:|=* $match" -p "$linepath" - "$exppaths[@]"
 fi