[sheepdog] [PATCH] dog: fix dog help messages output

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Wed Mar 18 02:42:01 CET 2015


At Tue, 17 Mar 2015 15:43:29 +0800,
Meng Lingkun wrote:
> 
> When a subcommand given by argv[3], always output help messages incorrectly.
> For example: dog vdi object location|map|dump-inode, always output location's
> help messages instead of map's or dump-inode's. So fix it.
> 
> Signed-off-by: Meng Lingkun <menglingkun at cmss.chinamobile.com>
> ---
>  dog/common.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)

Applied, thanks.
Hitoshi

> 
> diff --git a/dog/common.c b/dog/common.c
> index 6ff1e19..0f73b2c 100644
> --- a/dog/common.c
> +++ b/dog/common.c
> @@ -255,14 +255,13 @@ int do_generic_subcommand(struct subcommand *sub, int argc, char **argv)
>  		exit(EXIT_USAGE);
>  	}
>  
> -	subcmd_stack[++subcmd_depth] = sub;
> -
>  	for (i = 0; sub[i].name; i++) {
>  		unsigned long flags;
>  
>  		if (strcmp(sub[i].name, argv[optind]))
>  			continue;
>  
> +		subcmd_stack[++subcmd_depth] = &sub[i];
>  		flags = sub[i].flags;
>  
>  		if (flags & CMD_NEED_NODELIST) {
> -- 
> 1.7.1
> 
> 
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> https://lists.wpkg.org/mailman/listinfo/sheepdog



More information about the sheepdog mailing list