Re: [PATCH] parse-options: Allow abbreviated options when unambiguous
On Sun, Oct 14, 2007 at 06:02:33PM +0000, Johannes Schindelin wrote:
Show 26 quoted lines
> Hi,
>
> On Sun, 14 Oct 2007, Johannes Schindelin wrote:
>
> > When there is an option "--amend", the option parser now recognizes
> > "--am" for that option, provided that there is no other option beginning
> > with "--am".
>
> And an amend for ultra-abbreviated options (as you noticed on IRC):
>
> diff --git a/parse-options.c b/parse-options.c
> index afc6c89..acabb98 100644
> --- a/parse-options.c
> +++ b/parse-options.c
> @@ -137,6 +137,11 @@ is_abbreviated:
> abbrev_flags = flags;
> continue;
> }
> + /* negated and abbreviated very much? */
> + if (!prefixcmp("no-", arg)) {
> + flags |= OPT_UNSET;
> + goto is_abbreviated;
> + }
> /* negated? */
> if (strncmp(arg, "no-", 3))
> continue; squashed on top on the previous, and pushed to my ph/parseopt branch.
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org