about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/_arguments12
-rw-r--r--Completion/Base/_values12
2 files changed, 12 insertions, 12 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 81b70bdcd..b48192db8 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -153,12 +153,12 @@ if (( long )); then
 fi
 
 subopts=()
-while getopts ':O:C' opt; do
-  if [[ "$opt" = O ]]; then
-    subopts=( "${(@P)OPTARG}" )
-  else
-    usecc=yes
-  fi
+while [[ "$1" = -(O*|C) ]]; do
+  case "$1" in
+  -C) usecc=yes; shift ;;
+  -O) subopts=( "${(@P)2}" ); shift 2 ;;
+  *)  subopts=( "${(@P)1[3,-1]}" ); shift ;;
+  esac
 done
 
 _style -s options auto-description autod
diff --git a/Completion/Base/_values b/Completion/Base/_values
index 54758a32e..eded48363 100644
--- a/Completion/Base/_values
+++ b/Completion/Base/_values
@@ -3,12 +3,12 @@
 local subopts opt usecc
 
 subopts=()
-while getopts ':O:C' opt; do
-  if [[ "$opt" = O ]]; then
-    subopts=( "${(@P)OPTARG}" )
-  else
-    usecc=yes
-  fi
+while [[ "$1" = -(O*|C) ]]; do
+  case "$1" in
+  -C) usecc=yes; shift ;;
+  -O) subopts=( "${(@P)2}" ); shift 2 ;;
+  *)  subopts=( "${(@P)1[3,-1]}" ); shift ;;
+  esac
 done
 
 if compvalues -i "$@"; then