summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Unix/Type/_path_files6
-rw-r--r--Completion/Zsh/Type/.distfiles1
-rw-r--r--Completion/Zsh/Type/_globflags33
-rw-r--r--Completion/Zsh/Type/_globquals6
5 files changed, 48 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index bf5a5ad37..6debf1c86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-08  Oliver Kiddle  <opk@zsh.org>
+
+	* 26017: Completion/Unix/Type/_path_files, 
+	Completion/Zsh/Type/_globflags, Completion/Zsh/Type/_globquals:
+	add completion of globbing flags
+
 2008-11-08  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 26021: Completion/Unix/Type/_path_files: complete glob
diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files
index 8924ece8e..2e9e943b5 100644
--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -21,7 +21,11 @@ if [[ ( -o bareglobqual && \
 	   $PREFIX = (#b)((*[^\\]|)(\\\\)#"(#q")([^\)]#) \
       ) && -z $compstate[quote] ]]; then
    compset -p ${#match[1]}
-   _globquals
+   if [[ -o extendedglob ]] && compset -P '\#'; then
+     _globflags
+   else
+     _globquals
+   fi
    return
 fi
 
diff --git a/Completion/Zsh/Type/.distfiles b/Completion/Zsh/Type/.distfiles
index e7507f396..74a4e101d 100644
--- a/Completion/Zsh/Type/.distfiles
+++ b/Completion/Zsh/Type/.distfiles
@@ -7,6 +7,7 @@ _delimiters
 _directory_stack
 _file_descriptors
 _functions
+_globflags
 _globqual_delims
 _globquals
 _history_modifiers
diff --git a/Completion/Zsh/Type/_globflags b/Completion/Zsh/Type/_globflags
new file mode 100644
index 000000000..2a32f6de0
--- /dev/null
+++ b/Completion/Zsh/Type/_globflags
@@ -0,0 +1,33 @@
+local ret=1
+local -a flags
+
+if compset -P a; then
+  _message -e numbers 'errors'
+  return
+elif compset -P q; then
+  _globquals
+  return
+fi
+
+flags=(
+  'i:case insensitive'
+  'l:lower case characters match uppercase'
+  'I:case sensitive matching'
+  's:match start of string'
+  'e:match end of string'
+)
+[[ $compstate[context] = condition ]] && flags+=(
+  'b:activate backreferences'
+  'B:deactivate backreferences'
+  'm:set reference to entire matched data'
+  'M:deactivate m flag'
+)
+
+_describe -t globflags "glob flag" flags -Q -S ')' && ret=0
+flags=(
+  'a:approximate matching'
+  'q:introduce glob qualifier'
+)
+_describe -t globflags "glob flag" flags -Q -S '' && ret=0
+
+return ret
diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals
index 0ad71b72c..f0c692621 100644
--- a/Completion/Zsh/Type/_globquals
+++ b/Completion/Zsh/Type/_globquals
@@ -25,7 +25,7 @@ while [[ -n $PREFIX ]]; do
 	return
       elif ! _globqual_delims; then
 	# still completing mode spec
-	_message "mode spec"
+	_message -e modes "mode spec"
 	return
       fi
     fi
@@ -57,7 +57,7 @@ while [[ -n $PREFIX ]]; do
     (d)
     # complete/skip device
     if ! compset -p '[[:digit:]]##'; then
-      _message "device ID"
+      _message -e device-ids "device ID"
       return
     fi
     ;;
@@ -65,7 +65,7 @@ while [[ -n $PREFIX ]]; do
     (l)
     # complete/skip link count
     if ! compset -P '([-+]|)[[:digit:]]##'; then
-      _message "link count"
+      _message -e numbers "link count"
       return
     fi
     ;;