1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-05 11:01:13 +02:00

42063: getopts errors now report "+" in front of option where appropriate

This commit is contained in:
dana 2017-12-01 01:12:15 -06:00 committed by Peter Stephenson
parent 77a39b57bf
commit 755f8571d4
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2017-12-01 Peter Stephenson <p.stephenson@samsung.com>
* dana: 42063: Src/builtin.c: getopts errors now report "+" if
appropriate for option.
2017-11-24 Daniel Shahaf <d.s@daniel.shahaf.name>
* 42031 + 42048: Doc/Zsh/cond.yo, Doc/Zsh/options.yo, README,

View file

@ -5442,8 +5442,9 @@ bin_getopts(UNUSED(char *name), char **argv, UNUSED(Options ops), UNUSED(int fun
if(quiet) {
zoptarg = metafy(optbuf, lenoptbuf, META_DUP);
} else {
zwarn(*p == '?' ? "bad option: -%c" :
"argument expected after -%c option", opch);
zwarn(*p == '?' ? "bad option: %c%c" :
"argument expected after %c%c option",
"?-+"[lenoptbuf], opch);
zoptarg=ztrdup("");
}
return 0;