aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-06-28 14:44:29 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2009-06-28 14:44:29 +0300
commit4b66e93d434d2a4fe8fd3f277e222de768475605 (patch)
treed8e7eba5366ea9356aa1f4ba19f0cf8df5dfc349 /src/main.c
parentd80d146b2c78a9ea114748129cde0fae017bbfbc (diff)
downloadcflow-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.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index 5ad565a..cbb472e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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
25const char *argp_program_version = "cflow (" PACKAGE_NAME ") " VERSION;
26const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; 27const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
27static char doc[] = N_("generate a program flowgraph") 28static char doc[] = N_("generate a program flowgraph")
28"\v" 29"\v"
29N_("* 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."); 30N_("* 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.");
31const char *program_authors[] = {
32 "Sergey Poznyakoff",
33 NULL
34};
30 35
31enum option_code { 36enum 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
735static void
736cflow_version(FILE *stream, struct argp_state *state)
737{
738 version_etc(stream, "cflow", PACKAGE_NAME, PACKAGE_VERSION,
739 "Sergey Poznyakoff", NULL);
740}
741
742int 740int
743main(int argc, char **argv) 741main(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);

Return to:

Send suggestions and report system problems to the System administrator.