about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2008-11-10 15:28:41 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2008-11-10 15:28:41 +0000
commit5d13deda4e6c16a155c0ebab4c0372d36b8be751 (patch)
tree32b37f637571d7b4eac74bc8ce52788415832698 /Completion
parent399cf6312e374e29453326bd38db5285cb406af5 (diff)
downloadzsh-5d13deda4e6c16a155c0ebab4c0372d36b8be751.tar.gz
zsh-5d13deda4e6c16a155c0ebab4c0372d36b8be751.tar.xz
zsh-5d13deda4e6c16a155c0ebab4c0372d36b8be751.zip
add completion of globbing flags
Diffstat (limited to 'Completion')
-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
4 files changed, 42 insertions, 4 deletions
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
     ;;