summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2022-12-21 14:11:26 +0000
committermidipix <writeonce@midipix.org>2022-12-21 14:13:02 +0000
commit8146f52b7b85df5e69edf489dfd6714abf4f51d1 (patch)
treed5f6925e7ee32d524ec877a65affb22b2ef73d7f
parent980d09f40635f74a994fd1a7df20a9a86ec50d58 (diff)
downloadntux-8146f52b7b85df5e69edf489dfd6714abf4f51d1.tar.bz2
ntux-8146f52b7b85df5e69edf489dfd6714abf4f51d1.tar.xz
argv.h: argv_show_error(): refine the 'option X requires a value' error msg.
-rw-r--r--src/internal/argv/argv.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/internal/argv/argv.h b/src/internal/argv/argv.h
index 1d777da..ff5ff85 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 ? "{" : "",