Re: [PATCH] Add a simple option parser.
- From
Pierre Habouzit <madcoder@debian.org>
- Date
- Oct 5, 2007, 14:21 UTC
- Message-ID
- <20071005142140.GK19879@artemis.corp>
- In-Reply-To
- <1191447902-27326-1-git-send-email-krh@redhat.com>
Show 5 quoted lines
> +/* Parse the given options against the list of known options. The > + * order of the option structs matters, in that ambiguous > + * abbreviations (eg, --in could be short for --include or > + * --interactive) are matched by the first option that share the > + * prefix.
Do we really want that ?
I do believe that it's a very bad idea, as it silently breaks. Most of the command line switches people need to use have a short form, or their shell will complete it properly.
A very interesting feature though, would be to finally be able to parse aggregated switches (`git rm -rf` anyone ?).
I also believe that it's a pity that parse_options isn't able to generate the usage by itself. But we can add that later.
I've though an alternate proposal, based on your work, for the first patch.
-- ·O· Pierre Habouzit ··O madcoder@debian.org OOO http://www.madism.org