From 20030c86dc6230f4d315d265395022d44226a1f7 Mon Sep 17 00:00:00 2001
From: midipix <writeonce@midipix.org>
Date: Wed, 21 Dec 2022 14:11:26 +0000
Subject: argv.h: argv_show_error(): refine the 'option X requires a value'
 error msg.

---
 src/internal/argv/argv.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/internal')

diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h
index 910425c..973983a 100644
--- a/src/internal/argv/argv.h
+++ b/src/internal/argv/argv.h
@@ -563,7 +563,9 @@ static void argv_show_error(int fd, struct argv_ctx * ctx)
 				opt_short_name[0] ? "-" : "",
 				opt_short_name,
 				opt_short_name[0] ? "," : "",
-				ctx->erropt->long_name ? "--" : "",
+				ctx->erropt->long_name
+					? (ctx->erropt->flags & ARGV_OPTION_HYBRID_ONLY) ? "-" : "--"
+					: "",
 				ctx->erropt->long_name,
 				ctx->erropt->paradigm ? "one of the following values:" : "a value",
 				ctx->erropt->paradigm ? "{" : "",
-- 
cgit v1.2.3