Re: [PATCH] parse-options: Allow abbreviated options when unambiguous

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@xxxxxxxxxx
OOO                                                http://www.madism.org

Attachment: pgpH4nGeeMP7l.pgp
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux