diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-15 05:48:16 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-15 05:48:16 +0000 |
commit | 9e5aeab8bd5015c50a3c7087e84b68aee1457a89 (patch) | |
tree | a219681c12d1765f0429bd62b03b9f0e83fc77eb /gcc/opts.c | |
parent | 8788f6739cb63e15847d8245d526d5b1fdb63551 (diff) | |
download | ppe42-gcc-9e5aeab8bd5015c50a3c7087e84b68aee1457a89.tar.gz ppe42-gcc-9e5aeab8bd5015c50a3c7087e84b68aee1457a89.zip |
* c-opts.c (print_help): Remove.
(c_common_handle_option): Don't handle --help.
* c.opt: Document some options.
(--help): Remove.
* opts.c (print_filtered_help): New.
(print_help): Use it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69383 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts.c')
-rw-r--r-- | gcc/opts.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/gcc/opts.c b/gcc/opts.c index 64f5ec6cda3..7a203dcc2ec 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -139,6 +139,7 @@ static void complain_wrong_lang (const char *, const struct cl_option *, static void handle_options (unsigned int, const char **, unsigned int); static void wrap_help (const char *help, const char *item, int item_width); static void print_help (void); +static void print_filtered_help (unsigned int flag); /* Perform a binary search to find which option the command-line INPUT matches. Returns its index in the option array, and N_OPTS @@ -1485,16 +1486,45 @@ fast_math_flags_set_p (void) static void print_help (void) { + size_t i; + + puts (_("The following options are language-independent:\n")); + + print_filtered_help (CL_COMMON); + + for (i = 0; lang_names[i]; i++) + { + printf (_("\nThe %s front end recognizes the following options:\n"), + lang_names[i]); + print_filtered_help (1U << i); + } + + puts ( "\n" ); + display_help (); +} + +/* Print help for a specific front-end, etc. */ +static void +print_filtered_help (unsigned int flag) +{ size_t i, len; + unsigned int filter; - puts (_("\nThe following options are language-independent:\n")); + /* Don't print COMMON options twice. */ + filter = flag; + if (flag != CL_COMMON) + filter |= CL_COMMON; for (i = 0; i < cl_options_count; i++) { - const char *help = cl_options[i].help; + const char *help; const char *opt, *tab; + if ((cl_options[i].flags & filter) != flag) + continue; + /* During transition, ignore switches with no help. */ + help = cl_options[i].help; if (!help) continue; @@ -1516,9 +1546,6 @@ print_help (void) wrap_help (help, opt, len); } - - puts ( "\n" ); - display_help (); } /* Output ITEM, of length ITEM_WIDTH, in the left column, followed by |