From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15789 invoked by alias); 6 Dec 2010 19:41:40 -0000 Received: (qmail 15775 invoked by uid 22791); 6 Dec 2010 19:41:38 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Dec 2010 19:41:33 +0000 Received: from hpaq12.eem.corp.google.com (hpaq12.eem.corp.google.com [172.25.149.12]) by smtp-out.google.com with ESMTP id oB6JfUk5005722 for ; Mon, 6 Dec 2010 11:41:31 -0800 Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.18.118.116]) by hpaq12.eem.corp.google.com with ESMTP id oB6JfSuH003984 for ; Mon, 6 Dec 2010 11:41:29 -0800 Received: by ruffy.mtv.corp.google.com (Postfix, from userid 67641) id 989152461AD; Mon, 6 Dec 2010 11:41:28 -0800 (PST) To: gdb-patches@sourceware.org Subject: [patch] main.c (captured_main): Alphabetically sort long_options. Message-Id: <20101206194128.989152461AD@ruffy.mtv.corp.google.com> Date: Mon, 06 Dec 2010 19:41:00 -0000 From: dje@google.com (Doug Evans) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-12/txt/msg00051.txt.bz2 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 * 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} };