* [patch] main.c (captured_main): Alphabetically sort long_options.
@ 2010-12-06 19:41 Doug Evans
2010-12-06 20:22 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2010-12-06 19:41 UTC (permalink / raw)
To: gdb-patches
Hi.
fyi, I will check this in in two days if there are no objections.
[I didn't sort the switch(), it was of less use to me.
But I wouldn't object to it being sorted.]
A good next step would be update --help output,
but I was going to wait until after this goes in.
2010-12-06 Doug Evans <dje@google.com>
* main.c (captured_main): Alphabetically sort long_options.
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.87
diff -u -p -r1.87 main.c
--- main.c 22 Sep 2010 19:59:15 -0000 1.87
+++ main.c 6 Dec 2010 19:37:56 -0000
@@ -384,67 +384,71 @@ captured_main (void *data)
OPT_NOWINDOWS,
OPT_WINDOWS
};
+ /* This table is mostly alphabetically sorted.
+ It is, except we keep synonyms together. */
static struct option long_options[] =
{
- {"tui", no_argument, 0, OPT_TUI},
- {"xdb", no_argument, &xdb_commands, 1},
- {"dbx", no_argument, &dbx_commands, 1},
- {"readnow", no_argument, &readnow_symbol_files, 1},
- {"r", no_argument, &readnow_symbol_files, 1},
- {"quiet", no_argument, &quiet, 1},
- {"q", no_argument, &quiet, 1},
- {"silent", no_argument, &quiet, 1},
- {"nx", no_argument, &inhibit_gdbinit, 1},
- {"n", no_argument, &inhibit_gdbinit, 1},
- {"batch-silent", no_argument, 0, 'B'},
+ {"annotate", required_argument, 0, OPT_ANNOTATE},
+ {"args", no_argument, &set_args, 1},
+ {"b", required_argument, 0, 'b'},
+ {"baud", required_argument, 0, 'b'},
{"batch", no_argument, &batch_flag, 1},
+ {"batch-silent", no_argument, 0, 'B'},
+ {"c", required_argument, 0, 'c'},
+ {"core", required_argument, 0, 'c'},
+ {"cd", required_argument, 0, OPT_CD},
+ {"command", required_argument, 0, 'x'},
+ {"x", required_argument, 0, 'x'},
+ {"d", required_argument, 0, 'd'},
+ {"directory", required_argument, 0, 'd'},
+ {"dbx", no_argument, &dbx_commands, 1},
+ {"e", required_argument, 0, 'e'},
+ {"exec", required_argument, 0, 'e'},
+#ifdef GDBTK
+ {"editor-command", required_argument, 0, 'w'},
+ {"enable-external-editor", no_argument, 0, 'y'},
+#endif
{"epoch", no_argument, &epoch_interface, 1},
+ {"eval-command", required_argument, 0, 'X'},
+ {"ex", required_argument, 0, 'X'},
/* This is a synonym for "--annotate=1". --annotate is now preferred,
but keep this here for a long time because people will be running
emacses which use --fullname. */
- {"fullname", no_argument, 0, 'f'},
{"f", no_argument, 0, 'f'},
+ {"fullname", no_argument, 0, 'f'},
- {"annotate", required_argument, 0, OPT_ANNOTATE},
{"help", no_argument, &print_help, 1},
- {"se", required_argument, 0, OPT_SE},
- {"symbols", required_argument, 0, 's'},
- {"s", required_argument, 0, 's'},
- {"exec", required_argument, 0, 'e'},
- {"e", required_argument, 0, 'e'},
- {"core", required_argument, 0, 'c'},
- {"c", required_argument, 0, 'c'},
- {"pid", required_argument, 0, 'p'},
+ {"i", required_argument, 0, 'i'},
+ {"interpreter", required_argument, 0, 'i'},
+ {"ui", required_argument, 0, 'i'},
+ {"l", required_argument, 0, 'l'},
+ {"n", no_argument, &inhibit_gdbinit, 1},
+ {"nowindows", no_argument, NULL, OPT_NOWINDOWS},
+ {"nw", no_argument, NULL, OPT_NOWINDOWS},
+ {"nx", no_argument, &inhibit_gdbinit, 1},
{"p", required_argument, 0, 'p'},
- {"command", required_argument, 0, 'x'},
- {"eval-command", required_argument, 0, 'X'},
- {"version", no_argument, &print_version, 1},
- {"x", required_argument, 0, 'x'},
- {"ex", required_argument, 0, 'X'},
+ {"pid", required_argument, 0, 'p'},
+ {"q", no_argument, &quiet, 1},
+ {"quiet", no_argument, &quiet, 1},
+ {"r", no_argument, &readnow_symbol_files, 1},
+ {"readnow", no_argument, &readnow_symbol_files, 1},
+ {"return-child-result", no_argument, &return_child_result, 1},
+ {"s", required_argument, 0, 's'},
+ {"symbols", required_argument, 0, 's'},
+ {"se", required_argument, 0, OPT_SE},
+ {"silent", no_argument, &quiet, 1},
+ {"statistics", no_argument, 0, OPT_STATISTICS},
#ifdef GDBTK
{"tclcommand", required_argument, 0, 'z'},
- {"enable-external-editor", no_argument, 0, 'y'},
- {"editor-command", required_argument, 0, 'w'},
#endif
- {"ui", required_argument, 0, 'i'},
- {"interpreter", required_argument, 0, 'i'},
- {"i", required_argument, 0, 'i'},
- {"directory", required_argument, 0, 'd'},
- {"d", required_argument, 0, 'd'},
- {"cd", required_argument, 0, OPT_CD},
{"tty", required_argument, 0, 't'},
- {"baud", required_argument, 0, 'b'},
- {"b", required_argument, 0, 'b'},
- {"nw", no_argument, NULL, OPT_NOWINDOWS},
- {"nowindows", no_argument, NULL, OPT_NOWINDOWS},
+ {"tui", no_argument, 0, OPT_TUI},
+ {"version", no_argument, &print_version, 1},
{"w", no_argument, NULL, OPT_WINDOWS},
{"windows", no_argument, NULL, OPT_WINDOWS},
- {"statistics", no_argument, 0, OPT_STATISTICS},
{"write", no_argument, &write_files, 1},
- {"args", no_argument, &set_args, 1},
- {"l", required_argument, 0, 'l'},
- {"return-child-result", no_argument, &return_child_result, 1},
+ {"xdb", no_argument, &xdb_commands, 1},
{0, no_argument, 0, 0}
};
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] main.c (captured_main): Alphabetically sort long_options.
2010-12-06 19:41 [patch] main.c (captured_main): Alphabetically sort long_options Doug Evans
@ 2010-12-06 20:22 ` Tom Tromey
2010-12-06 20:33 ` Doug Evans
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2010-12-06 20:22 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Doug> fyi, I will check this in in two days if there are no objections.
It is fine by me.
Doug> A good next step would be update --help output,
Doug> but I was going to wait until after this goes in.
FWIW I think --help output is most useful when it is broken into
sections, and then sorting is applied in each section. See "tar" or
"automake" for reasonable examples.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] main.c (captured_main): Alphabetically sort long_options.
2010-12-06 20:22 ` Tom Tromey
@ 2010-12-06 20:33 ` Doug Evans
0 siblings, 0 replies; 3+ messages in thread
From: Doug Evans @ 2010-12-06 20:33 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On Mon, Dec 6, 2010 at 12:22 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> fyi, I will check this in in two days if there are no objections.
>
> It is fine by me.
>
> Doug> A good next step would be update --help output,
> Doug> but I was going to wait until after this goes in.
>
> FWIW I think --help output is most useful when it is broken into
> sections, and then sorting is applied in each section. See "tar" or
> "automake" for reasonable examples.
Yeah, good point.
If you compare --help output with the contents of long_options, you'll
see --help is in need of some TLC.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-12-06 20:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-06 19:41 [patch] main.c (captured_main): Alphabetically sort long_options Doug Evans
2010-12-06 20:22 ` Tom Tromey
2010-12-06 20:33 ` Doug Evans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox