Re: [PATCH 1/4] Allow detached form (e.g. "-S foo" instead of "-Sfoo") for diff options

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

 



Jonathan Nieder <jrnieder@xxxxxxxxx> writes:

> Matthieu Moy wrote:
>
>> +++ b/diff.c
>> @@ -2990,9 +2990,23 @@ static int opt_arg(const char *arg, int arg_short, const char *arg_long, int *va
> [...]
>> +#define IF_SHORT_OPT(optname)			\
>> +	((!strcmp(arg, "-" #optname)		\
>> +	  && (argv[1] || (die("Option `" #optname "' requires a value"), 1),	\
>> +	      optarg   = argv[1],	       		\
>> +	      argcount = 2,			\
>> +	      1)) ||				\
>> +	 (!prefixcmp(arg, "-" #optname)		\
>> +	  && (optarg = arg + strlen("-" #optname),	\
>> +	      argcount = 1,			\
>> +	       1)))
>> +
>
> Why not something like this?
>
> 	static inline int short_opt(char opt, const char *arg,
> 					const char *argv, const char **optarg)

Sounds nice too. I'll do that in the next round.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]