--target-help: align with --help=target
Commit Message
Hi.
Before the patch we have:
$ gcc-11 --help | grep target-help
--target-help Display target specific command line options.
$ gcc-11 --help=common | grep target-help
--target-help Alias for --help=target.
and --target-help prints undocumented options (that was reported in the PR).
After my change we do:
$ gcc --help | grep target-help
--target-help Display target specific command line options (including assembler and linker options).
$ gcc --help=common | grep target-help
--target-help Display target specific command line options (including assembler and linker options).
and the undocumented options are not printed.
Ready to be installed after tests?
Thanks,
Martin
PR driver/105096
gcc/ChangeLog:
* common.opt: Document properly based on what it does.
* gcc.cc (display_help): Unify with what we have in common.opt.
* opts.cc (common_handle_option): Do not print undocumented
options.
---
gcc/common.opt | 2 +-
gcc/gcc.cc | 3 ++-
gcc/opts.cc | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
Comments
On 3/31/2022 12:56 AM, Martin Liška wrote:
> Hi.
>
> Before the patch we have:
>
> $ gcc-11 --help | grep target-help
> --target-help Display target specific command line options.
> $ gcc-11 --help=common | grep target-help
> --target-help Alias for --help=target.
>
> and --target-help prints undocumented options (that was reported in
> the PR).
>
> After my change we do:
>
> $ gcc --help | grep target-help
> --target-help Display target specific command line
> options (including assembler and linker options).
> $ gcc --help=common | grep target-help
> --target-help Display target specific command line
> options (including assembler and linker options).
>
> and the undocumented options are not printed.
>
> Ready to be installed after tests?
> Thanks,
> Martin
>
> PR driver/105096
>
> gcc/ChangeLog:
>
> * common.opt: Document properly based on what it does.
> * gcc.cc (display_help): Unify with what we have in common.opt.
> * opts.cc (common_handle_option): Do not print undocumented
> options.
OK
jeff
@@ -419,7 +419,7 @@ Driver Alias(symbolic)
-target-help
Common Driver
-Alias for --help=target.
+Display target specific command line options (including assembler and linker options).
-time
Driver Alias(time)
@@ -3758,7 +3758,8 @@ display_help (void)
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 (_(" --target-help Display target specific command line options "
+ "(including assembler and linker options).\n"), stdout);
fputs (_(" --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].\n"), stdout);
fputs (_(" Display specific types of command line options.\n"), stdout);
if (! verbose_flag)
@@ -2557,7 +2557,7 @@ common_handle_option (struct gcc_options *opts,
break;
target_option_override_hook ();
- print_specific_help (CL_TARGET, CL_UNDOCUMENTED, 0, opts, lang_mask);
+ print_specific_help (CL_TARGET, 0, 0, opts, lang_mask);
opts->x_exit_after_options = true;
break;