diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-06-28 14:44:29 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-06-28 14:44:29 +0300 |
commit | 4b66e93d434d2a4fe8fd3f277e222de768475605 (patch) | |
tree | d8e7eba5366ea9356aa1f4ba19f0cf8df5dfc349 /src/main.c | |
parent | d80d146b2c78a9ea114748129cde0fae017bbfbc (diff) | |
download | cflow-4b66e93d434d2a4fe8fd3f277e222de768475605.tar.gz cflow-4b66e93d434d2a4fe8fd3f277e222de768475605.tar.bz2 |
Minor changes.
* Makefile.am: Improve ChangeLog rule
* configure.ac: Remove AH_BOTTOM
* gnulib.modules: Add argp-version-etc, progname.
Remove version-etc.
* src/main.c: Use argp-version-etc
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -18,15 +18,20 @@ | |||
18 | 18 | ||
19 | #include <cflow.h> | 19 | #include <cflow.h> |
20 | #include <argp.h> | 20 | #include <argp.h> |
21 | #include <argp-version-etc.h> | ||
22 | #include <progname.h> | ||
21 | #include <stdarg.h> | 23 | #include <stdarg.h> |
22 | #include <parser.h> | 24 | #include <parser.h> |
23 | #include <version-etc.h> | 25 | #include <version-etc.h> |
24 | 26 | ||
25 | const char *argp_program_version = "cflow (" PACKAGE_NAME ") " VERSION; | ||
26 | const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; | 27 | const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; |
27 | static char doc[] = N_("generate a program flowgraph") | 28 | static char doc[] = N_("generate a program flowgraph") |
28 | "\v" | 29 | "\v" |
29 | N_("* The effect of each option marked with an asterisk is reversed if the option's long name is prefixed with `no-'. For example, --no-cpp cancels --cpp."); | 30 | N_("* The effect of each option marked with an asterisk is reversed if the option's long name is prefixed with `no-'. For example, --no-cpp cancels --cpp."); |
31 | const char *program_authors[] = { | ||
32 | "Sergey Poznyakoff", | ||
33 | NULL | ||
34 | }; | ||
30 | 35 | ||
31 | enum option_code { | 36 | enum option_code { |
32 | OPT_DEFINES = 256, | 37 | OPT_DEFINES = 256, |
@@ -732,20 +737,13 @@ const char version_etc_copyright[] = | |||
732 | year. */ | 737 | year. */ |
733 | "Copyright %s 2005, 2006, %d Sergey Poznyakoff"; | 738 | "Copyright %s 2005, 2006, %d Sergey Poznyakoff"; |
734 | 739 | ||
735 | static void | ||
736 | cflow_version(FILE *stream, struct argp_state *state) | ||
737 | { | ||
738 | version_etc(stream, "cflow", PACKAGE_NAME, PACKAGE_VERSION, | ||
739 | "Sergey Poznyakoff", NULL); | ||
740 | } | ||
741 | |||
742 | int | 740 | int |
743 | main(int argc, char **argv) | 741 | main(int argc, char **argv) |
744 | { | 742 | { |
745 | int index; | 743 | int index; |
746 | 744 | ||
747 | program_name = argv[0]; /* Until gnulib provides a better way */ | 745 | set_program_name(argv[0]); |
748 | argp_program_version_hook = cflow_version; | 746 | argp_version_setup("cflow", program_authors); |
749 | 747 | ||
750 | setlocale(LC_ALL, ""); | 748 | setlocale(LC_ALL, ""); |
751 | bindtextdomain(PACKAGE, LOCALEDIR); | 749 | bindtextdomain(PACKAGE, LOCALEDIR); |