Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: compadd end-of-options



The patch below makes `compadd' accept both `--' and `-' as a marker for 
the end-of-options, the way `print' and `echo' behave (I hadn't
noticed that they accept a single hyphen for that).

Bye
 Sven

--- os/Zle/compctl.c	Mon Feb 15 12:51:55 1999
+++ Src/Zle/compctl.c	Fri Feb 19 10:17:31 1999
@@ -1685,6 +1685,10 @@
 	return 1;
     }
     for (; *argv && **argv ==  '-'; argv++) {
+	if (!(*argv)[1]) {
+	    argv++;
+	    break;
+	}
 	for (p = *argv + 1; *p; p++) {
 	    sp = NULL;
 	    dm = 0;
--- od/Zsh/compwid.yo	Tue Feb 16 15:02:19 1999
+++ Doc/Zsh/compwid.yo	Fri Feb 19 10:22:32 1999
@@ -300,7 +300,7 @@
 option tt(AUTO_MENU) is set, the completion code will immediatly
 switch to menucompletion.
 )
-item(tt(--))(
+item(tt(-), tt(--))(
 This flag ends the list of flags and options. All arguments after it
 will be taken as the words to use as matches even if they begin with
 hyphens.

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author