Re: [PATCH] Port builtin-add.c to use the new option parser.
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 13, 2007, 14:47 UTC
- Message-ID
- <Pine.LNX.4.64.0710131544030.25221@racer.site>
- In-Reply-To
- <1192282153-26684-3-git-send-email-madcoder@debian.org>
Hi,
On Sat, 13 Oct 2007, Pierre Habouzit wrote:
Show 8 quoted lines
> +static struct option builtin_add_options[] = {
> + OPT_BOOLEAN('i', "interactive", &add_interactive, "interactive picking"),
> + OPT_BOOLEAN('n', NULL, &show_only, "dry-run"),
> + OPT_BOOLEAN('f', NULL, &ignored_too, "allow adding otherwise ignored files"),
> + OPT_BOOLEAN('v', NULL, &verbose, "be verbose"),
> + OPT_BOOLEAN('u', NULL, &take_worktree_changes, "update only files that git already knows about"),
> + OPT_BOOLEAN( 0 , "refresh", &refresh_only, "don't add, only refresh stat() informations in the index"),
> +};I see you terminate the list by a ",". How does this play with the option parser?
Thinking about this more, I am reverting my stance on the ARRAY_SIZE() issue. I think if you introduce a "OPTION_NONE = 0" in the enum, then this single last comma should be enough.
In the same vein, you would not need the NULL in builtin_add_usage[], right?
Ciao, Dscho