summaryrefslogtreecommitdiff
path: root/Src/Zle/complete.c
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-03-11 22:18:11 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-03-11 22:19:09 +0000
commitc82ce14950c327d45fe8a1dfece0f883a420641a (patch)
tree17a47ec1bf15ddd9b32e0955a94de5194ea1d2a8 /Src/Zle/complete.c
parent527badc237cf1afd44c7215838ce69ae28dd35d8 (diff)
downloadzsh-c82ce14950c327d45fe8a1dfece0f883a420641a.tar.gz
zsh-c82ce14950c327d45fe8a1dfece0f883a420641a.zip
38135: internal: bin_compadd: Add a few comments.
Diffstat (limited to 'Src/Zle/complete.c')
-rw-r--r--Src/Zle/complete.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index ee4e5b0a5..30fab541a 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -704,15 +704,18 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
}
if (sp) {
if (p[1]) {
+ /* Pasted argument: -Xfoo. */
if (!*sp)
*sp = p + 1;
p = "" - 1;
} else if (argv[1]) {
+ /* Argument in a separate word: -X foo. */
argv++;
if (!*sp)
*sp = *argv;
p = "" - 1;
} else {
+ /* Missing argument: argv[N] == "-X", argv[N+1] == NULL. */
zwarnnam(name, e, *p);
zsfree(mstr);
return 1;