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.
This commit is contained in:
parent
489f719dc1
commit
7854f629e5
6 changed files with 17 additions and 55 deletions
|
|
@ -20,6 +20,21 @@
|
||||||
// 02111-1307, USA.
|
// 02111-1307, USA.
|
||||||
|
|
||||||
#include "common_setup.hh"
|
#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
|
void
|
||||||
setup(char** argv)
|
setup(char** argv)
|
||||||
|
|
@ -28,4 +43,6 @@ setup(char** argv)
|
||||||
// errors and display help text.
|
// errors and display help text.
|
||||||
set_program_name(argv[0]);
|
set_program_name(argv[0]);
|
||||||
argv[0] = const_cast<char*>(program_name);
|
argv[0] = const_cast<char*>(program_name);
|
||||||
|
|
||||||
|
argp_program_version_hook = display_version;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,6 @@
|
||||||
#include "common_output.hh"
|
#include "common_output.hh"
|
||||||
#include "common_range.hh"
|
#include "common_range.hh"
|
||||||
|
|
||||||
#include "misc/_config.h"
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
@ -96,16 +95,6 @@
|
||||||
using namespace spot;
|
using namespace spot;
|
||||||
using namespace spot::ltl;
|
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[] ="\
|
const char argp_program_doc[] ="\
|
||||||
Generate temporal logic formulas from predefined scalable patterns.";
|
Generate temporal logic formulas from predefined scalable patterns.";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
#include "common_finput.hh"
|
#include "common_finput.hh"
|
||||||
#include "common_post.hh"
|
#include "common_post.hh"
|
||||||
|
|
||||||
#include "misc/_config.h"
|
|
||||||
#include "ltlvisit/simplify.hh"
|
#include "ltlvisit/simplify.hh"
|
||||||
#include "tgbaalgos/dotty.hh"
|
#include "tgbaalgos/dotty.hh"
|
||||||
#include "tgbaalgos/lbtt.hh"
|
#include "tgbaalgos/lbtt.hh"
|
||||||
|
|
@ -43,16 +42,6 @@
|
||||||
#include "tgbaalgos/stats.hh"
|
#include "tgbaalgos/stats.hh"
|
||||||
#include "tgba/bddprint.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[] ="\
|
const char argp_program_doc[] ="\
|
||||||
Translate linear-time formulas (LTL/PSL) into Büchi automata.\n\n\
|
Translate linear-time formulas (LTL/PSL) into Büchi automata.\n\n\
|
||||||
By default it will apply all available optimizations to output \
|
By default it will apply all available optimizations to output \
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@
|
||||||
#include "common_finput.hh"
|
#include "common_finput.hh"
|
||||||
#include "common_post.hh"
|
#include "common_post.hh"
|
||||||
|
|
||||||
#include "misc/_config.h"
|
|
||||||
#include "ltlparse/public.hh"
|
#include "ltlparse/public.hh"
|
||||||
#include "ltlvisit/simplify.hh"
|
#include "ltlvisit/simplify.hh"
|
||||||
#include "tgbaalgos/dotty.hh"
|
#include "tgbaalgos/dotty.hh"
|
||||||
|
|
@ -46,16 +45,6 @@
|
||||||
#include "taalgos/dotty.hh"
|
#include "taalgos/dotty.hh"
|
||||||
#include "taalgos/minimize.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[] ="\
|
const char argp_program_doc[] ="\
|
||||||
Translate linear-time formulas (LTL/PSL) into Testing Automata.\n\n\
|
Translate linear-time formulas (LTL/PSL) into Testing Automata.\n\n\
|
||||||
By default it outputs a transition-based generalized Testing Automaton \
|
By default it outputs a transition-based generalized Testing Automaton \
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@
|
||||||
#include "common_cout.hh"
|
#include "common_cout.hh"
|
||||||
#include "common_r.hh"
|
#include "common_r.hh"
|
||||||
|
|
||||||
#include "misc/_config.h"
|
|
||||||
#include "misc/hash.hh"
|
#include "misc/hash.hh"
|
||||||
#include "ltlvisit/simplify.hh"
|
#include "ltlvisit/simplify.hh"
|
||||||
#include "ltlvisit/length.hh"
|
#include "ltlvisit/length.hh"
|
||||||
|
|
@ -47,16 +46,6 @@
|
||||||
#include "tgbaalgos/minimize.hh"
|
#include "tgbaalgos/minimize.hh"
|
||||||
#include "tgbaalgos/safety.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[] ="\
|
const char argp_program_doc[] ="\
|
||||||
Read a list of formulas and output them back after some optional processing.\v\
|
Read a list of formulas and output them back after some optional processing.\v\
|
||||||
Exit status:\n\
|
Exit status:\n\
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
#include "common_range.hh"
|
#include "common_range.hh"
|
||||||
#include "common_r.hh"
|
#include "common_r.hh"
|
||||||
|
|
||||||
#include "misc/_config.h"
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include "ltlast/atomic_prop.hh"
|
#include "ltlast/atomic_prop.hh"
|
||||||
#include "ltlast/multop.hh"
|
#include "ltlast/multop.hh"
|
||||||
|
|
@ -46,16 +45,6 @@
|
||||||
#include "misc/random.hh"
|
#include "misc/random.hh"
|
||||||
#include "misc/hash.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[] ="\
|
const char argp_program_doc[] ="\
|
||||||
Generate random temporal logic formulas.\v\
|
Generate random temporal logic formulas.\v\
|
||||||
Examples:\n\
|
Examples:\n\
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue