This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] main.c (captured_main): Alphabetically sort long_options.
- From: dje at google dot com (Doug Evans)
- To: gdb-patches at sourceware dot org
- Date: Mon, 6 Dec 2010 11:41:28 -0800 (PST)
- Subject: [patch] main.c (captured_main): Alphabetically sort long_options.
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}
};