[sheepdog] [PATCH v2] sheep: add --version option for sheep daemon

Liu Yuan namei.unix at gmail.com
Fri Dec 7 03:22:48 CET 2012


On 12/06/2012 03:18 PM, Liu Yuan wrote:
> From: Liu Yuan <tailai.ly at taobao.com>
> 
> Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
> ---
>  v2: exit for '-v'
> 
>  sheep/sheep.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/sheep/sheep.c b/sheep/sheep.c
> index dcffba3..7f4bf26 100644
> --- a/sheep/sheep.c
> +++ b/sheep/sheep.c
> @@ -54,6 +54,7 @@ static struct sd_option sheep_options[] = {
>  	{'P', "pidfile", true, "create a pid file"},
>  	{'s', "disk-space", true, "specify the free disk space in megabytes"},
>  	{'u', "upgrade", false, "upgrade to the latest data layout"},
> +	{'v', "version", false, "show the version"},
>  	{'w', "write-cache", true, "specify the cache type"},
>  	{'y', "myaddr", true, "specify the address advertised to other sheep"},
>  	{'z', "zone", true, "specify the zone id"},
> @@ -498,6 +499,11 @@ int main(int argc, char **argv)
>  		case 'h':
>  			usage(0);
>  			break;
> +		case 'v':
> +			fprintf(stdout, "Sheepdog daemon version %s\n",
> +				PACKAGE_VERSION);
> +			exit(0);
> +			break;
>  		default:
>  			usage(1);
>  			break;
> 

Applied.

Thanks,
Yuan



More information about the sheepdog mailing list