This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] Add named initializers to argp/argp-parse.c
- From: Ulrich Drepper <drepper at redhat dot com>
- To: Art Haas <ahaas at airmail dot net>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Tue, 18 Feb 2003 16:35:12 -0800
- Subject: Re: [PATCH] Add named initializers to argp/argp-parse.c
- Organization: Red Hat, Inc.
- References: <20030219001301.GA28086@debian>
Art Haas wrote:
> @@ -97,12 +97,32 @@
>
> static const struct argp_option argp_default_options[] =
> {
> - {"help", '?', 0, 0, N_("Give this help list"), -1},
> - {"usage", OPT_USAGE, 0, 0, N_("Give a short usage message")},
> - {"program-name",OPT_PROGNAME,"NAME", OPTION_HIDDEN, N_("Set the program name")},
> - {"HANG", OPT_HANG, "SECS", OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
> - N_("Hang for SECS seconds (default 3600)")},
> - {0, 0}
> + {
> + .name = "help",
> + .key = '?',
> + .doc = N_("Give this help list"),
> + .group = -1
> + },
> + {
I consider this *much* worse then what we have now.
The arrays for arg and getopt have a well-defined order of the elements.
Nobody can change it. Listing the options in this tabular form is not
adding any maintenance burden. And it is much more readable. Just
compare the effort to search for an existing entry, e.g., when adding a
new one.
--
--------------. ,-. 444 Castro Street
Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA
Red Hat `--' drepper at redhat.com `---------------------------