From 9a9130f26d8df2c1fe2051c5881e0da804ba8e9c Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 11 Feb 2013 09:34:22 +0100 Subject: [PATCH 1/1] options: no longer document warnings when diagnosing an invalid -W The argmatch functions accept prefixes of the alternatives (like getopt does for long options). Bison uses this to document the warning categories. This is troublesome: it duplicates the --help documentation, it is not gettextized, it is displayed with ugly quotes (because argmatch uses it to display the list of possible answers), and it prevents straighforward uses of the tables of valid warning categories (for instance so that warning diagnostics end with the name of the warning). The "hidden" option --trace uses the same trick, but it does not need to be translated, nor to be described in --help. * src/getargs.c (warnings_args): Remove pseudo documentation. Comment changes. --- src/getargs.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/getargs.c b/src/getargs.c index 97191ef3..fe6c1d42 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -196,8 +196,6 @@ ARGMATCH_VERIFY (report_args, report_types); static const char * const trace_args[] = { - /* In a series of synonyms, present the most meaningful first, so - that argmatch_valid be more readable. */ "none - no traces", "scan - grammar scanner traces", "parse - grammar parser traces", @@ -244,18 +242,16 @@ ARGMATCH_VERIFY (trace_args, trace_types); static const char * const warnings_args[] = { - /* In a series of synonyms, present the most meaningful first, so - that argmatch_valid be more readable. */ - "none - no warnings", - "midrule-values - unset or unused midrule values", - "yacc - incompatibilities with POSIX Yacc", - "conflicts-sr - S/R conflicts", - "conflicts-rr - R/R conflicts", - "deprecated - obsolete constructs", - "precedence - useless precedence and associativity", - "other - all other warnings", - "all - all of the above", - "error - warnings are errors", + "none", + "midrule-values", + "yacc", + "conflicts-sr", + "conflicts-rr", + "deprecated", + "precedence", + "other", + "all", + "error", 0 }; -- 2.45.2