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

Liu Yuan namei.unix at gmail.com
Mon Nov 5 15:48:41 CET 2012


On 11/05/2012 06:51 PM, morita.kazutaka at gmail.com wrote:
> This series introduces sd_getopt to parse command line options, which
> aims for us to maintain sheep options easily.  With this patch, what
> we need to do to add a command line option is only modifying a
> sheep_option variable; short options, long options, and help message
> will be automatically generated.
> 
> All command options must follow the folllowing syntax.
>   --<option> [<arg>[:<key>=<value>[,<key>=<value>[,...]]]]

generalized as '--<option> [<prefix>[:<key>=<value>[,<key>=<value>[,...]]]]

besides sd_opt_get_value(key), I'd suggest add yet another helper named
sd_opt_get_prefix(opt). 'opt->arg.str' isn't self-explanatory.

Thanks,
Yuan



More information about the sheepdog mailing list