about summary refs log tree commit diff
path: root/Src/Zle/complete.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/complete.c')
-rw-r--r--Src/Zle/complete.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 574e638ac..106e0ddab 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -435,6 +435,7 @@ bin_compadd(char *name, char **argv, char *ops, int func)
     dat.match = NULL;
     dat.flags = 0;
     dat.aflags = CAF_MATCH;
+    dat.dummies = 0;
 
     for (; *argv && **argv ==  '-'; argv++) {
 	if (!(*argv)[1]) {
@@ -565,6 +566,23 @@ bin_compadd(char *name, char **argv, char *ops, int func)
 	    case 'l':
 		dat.flags |= CMF_DISPLINE;
 		break;
+	    case 'E':
+                if (p[1]) {
+                    dat.dummies = atoi(p + 1);
+                    p = "" - 1;
+                } else if (argv[1]) {
+                    argv++;
+                    dat.dummies = atoi(*argv);
+                    p = "" - 1;
+                } else {
+                    zwarnnam(name, "number expected after -%c", NULL, *p);
+                    return 1;
+                }
+                if (dat.dummies < 0) {
+                    zwarnnam(name, "invalid number: %d", NULL, dat.dummies);
+                    return 1;
+                }
+		break;
 	    case '-':
 		argv++;
 		goto ca_args;