about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorJoshua Krusell <js.shirin@gmail.com>2021-02-03 11:33:47 +0000
committerPeter Stephenson <p.stephenson@samsung.com>2021-02-03 11:33:47 +0000
commit9120d1e841b0813f1c71d55f77c3d18fc8318187 (patch)
tree3e19f9e06f35b27d342e073344ffc79ac2ddbf79 /Src
parent93c4cc0d8f1ad92f5f407a50e98d62bdc7d5c1b4 (diff)
downloadzsh-9120d1e841b0813f1c71d55f77c3d18fc8318187.tar.gz
zsh-9120d1e841b0813f1c71d55f77c3d18fc8318187.tar.xz
zsh-9120d1e841b0813f1c71d55f77c3d18fc8318187.zip
47899: Improve error message from zparseopts.
Diffstat (limited to 'Src')
-rw-r--r--Src/Modules/zutil.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/Modules/zutil.c b/Src/Modules/zutil.c
index 5c96d06c1..c8017d0c0 100644
--- a/Src/Modules/zutil.c
+++ b/Src/Modules/zutil.c
@@ -1873,7 +1873,10 @@ bin_zparseopts(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
 	    while (*++o) {
 		if (!(d = sopts[STOUC(*o)])) {
 		    if (fail) {
-			zwarnnam(nam, "bad option: %c", *o);
+			if (*o != '-')
+			    zwarnnam(nam, "bad option: %c", *o);
+			else
+			    zwarnnam(nam, "bad option: %s", o);
 			return 1;
 		    }
 		    o = NULL;