[sheepdog] [PATCH 0/6] introduce sd_getopt to parse command line options

Liu Yuan namei.unix at gmail.com
Tue Nov 6 04:01:38 CET 2012


On 11/06/2012 12:02 AM, MORITA Kazutaka wrote:
> prefix' sounds a bit strange to me because most of options doesn't
> require <key>=<value> pairs.  For example, when '-p 7000' or '-c
> corosync' is given, calling '7000' or 'corosync' prefix isn't strange?
> I think that <key>=<value> pairs are just attributes.  Rather than
> generalizing syntax, I think enumerating acceptable syntaxes looks
> easy to understand:
> 
>   [no arugment]
>   --<option>
>   --<option> <key>=<value>[,<key>=<value>[,...]]
> 
>   [require arugment]
>   --<option> <arg>
>   --<option> <arg>:<key>=<value>[,<key>=<value>[,...]]
> 

This looks a bit more confusing for 'no argument' case.

> Or, if we wouldn't keep backward compatibility at all, the following
> syntax might be better.
> 
>   --<option> [option[,option[,...]]]
> 
>     where option is <arg> or <key>=<value>.

I think use XXX:para,para,para is more clear. But if above scheme is
easier to implement, it is okay for me. We already break the backward
compatibility, so nothing to keep.

Thanks,
Yuan



More information about the sheepdog mailing list