[sheepdog] [PATCH 1/2] collie: add self options to collie's command

Yunkai Zhang yunkai.me at gmail.com
Tue Aug 21 03:45:49 CEST 2012


On Tue, Aug 21, 2012 at 12:19 AM, Liu Yuan <namei.unix at gmail.com> wrote:
> On 08/20/2012 10:28 PM, Yunkai Zhang wrote:
>> Now, all collie's command share the same global collie_options, it will
>> lead to option's name conflict among commands if they use the same options
>> but with different description.
>>
>> By introducing self options to each command (if necessary) and make
>> collie_options only contain the common part of all options, we can solve this
>> issue.
>
> I like this improvement, but 'self options' doesn't explain the idea better. This is
> kind of namespace for each sub command, so simply name it as:
>
> +       struct sd_option *options;
>
> in a structure is enough.
>
> And rework the comment and commit log to replace 'self option' with more meaningful
> phrase such as, for e.g, "By moving the global options into individual structure as a
> private member, we can solve this problem"


Good idea, V2 will be given later.

>
> Also, with this patch, we can then change all those upper cased options into lower cases,
> such as vdi create -P -> vdi create -p for easier typing.
>
> --
> thanks,
> Yuan



-- 
Yunkai Zhang
Work at Taobao



More information about the sheepdog mailing list