diff options
author | Lewis Hyatt <lhyatt@gmail.com> | 2020-03-23 14:37:02 -0400 |
---|---|---|
committer | Lewis Hyatt <lhyatt@gmail.com> | 2020-03-23 14:37:02 -0400 |
commit | d326e9586b405adf7da766b54aa4dbd382d98c2a (patch) | |
tree | 457bd1266e906f6f5ad2569431977d5d892d264e /gcc/opts.c | |
parent | 88c9a831f3a54a17e9722e15cb99459e21bccaad (diff) | |
download | gcc-d326e9586b405adf7da766b54aa4dbd382d98c2a.zip gcc-d326e9586b405adf7da766b54aa4dbd382d98c2a.tar.gz gcc-d326e9586b405adf7da766b54aa4dbd382d98c2a.tar.bz2 |
driver: Improve the generated help text for alias options
gcc/ChangeLog:
2020-03-23 Lewis Hyatt <lhyatt@gmail.com>
* opts.c (print_filtered_help): Improve the help text for alias options.
Diffstat (limited to 'gcc/opts.c')
-rw-r--r-- | gcc/opts.c | 29 |
1 files changed, 23 insertions, 6 deletions
@@ -1315,14 +1315,31 @@ print_filtered_help (unsigned int include_flags, if (option->alias_target < N_OPTS && cl_options [option->alias_target].help) { + const struct cl_option *target = cl_options + option->alias_target; if (option->help == NULL) { - /* For undocumented options that are aliases for other options - that are documented, point the reader to the other option in - preference of the former. */ - snprintf (new_help, sizeof new_help, - _("Same as %s. Use the latter option instead."), - cl_options [option->alias_target].opt_text); + /* The option is undocumented but is an alias for an option that + is documented. If the option has alias arguments, then its + purpose is to provide certain arguments to the other option, so + inform the reader of this. Otherwise, point the reader to the + other option in preference to the former. */ + + if (option->alias_arg) + { + if (option->neg_alias_arg) + snprintf (new_help, sizeof new_help, + _("Same as %s%s (or, in negated form, %s%s)."), + target->opt_text, option->alias_arg, + target->opt_text, option->neg_alias_arg); + else + snprintf (new_help, sizeof new_help, + _("Same as %s%s."), + target->opt_text, option->alias_arg); + } + else + snprintf (new_help, sizeof new_help, + _("Same as %s."), + target->opt_text); } else { |