Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Work around broken case parsing



This patch is incomplete because I realized this was getting ridiculous.

---
 Completion/Linux/Command/_lsusb   | 4 ++--
 Completion/Linux/Command/_ss      | 2 +-
 Completion/Unix/Command/_locate   | 4 ++--
 Completion/Unix/Command/_nslookup | 2 +-
 Completion/Unix/Command/_twidge   | 6 +++---
 Completion/X/Command/_dcop        | 6 +++---
 Completion/Zsh/Context/_subscript | 2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Completion/Linux/Command/_lsusb b/Completion/Linux/Command/_lsusb
index 17240e0..8641379 100644
--- a/Completion/Linux/Command/_lsusb
+++ b/Completion/Linux/Command/_lsusb
@@ -16,11 +16,11 @@ _arguments \
   while IFS="" read usbidsline
   do
     case "$usbidsline" in
-      ((#b)([0-9a-f]##) ##(*))
+      ((#b)([0-9a-f]##)\ ##(*))
         vendorid="$match[1]"
         _lsusb_vendors[$vendorid]="$match[2]"
       ;;
-      (	(#b)([0-9a-f]##) ##(*)))
+      ((\	(#b)([0-9a-f]##)\ ##(*)))
         pair="$vendorid:$match[1]"
         _lsusb_devices[${pair}]="$match[2]"
       ;;
diff --git a/Completion/Linux/Command/_ss b/Completion/Linux/Command/_ss
index 95aa798..1acb9b9 100644
--- a/Completion/Linux/Command/_ss
+++ b/Completion/Linux/Command/_ss
@@ -35,7 +35,7 @@ _arguments -C -s \
 
 if [[ -n $state ]]; then
   case $words[CURRENT-1] in
-  (d|s)port)
+  ((d|s)port)
     _wanted operators expl operator \
       compadd \< \> \= \>= \<= \== \!= eq ge gt lt le ne && ret=0
   ;;
diff --git a/Completion/Unix/Command/_locate b/Completion/Unix/Command/_locate
index 694f506..6de8d0f 100644
--- a/Completion/Unix/Command/_locate
+++ b/Completion/Unix/Command/_locate
@@ -17,11 +17,11 @@ case $basename in
     ltype=mlocate
     ;;
 
-    (*(#i)secure locate*)
+    (*(#i)secure\ locate*)
     ltype=slocate
     ;;
 
-    (*(#i)gnu locate*|*findutils*gnu*)
+    (*(#i)gnu\ locate*|*findutils*gnu*)
     ltype=gnu
     ;;
 
diff --git a/Completion/Unix/Command/_nslookup b/Completion/Unix/Command/_nslookup
index 9bc80ab..c099a45 100644
--- a/Completion/Unix/Command/_nslookup
+++ b/Completion/Unix/Command/_nslookup
@@ -86,7 +86,7 @@ if [[ -n "$compcontext" ]]; then
   fi
 
   case "$words[1]" in
-  (|l)server)
+  ((|l)server)
     _wanted hosts expl 'new default server' _hosts
     return
     ;;
diff --git a/Completion/Unix/Command/_twidge b/Completion/Unix/Command/_twidge
index d8b3b3d..bb86f7b 100644
--- a/Completion/Unix/Command/_twidge
+++ b/Completion/Unix/Command/_twidge
@@ -48,16 +48,16 @@ function _twidge_args {
 		lsarchive)
 			_arguments $args_common $args_more $args_other
 			;;
-		ls(dm(|archive)|recent|replies|rt(|archive|replies)))
+		(ls(dm(|archive)|recent|replies|rt(|archive|replies)))
 			_arguments $args_common $args_more
 			;;
-		lsfollow(ers|ing))
+		(lsfollow(ers|ing))
 			_arguments $args_common :username
 			;;
 		dmsend)
 			_arguments :recipient :status
 			;;
-		(un|)follow)
+		((un|)follow)
 			_message username
 			;;
 		update)
diff --git a/Completion/X/Command/_dcop b/Completion/X/Command/_dcop
index a0329e1..ea44369 100644
--- a/Completion/X/Command/_dcop
+++ b/Completion/X/Command/_dcop
@@ -5,7 +5,7 @@ local app obj fun
 local -a state line expl
 
 case $service in
-  dcop(client|object))
+  (dcop(client|object))
     state=( dcopref )
     max=2
   ;;
@@ -84,8 +84,8 @@ while (( $#state )); do
 	fi
 	case $arg in
 	  bool*) _wanted argument expl "$desc" compadd true false && return ;;
-	  (#i)*(file|path|dir)*) _wanted argument expl "$desc" _files && return ;;
-	  (#i)*url*) _wanted argument expl "$desc" _urls && return ;;
+	  ((#i)*(file|path|dir)*) _wanted argument expl "$desc" _files && return ;;
+	  ((#i)*url*) _wanted argument expl "$desc" _urls && return ;;
 	  *) _message -e argument "$desc" ;;
 	esac
       else
diff --git a/Completion/Zsh/Context/_subscript b/Completion/Zsh/Context/_subscript
index 0ccc0c4..12a802b 100644
--- a/Completion/Zsh/Context/_subscript
+++ b/Completion/Zsh/Context/_subscript
@@ -61,7 +61,7 @@ elif compset -P '\('; then
       '(r R k K i)I[all keys matched by subscript as pattern]'
       'e[interpret * or @ as a single key]'
     );;
-    (|scalar*)) flags=(
+    ((|scalar*)) flags=(
       'w[make subscripting work on words of scalar]'
       's[specify word separator]'
       'p[recognise escape sequences in subsequent s flag]'
-- 
2.4.0



Messages sorted by: Reverse Date, Date, Thread, Author