author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-05-18 13:56:34 (GMT) |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-05-18 13:56:34 (GMT) |
commit | 5b8a539965b55c11fb93bbe2cc145cc792e80e33 (patch) (unidiff) | |
tree | 284e0bc4a48bdaaa484fd93f62d796bf1f046d99 /src | |
parent | 44e8bcf8575dc76411b41f685ba3fcf3e2105e60 (diff) | |
download | cflow-5b8a539965b55c11fb93bbe2cc145cc792e80e33.tar.gz cflow-5b8a539965b55c11fb93bbe2cc145cc792e80e33.tar.bz2 |
Add version-etc module
-rw-r--r-- | src/main.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -20,6 +20,7 @@ | |||
20 | #include <argp.h> | 20 | #include <argp.h> |
21 | #include <stdarg.h> | 21 | #include <stdarg.h> |
22 | #include <parser.h> | 22 | #include <parser.h> |
23 | #include <version-etc.h> | ||
23 | 24 | ||
24 | const char *argp_program_version = "cflow (" PACKAGE_NAME ") " VERSION; | 25 | const char *argp_program_version = "cflow (" PACKAGE_NAME ") " VERSION; |
25 | const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; | 26 | const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; |
@@ -747,12 +748,26 @@ init() | |||
747 | init_parse(); | 748 | init_parse(); |
748 | } | 749 | } |
749 | 750 | ||
751 | const char version_etc_copyright[] = | ||
752 | /* Do *not* mark this string for translation. %s is a copyright | ||
753 | symbol suitable for this locale, and %d is the copyright | ||
754 | year. */ | ||
755 | "Copyright %s 2005, 2006, %d Sergey Poznyakoff"; | ||
756 | |||
757 | static void | ||
758 | cflow_version(FILE *stream, struct argp_state *state) | ||
759 | { | ||
760 | version_etc(stream, "cflow", PACKAGE_NAME, PACKAGE_VERSION, | ||
761 | "Sergey Poznyakoff", NULL); | ||
762 | } | ||
763 | |||
750 | int | 764 | int |
751 | main(int argc, char **argv) | 765 | main(int argc, char **argv) |
752 | { | 766 | { |
753 | int index; | 767 | int index; |
754 | 768 | ||
755 | program_name = argv[0]; /* Until gnulib provides a better way */ | 769 | program_name = argv[0]; /* Until gnulib provides a better way */ |
770 | argp_program_version_hook = cflow_version; | ||
756 | 771 | ||
757 | setlocale(LC_ALL, ""); | 772 | setlocale(LC_ALL, ""); |
758 | bindtextdomain(PACKAGE, LOCALEDIR); | 773 | bindtextdomain(PACKAGE, LOCALEDIR); |