Make all commands print git version and improve version string.
[paraslash.git] / version.h
1 /** \file version.h Macros for printing the version string. */
2
3 #include "git-version.h"
4
5 #define VERSION_SINGLE_LINE(prefix) "para_" prefix \
6 " " GIT_VERSION " (" CODENAME ")"
7
8 /** Version text printed by all executables if -V was given. */
9 #define VERSION_TEXT(prefix) VERSION_SINGLE_LINE(prefix) "\n" \
10 "Copyright (C) 2013 Andre Noll\n" \
11 "This is free software with ABSOLUTELY NO WARRANTY." \
12 " See COPYING for details.\n" \
13 "Report bugs to <maan@systemlinux.org>.\n"
14
15 /** Print out \p VERSION_TEXT and exit if version flag was given. */
16 #define HANDLE_VERSION_FLAG(_prefix, _args_info_struct) \
17 if (_args_info_struct.version_given) { \
18 printf("%s", VERSION_TEXT(_prefix)); \
19 exit(EXIT_SUCCESS); \
20 }
21