about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Completion/Base/_arguments6
-rw-r--r--Completion/Base/_values2
-rw-r--r--Completion/User/_bison6
-rw-r--r--Src/Zle/computil.c14
4 files changed, 19 insertions, 9 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index a948d27e4..18ddf0327 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -71,7 +71,7 @@ if (( long )); then
 
     lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(${~words[1]} --help 2>&1)//\[--/
 --}:#[ 	]#-*}//,/
-}}:#[ 	]#--*}#*--}%%[, ]*}:#}")
+}}:#[ 	]#--*}#*--}%%[], ]*}:#}")
 
     # Now remove all ignored options ...
 
@@ -227,7 +227,8 @@ if comparguments -i "$compconfig[autodescribe_options]" "$@"; then
 
     if [[ -z "$matched" ]] &&
        comparguments -O next direct odirect equal &&
-       [[ ( ( nm -eq compstate[nmatches] || -n "$noargs" ) && -z "$aret" ) ||
+       [[ ( ( nm -eq compstate[nmatches] || -n "$noargs" ) &&
+            -z "$aret" && -z "$mesg" ) ||
           -z "$compconfig[option_prefix]" || 
           "$compconfig[option_prefix]" = *\!${cmd}* ||
           "$PREFIX" = [-+]* ]]; then
@@ -246,6 +247,7 @@ if comparguments -i "$compconfig[autodescribe_options]" "$@"; then
 	  compadd "$expl[@]" -QqS= - "${PREFIX}${SUFFIX}"
         else
 	  tmp1=( "$next[@]" "$direct[@]" "$odirect[@]" "$equal[@]" )
+	  tmp1=( "${(M@)tmp1:#[-+]?(|:*)}" )
 	  tmp2=( "${PREFIX}${(@M)^${(@)${(@)tmp1%%:*}#[-+]}:#?}" )
 
           _describe -o -c "$cmd" option tmp1 tmp2 -Q -S ''
diff --git a/Completion/Base/_values b/Completion/Base/_values
index 0c8f19a9f..fb70f6e7f 100644
--- a/Completion/Base/_values
+++ b/Completion/Base/_values
@@ -36,7 +36,7 @@ if compvalues -i "$@"; then
     else
       compvalues -d descr
       if [[ ${#noargs}+${#args}+${#opts} -ne 1 ]] && compvalues -s sep; then
-        sep=( "-qQS$sep" )
+        sep=( "-qQS" "$sep" )
       else
         sep=()
       fi
diff --git a/Completion/User/_bison b/Completion/User/_bison
index 2fd5b3827..dc0aa8ea8 100644
--- a/Completion/User/_bison
+++ b/Completion/User/_bison
@@ -1,14 +1,14 @@
 #compdef bison
 
 _arguments -s \
-  '(--file-prefix)-b[specify output file prefix]:output file prefix:' \
+  '(--file-prefix)-b+[specify output file prefix]:output file prefix:' \
   '(--defines)-d[write token definition file]' \
   '(--raw)-r[output bison token numbers]' \
   '(--token-table)-k[output token table]' \
   '(--no-lines)-l[don'"'"'t generate #line directives]' \
   '(--no-parser)-n[don'"'"'t generate parse (only declarations)]' \
-  '(--output-file)-o[specify parser output file name]:parser file name:_files' \
-  '(--name-prefix)-p[change yy prefix]:prefix string:' \
+  '(--output-file)-o+[specify parser output file name]:parser file name:_files' \
+  '(--name-prefix)-p+[change yy prefix]:prefix string:' \
   '(--debug)-t[output YYDEBUG definition]' \
   '(--verbose)-v[verbose mode]' \
   '(--version)-V[show version]' \
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 9bd52d5c9..2b1409fb3 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -696,7 +696,8 @@ parse_cadef(char *nam, char **args)
 		opt->name = ztrdup(name);
 		if (descr)
 		    opt->descr = ztrdup(descr);
-		else if (adpre && oargs && !oargs->next)
+		else if (adpre && oargs && !oargs->next &&
+			 oargs->descr && oargs->descr[0])
 		    opt->descr = tricat(adpre, oargs->descr, adsuf);
 		else
 		    opt->descr = NULL;
@@ -1118,8 +1119,15 @@ ca_parse_line(Cadef d)
 	    ca_laststate.doff = 0;
 	} else if (cur == compcurrent && !ca_laststate.def) {
 	    if ((ca_laststate.def = ddef)) {
-		ca_laststate.doff = doff;
-		ca_laststate.opt = 0;
+		ca_laststate.singles = state.singles;
+		if (state.curopt && state.curopt->type == CAO_NEXT) {
+		    ca_laststate.ddef = ddef;
+		    ca_laststate.def = NULL;
+		    ca_laststate.opt = 1;
+		} else {
+		    ca_laststate.doff = doff;
+		    ca_laststate.opt = 0;
+		}
 	    } else {
 		ca_laststate.def = adef;
 		ca_laststate.ddef = NULL;