From 755f8571d49a07e85dc77d01f6ccb3944a3abdcb Mon Sep 17 00:00:00 2001 From: dana Date: Fri, 1 Dec 2017 01:12:15 -0600 Subject: 42063: getopts errors now report "+" in front of option where appropriate --- ChangeLog | 5 +++++ Src/builtin.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3efa686c6..e3aaac737 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-12-01 Peter Stephenson + + * dana: 42063: Src/builtin.c: getopts errors now report "+" if + appropriate for option. + 2017-11-24 Daniel Shahaf * 42031 + 42048: Doc/Zsh/cond.yo, Doc/Zsh/options.yo, README, diff --git a/Src/builtin.c b/Src/builtin.c index 0ff9e4f16..f002b9912 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -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; -- cgit 1.4.1