From: Eric Wong Date: Sun, 14 Oct 2007 21:01:30 GMT Subject: Re: [PATCH] parse-options: Allow abbreviated options when unambiguous Message-ID: <20071014210130.GA17675@soma> In-Reply-To: <20071014180815.GK1198@artemis.corp> Pierre Habouzit wrote: > On Sun, Oct 14, 2007 at 06:02:33PM +0000, Johannes Schindelin wrote: > > 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. Awesome. Thanks to both of you. -- Eric Wong