Thread (36 messages) flat view 36 messages, 2 authors, 2016-06-15

Re: [PATCH 2/2] bundle: rewrite builtin to use parse-options

From: Ramkumar Ramachandra <hidden>
Date: 2016-06-15 22:52:35

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help