Commit 7854f629 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

bin: factor version display.

* src/bin/common_setup.cc (display_version): New function.
(setup): Hook the display_version function.
(argp_program_bug_address): Define this common variable here.
* src/bin/genltl.cc, src/bin/ltl2tgba.cc, src/bin/ltl2tgta.cc,
src/bin/ltlfilt.cc, src/bin/randltl.cc (argp_program_bug_address,
argp_program_version): Remove these definitions.
parent 489f719d
......@@ -20,6 +20,21 @@
// 02111-1307, USA.
#include "common_setup.hh"
#include "argp.h"
const char* argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
static void
display_version(FILE *stream, struct argp_state*)
{
fputs(program_name, stream);
fputs(" (" PACKAGE_STRING ")\n\
\n\
Copyright (C) 2012 Laboratoire de Recherche et Développement de l'Epita.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,\n\
to the extent permitted by law.\n", stream);
}
void
setup(char** argv)
......@@ -28,4 +43,6 @@ setup(char** argv)
// errors and display help text.
set_program_name(argv[0]);
argv[0] = const_cast<char*>(program_name);
argp_program_version_hook = display_version;
}
......@@ -81,7 +81,6 @@
#include "common_output.hh"
#include "common_range.hh"
#include "misc/_config.h"
#include <cassert>
#include <iostream>
#include <sstream>
......@@ -96,16 +95,6 @@
using namespace spot;
using namespace spot::ltl;
const char* argp_program_version = "\
genltl (" SPOT_PACKAGE_STRING ")\n\
\n\
Copyright (C) 2012 Laboratoire de Recherche et Développement de l'Epita.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,\n\
to the extent permitted by law.";
const char* argp_program_bug_address = "<" SPOT_PACKAGE_BUGREPORT ">";
const char argp_program_doc[] ="\
Generate temporal logic formulas from predefined scalable patterns.";
......
......@@ -33,7 +33,6 @@
#include "common_finput.hh"
#include "common_post.hh"
#include "misc/_config.h"
#include "ltlvisit/simplify.hh"
#include "tgbaalgos/dotty.hh"
#include "tgbaalgos/lbtt.hh"
......@@ -43,16 +42,6 @@
#include "tgbaalgos/stats.hh"
#include "tgba/bddprint.hh"
const char* argp_program_version = "\
ltl2tgba (" SPOT_PACKAGE_STRING ")\n\
\n\
Copyright (C) 2012 Laboratoire de Recherche et Développement de l'Epita.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,\n\
to the extent permitted by law.";
const char* argp_program_bug_address = "<" SPOT_PACKAGE_BUGREPORT ">";
const char argp_program_doc[] ="\
Translate linear-time formulas (LTL/PSL) into Büchi automata.\n\n\
By default it will apply all available optimizations to output \
......
......@@ -34,7 +34,6 @@
#include "common_finput.hh"
#include "common_post.hh"
#include "misc/_config.h"
#include "ltlparse/public.hh"
#include "ltlvisit/simplify.hh"
#include "tgbaalgos/dotty.hh"
......@@ -46,16 +45,6 @@
#include "taalgos/dotty.hh"
#include "taalgos/minimize.hh"
const char* argp_program_version = "\
ltl2tgta (" SPOT_PACKAGE_STRING ")\n\
\n\
Copyright (C) 2012 Laboratoire de Recherche et Développement de l'Epita.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,\n\
to the extent permitted by law.";
const char* argp_program_bug_address = "<" SPOT_PACKAGE_BUGREPORT ">";
const char argp_program_doc[] ="\
Translate linear-time formulas (LTL/PSL) into Testing Automata.\n\n\
By default it outputs a transition-based generalized Testing Automaton \
......
......@@ -35,7 +35,6 @@
#include "common_cout.hh"
#include "common_r.hh"
#include "misc/_config.h"
#include "misc/hash.hh"
#include "ltlvisit/simplify.hh"
#include "ltlvisit/length.hh"
......@@ -47,16 +46,6 @@
#include "tgbaalgos/minimize.hh"
#include "tgbaalgos/safety.hh"
const char* argp_program_version = "\
ltlfilter (" SPOT_PACKAGE_STRING ")\n\
\n\
Copyright (C) 2012 Laboratoire de Recherche et Développement de l'Epita.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,\n\
to the extent permitted by law.";
const char* argp_program_bug_address = "<" SPOT_PACKAGE_BUGREPORT ">";
const char argp_program_doc[] ="\
Read a list of formulas and output them back after some optional processing.\v\
Exit status:\n\
......
......@@ -33,7 +33,6 @@
#include "common_range.hh"
#include "common_r.hh"
#include "misc/_config.h"
#include <sstream>
#include "ltlast/atomic_prop.hh"
#include "ltlast/multop.hh"
......@@ -46,16 +45,6 @@
#include "misc/random.hh"
#include "misc/hash.hh"
const char* argp_program_version = "\
randltl (" SPOT_PACKAGE_STRING ")\n\
\n\
Copyright (C) 2012 Laboratoire de Recherche et Développement de l'Epita.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,\n\
to the extent permitted by law.";
const char* argp_program_bug_address = "<" SPOT_PACKAGE_BUGREPORT ">";
const char argp_program_doc[] ="\
Generate random temporal logic formulas.\v\
Examples:\n\
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment