From 6b852a2f0f3df20702e44b1f6068661673ae9e3c Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 17 Sep 2013 01:08:12 +0100 Subject: Include git revision with -v output --- src/main.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 99f71351..253c9237 100644 --- a/src/main.c +++ b/src/main.c @@ -19,10 +19,13 @@ * along with Profanity. If not, see . * */ - +#include #include #include "config.h" +#ifdef HAVE_GIT_VERSION +#include "gitversion.c" +#endif #include "profanity.h" @@ -55,7 +58,17 @@ main(int argc, char **argv) g_option_context_free(context); if (version == TRUE) { - g_print("Profanity, version %s\n", PACKAGE_VERSION); + + if (strcmp(PACKAGE_STATUS, "development") == 0) { +#ifdef HAVE_GIT_VERSION + g_print("Profanity, version %sdev.%s.%s\n", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION); +#else + g_print("Profanity, version %sdev\n", PACKAGE_VERSION); +#endif + } else { + g_print("Profanity, version %s\n", PACKAGE_VERSION); + } + g_print("Copyright (C) 2012, 2013 James Booth <%s>.\n", PACKAGE_BUGREPORT); g_print("License GPLv3+: GNU GPL version 3 or later \n"); g_print("\n"); -- cgit 1.4.1-2-gfad0