summary refs log tree commit diff
path: root/Completion/Base
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-03-27 13:03:49 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-03-27 13:03:49 +0000
commite48f71e2165072a813aa91c11b61dae69afc8c3c (patch)
tree3a6db907a0de31d995bd944d595ab1b49dd445b7 /Completion/Base
parentaa9c315cc872f86465a83dba3546ee62317297ba (diff)
downloadzsh-e48f71e2165072a813aa91c11b61dae69afc8c3c.tar.gz
zsh-e48f71e2165072a813aa91c11b61dae69afc8c3c.tar.xz
zsh-e48f71e2165072a813aa91c11b61dae69afc8c3c.zip
make _arguments return 300 only if given the -R option (13790)
Diffstat (limited to 'Completion/Base')
-rw-r--r--Completion/Base/_arguments20
1 files changed, 11 insertions, 9 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 68a7ba848..913e73895 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -4,7 +4,7 @@
 # descriptions given as arguments to this function.
 
 local long cmd="$words[1]" descr mesg subopts opt usecc autod
-local oldcontext="$curcontext" hasopts
+local oldcontext="$curcontext" hasopts rawret
 
 long=$argv[(I)--]
 if (( long )); then
@@ -173,11 +173,12 @@ if (( long )); then
 fi
 
 subopts=()
-while [[ "$1" = -(O*|C) ]]; do
+while [[ "$1" = -(O*|[CR]) ]]; do
   case "$1" in
-  -C) usecc=yes; shift ;;
-  -O) subopts=( "${(@P)2}" ); shift 2 ;;
-  -O*)  subopts=( "${(@P)1[3,-1]}" ); shift ;;
+  -C)  usecc=yes; shift ;;
+  -O)  subopts=( "${(@P)2}" ); shift 2 ;;
+  -O*) subopts=( "${(@P)1[3,-1]}" ); shift ;;
+  -R)  rawret=yes; shift;;
   esac
 done
 
@@ -394,10 +395,11 @@ if (( $# )) && comparguments -i "$autod" "$@"; then
 
   [[ -z "$aret" || -z "$usecc" ]] && curcontext="$oldcontext"
 
-  [[ -n "$aret" ]] && return 300
-
-  [[ -n "$noargs" && nm -eq "$compstate[nmatches]" ]] && _message "$noargs"
-
+  if [[ -n "$aret" ]]; then
+    [[ -n $rawret ]] && return 300
+  else
+    [[ -n "$noargs" && nm -eq "$compstate[nmatches]" ]] && _message "$noargs"
+  fi
   # Set the return value.
 
   [[ nm -ne "$compstate[nmatches]" ]]