summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/computil.c4
-rw-r--r--Test/Y03arguments.ztst21
3 files changed, 29 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d63c2e513..90fd3f891 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-12-20  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* dana: 42145: Src/Zle/computil.c, Test/Y03arguments.ztst: fix
+	for completion option arguments.
+
 2017-12-20  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* 42146: Src/hashtable.c, Test/A02alias.ztst: type -w +=
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 71d61563b..0b1ba58dc 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -2493,7 +2493,9 @@ ca_set_data(LinkList descr, LinkList act, LinkList subc,
 	 * the case above right.
 	 */
 	if (arg->type == CAA_NORMAL &&
-	    opt && optdef && optdef->type == CAO_NEXT)
+	    opt && optdef &&
+	    (optdef->type == CAO_NEXT || optdef->type == CAO_ODIRECT ||
+	     optdef->type == CAO_OEQUAL))
 	    return;
 
 	if (single)
diff --git a/Test/Y03arguments.ztst b/Test/Y03arguments.ztst
index 7cbadfe8c..761b4b1d2 100644
--- a/Test/Y03arguments.ztst
+++ b/Test/Y03arguments.ztst
@@ -237,6 +237,27 @@
 >NO:{-a}
 >NO:{-b}
 
+ tst_arguments '*'{-x+,--xxx=}':optarg:(1)' '*:operand:(a)'
+ comptest $'tst \t'
+ comptest $'tst -x \t'
+ comptest $'tst -x\t'
+ comptest $'tst --xxx=\t'
+ comptest $'tst --xxx \t'
+ comptest $'tst a -x\t'
+ comptest $'tst a -x \t'
+ comptest $'tst a --xxx=\t'
+ comptest $'tst a --xxx \t'
+0:optarg completion following rest operand on line (workers/42141)
+>line: {tst a }{}
+>line: {tst -x 1 }{}
+>line: {tst -x1 }{}
+>line: {tst --xxx=1 }{}
+>line: {tst --xxx 1 }{}
+>line: {tst a -x1 }{}
+>line: {tst a -x 1 }{}
+>line: {tst a --xxx=1 }{}
+>line: {tst a --xxx 1 }{}
+
  tst_arguments '-a' '*::rest:{compadd - -b}'
  comptest $'tst arg -\t'
 0:rest arguments