From: Hugo Villeneuve Date: Thu, 10 Apr 2014 02:01:20 +0000 (-0400) Subject: Add version option for gnits automake mode X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=7b28f309d313b9ff2c867d523ab017095ebc274f;p=hvgrip.git Add version option for gnits automake mode --- diff --git a/src/main.c b/src/main.c index 74ff8f7..ba35a4b 100644 --- a/src/main.c +++ b/src/main.c @@ -42,6 +42,7 @@ static int force_small=FALSE; static int local_mode=FALSE; static int no_redirect=FALSE; static int verbose=FALSE; +static int version=FALSE; struct poptOption options[] = { { @@ -116,6 +117,15 @@ struct poptOption options[] = { N_("Run in verbose (debug) mode"), NULL }, + { + "version", + '\0', + POPT_ARG_NONE, + &version, + 0, + N_("Print version number"), + NULL + }, POPT_AUTOHELP { NULL, @@ -173,6 +183,11 @@ int Cmain(int argc, char* argv[]) exit(1); } + if (version) { + printf("%s\n", PACKAGE_VERSION); + exit(0); + } + bind_textdomain_codeset(PACKAGE_TARNAME, "UTF8"); setenv("CHARSET","UTF-8",1);