Re: [PATCH 2/2] bundle: rewrite builtin to use parse-options
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Dec 8, 2011, 19:39 UTC
- Message-ID
- <CALkWK0nCuFgS8PKkQLMzqpBsOWouSs5y=CEKS1r0x0=LkhqC9A@mail.gmail.com>
- In-Reply-To
- <20111208175913.GK2394@elie.hsd1.il.comcast.net>
Hi,
Jonathan Nieder wrote:
> What's the desired behavior? Then we can talk about how to implement it. > > If the goal is "use parse-options for a command that has subcommands", > see builtin/notes.c.
Uses strcmp() to match argv[0]. And you can't specify the options for a certain subcommand before the subcommand itself on the command-line, although I don't consider this a serious limitation. I was going for something prettier with subcommand-specific help text, albeit a serious limitation. I'll try working towards this for a few more hours to see if anything useful comes out of it -- otherwise, I'll just drop this patch and focus on eliminating the ugliness in builtin/revert.c around '--continue', '--quit' parsing.
That being said, do you see value in lifting the restriction on opts->long_name and PARSE_OPTS_NODASH not allowed together? The restriction seems quite arbitrary, but I can't justify lifting it unless I can show some valid usecase.
Thanks.
-- Ram