[sheepdog] [PATCH stable-0.7] dog: print dog version with -h option

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Mon Jan 27 07:15:19 CET 2014


From: Hitoshi Mitake <mitake.hitoshi at gmail.com>

This patch lets dog print its version with -h option (or when it isn't
passed any parameters). It is useful for trouble shooting.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 dog/dog.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dog/dog.c b/dog/dog.c
index df45920..1efcdfb 100644
--- a/dog/dog.c
+++ b/dog/dog.c
@@ -231,7 +231,8 @@ static void usage(const struct command *commands, int status)
 	if (status)
 		sd_err("Try '%s --help' for more information.", program_name);
 	else {
-		printf("Sheepdog administrator utility\n");
+		printf("Sheepdog administrator utility (version %s)\n",
+		       PACKAGE_VERSION);
 		printf("Usage: %s <command> <subcommand> [options]\n", program_name);
 		printf("\nAvailable commands:\n");
 		for (i = 0; commands[i].name; i++) {
-- 
1.7.10.4




More information about the sheepdog mailing list