2009-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ PR middle-end/37805
+ * opts.c (print_specific_help): In addition to `undocumented',
+ accept `separate' and `joined' flags if passed alone. Describe
+ output by the first matched one of those.
+ (common_handle_option): Skip over empty strings.
+ * gcc.c (display_help): Fix help string for `--help='.
+ * doc/invoke.texi (Option Summary, Overall Options): With
+ `--help=', classes and qualifiers can both be repeated, but
+ only the latter can be negated. One should not pass only
+ negated qualifiers. Fix markup and examples.
+
Revert
2008-10-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/37805
@item Overall Options
@xref{Overall Options,,Options Controlling the Kind of Output}.
@gccoptlist{-c -S -E -o @var{file} -combine -pipe -pass-exit-codes @gol
--x @var{language} -v -### --help@r{[}=@var{class}@r{]} --target-help @gol
+-x @var{language} -v -### --help@r{[}=@var{class}@r{[},@dots{}@r{]]} --target-help @gol
--version -wrapper@@@var{file}}
@item C Language Options
line options for each tool. For some targets extra target-specific
information may also be printed.
-@item --help=@var{class}@r{[},@var{qualifier}@r{]}
+@item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
Print (on the standard output) a description of the command line
-options understood by the compiler that fit into a specific class.
-The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
-@samp{params}, or @var{language}:
+options understood by the compiler that fit into all specified classes
+and qualifiers. These are the supported classes:
@table @asis
@item @samp{optimizers}
This will display the options that are common to all languages.
@end table
-It is possible to further refine the output of the @option{--help=}
-option by adding a comma separated list of qualifiers after the
-class. These can be any from the following list:
+These are the supported qualifiers:
@table @asis
@item @samp{undocumented}
@end smallexample
The sense of a qualifier can be inverted by prefixing it with the
-@var{^} character, so for example to display all binary warning
+@samp{^} character, so for example to display all binary warning
options (i.e., ones that are either on or off and that do not take an
argument), which have a description the following can be used:
--help=warnings,^joined,^undocumented
@end smallexample
-A class can also be used as a qualifier, although this usually
+The argument to @option{--help=} should not consist solely of inverted
+qualifiers.
+
+Combining several classes is possible, although this usually
restricts the output by so much that there is nothing to display. One
case where it does work however is when one of the classes is
@var{target}. So for example to display all the target-specific
are enabled at @option{-O2} by using:
@smallexample
--O2 --help=optimizers
+-Q -O2 --help=optimizers
@end smallexample
Alternatively you can discover which binary optimizations are enabled
fputs (_(" -pass-exit-codes Exit with highest error code from a phase\n"), stdout);
fputs (_(" --help Display this information\n"), stdout);
fputs (_(" --target-help Display target specific command line options\n"), stdout);
- fputs (_(" --help={target|optimizers|warnings|undocumented|params}[,{[^]joined|[^]separate}]\n"), stdout);
+ fputs (_(" --help={target|optimizers|warnings|params|[^]{joined|separate|undocumented}}[,...]\n"), stdout);
fputs (_(" Display specific types of command line options\n"), stdout);
if (! verbose_flag)
fputs (_(" (Use '-v --help' to display command line options of sub-processes)\n"), stdout);
default:
if (i >= cl_lang_count)
break;
- if ((exclude_flags & ((1U << cl_lang_count) - 1)) != 0)
+ if (exclude_flags & all_langs_mask)
description = _("The following options are specific to just the language ");
else
description = _("The following options are supported by the language ");
{
if (any_flags == 0)
{
- if (include_flags == CL_UNDOCUMENTED)
+ if (include_flags & CL_UNDOCUMENTED)
description = _("The following options are not documented");
+ else if (include_flags & CL_SEPARATE)
+ description = _("The following options take separate arguments");
+ else if (include_flags & CL_JOINED)
+ description = _("The following options take joined arguments");
else
{
internal_error ("unrecognized include_flags 0x%x passed to print_specific_help",
len = strlen (a);
else
len = comma - a;
+ if (len == 0)
+ {
+ a = comma + 1;
+ continue;
+ }
/* Check to see if the string matches an option class name. */
for (i = 0, specific_flag = 0; specifics[i].string != NULL; i++)
specific_flag = specifics[i].flag;
break;
}
-
+
/* Check to see if the string matches a language name.
Note - we rely upon the alpha-sorted nature of the entries in
the lang_names array, specifically that shorter names appear