[sheepdog] [PATCH v1] dog: use -s as strict mode option abbr

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Mon Aug 11 10:02:14 CEST 2014


At Mon, 11 Aug 2014 15:46:21 +0800,
Bingpeng Zhu wrote:
> 
> "-t" has been used as the option abbr both for showing
> elapsed time of executing dog command and enabling strict
> mode. Maybe we should leave "-t" for showing elapsed time
> option. When we want to specifiy strict mode for dog cluster
> format command, "-s" is a suitable option abbr since it is
> not used by any other dog cluster subcommand option now.
> 
> Signed-off-by: Bingpeng Zhu <bingpeng.zbp at alibaba-inc.com>
> ---
>  dog/cluster.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

-t for strict mode is added first and it is already available in
stable-0.8. For keeping compatibility, changing the option for
measuring time would be good. How about -T?

Thanks,
Hitoshi

> 
> diff --git a/dog/cluster.c b/dog/cluster.c
> index 6649507..80cd2c1 100644
> --- a/dog/cluster.c
> +++ b/dog/cluster.c
> @@ -23,7 +23,7 @@ static struct sd_option cluster_options[] = {
>  	{'f', "force", false, "do not prompt for confirmation"},
>  	{'m', "multithread", false,
>  	 "use multi-thread for 'cluster snapshot save'"},
> -	{'t', "strict", false,
> +	{'s', "strict", false,
>  	 "do not serve write request if number of nodes is not sufficient"},
>  	{ 0, NULL, false, NULL },
>  };
> @@ -747,7 +747,7 @@ failure:
>  static struct subcommand cluster_cmd[] = {
>  	{"info", NULL, "aprhvt", "show cluster information",
>  	 NULL, CMD_NEED_NODELIST, cluster_info, cluster_options},
> -	{"format", NULL, "bctapht", "create a Sheepdog store",
> +	{"format", NULL, "bcsapht", "create a Sheepdog store",
>  	 NULL, CMD_NEED_NODELIST, cluster_format, cluster_options},
>  	{"shutdown", NULL, "apht", "stop Sheepdog",
>  	 NULL, 0, cluster_shutdown, cluster_options},
> @@ -794,7 +794,7 @@ static int cluster_parser(int ch, const char *opt)
>  		break;
>  	case 'm':
>  		cluster_cmd_data.multithread = true;
> -	case 't':
> +	case 's':
>  		cluster_cmd_data.strict = true;
>  		break;
>  	}
> -- 
> 1.7.1
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog



More information about the sheepdog mailing list