about summary refs log tree commit diff
path: root/Completion/User/_urls
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2000-06-05 23:20:48 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2000-06-05 23:20:48 +0000
commit0d0a134822e10de5946bb34720c8c0ca0518207c (patch)
tree68e3e70721b07ce9c41284a2cd68d3dab43024fd /Completion/User/_urls
parent4e9967dcca02695eb5a62dc15b43e6123329d909 (diff)
downloadzsh-0d0a134822e10de5946bb34720c8c0ca0518207c.tar.gz
zsh-0d0a134822e10de5946bb34720c8c0ca0518207c.tar.xz
zsh-0d0a134822e10de5946bb34720c8c0ca0518207c.zip
accept -g option in _urls and use _urls in _rpm (11756)
Diffstat (limited to 'Completion/User/_urls')
-rw-r--r--Completion/User/_urls15
1 files changed, 9 insertions, 6 deletions
diff --git a/Completion/User/_urls b/Completion/User/_urls
index 0d1845754..b9cb3dad8 100644
--- a/Completion/User/_urls
+++ b/Completion/User/_urls
@@ -38,7 +38,7 @@
 #    E.g.:
 #      zstyle ':completion:*:urls' local www /usr/local/apache/htdocs public_html
 
-local ipre scheme host user uhosts ret=1 expl match
+local ipre scheme host user uhosts ret=1 expl match glob
 local urls_path localhttp
 zstyle -s ":completion:${curcontext}:urls" path urls_path ||
     urls_path="${ZDOTDIR:-$HOME}/.zsh/urls"
@@ -52,6 +52,9 @@ if [[ "$1" = -f ]]; then
   _wanted -C -f files expl file _files "$@" && return 0
 fi
 
+zparseopts -D -E 'g:=glob'
+(( $#glob )) || glob=( -g '*(^/)' )
+
 ipre="$IPREFIX"
 
 if ! compset -P '(#b)([-+.a-z0-9]#):'; then
@@ -82,7 +85,7 @@ case "$scheme" in
       while _tags; do
         while _next_label files expl 'local file'; do
           if [[ -prefix / ]]; then
-	    _path_files "$expl[@]" -S '' -g '*(^/)' && ret=0
+	    _path_files "$expl[@]" -S '' "${glob[@]}" && ret=0
 	    _path_files "$expl[@]" -S/ -r '/' -/ && ret=0
           elif [[ -z "$PREFIX" ]]; then
 	    compadd -S '/' -r '/' "$expl[@]" "$@" - "${PWD%/}" && ret=0
@@ -103,7 +106,7 @@ case "$scheme" in
       _tags -C bookmark files
       while _tags; do
         while _next_label files expl 'bookmark'; do
-          _path_files -W "$urls_path/$scheme" "$expl[@]" -S '' -g '*(^/)' && 
+          _path_files -W "$urls_path/$scheme" "$expl[@]" -S '' "${glob[@]}" && 
               ret=0
           _path_files -W "$urls_path/$scheme" -S/ -r '/' "$expl[@]" -/ && ret=0
         done
@@ -145,7 +148,7 @@ if [[ "$localhttp_servername" = "$host" ]]; then
     user="$match[1]"
     while _tags; do
       while _next_label files expl 'local file'; do
-        _path_files "$expl[@]" "$@" -W ~$user/$localhttp_userdir -g '*(^/)' && ret=0
+        _path_files "$expl[@]" "$@" -W ~$user/$localhttp_userdir "${glob[@]}" && ret=0
         _path_files -S/ -r '/'  "$expl[@]" -W ~$user/$localhttp_userdir-/ && ret=0
       done
       (( ret )) || return 0
@@ -153,7 +156,7 @@ if [[ "$localhttp_servername" = "$host" ]]; then
   else
     while _tags; do
       while _next_label files expl 'local file'; do
-        _path_files "$expl[@]" "$@" -W $localhttp_documentroot -g '*(^/)' && ret=0
+        _path_files "$expl[@]" "$@" -W $localhttp_documentroot "${glob[@]}" && ret=0
         _path_files -S/ -r '/' "$expl[@]" -W $localhttp_documentroot -/ && ret=0
       done
       (( ret )) || return 0
@@ -162,7 +165,7 @@ if [[ "$localhttp_servername" = "$host" ]]; then
 else
   while _tags; do
     while _next_label files expl 'local file'; do
-      _path_files "$expl[@]" "$@" -W $urls_path/$scheme/$host -g '*(^/)' && ret=0
+      _path_files "$expl[@]" "$@" -W $urls_path/$scheme/$host "${glob[@]}" && ret=0
       _path_files -S/ -r '/' "$expl[@]" -W $urls_path/$scheme/$host -/ && ret=0
     done
     (( ret )) || return 0