bin: factor the calls to set_program_name().

* src/bin/common_setup.cc, src/bin/common_setup.hh: New files.
* src/bin/Makefile.am: Add them.
* src/bin/genltl.cc, src/bin/ltl2tgba.cc, src/bin/ltl2tgta.cc,
src/bin/ltlfilt.cc, src/bin/randltl.cc: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2012-09-29 17:09:26 +02:00
parent ecca4ba53e
commit 489f719dc1
8 changed files with 73 additions and 35 deletions

View file

@ -26,9 +26,9 @@
#include <argp.h>
#include <cstdlib>
#include <iterator>
#include "progname.h"
#include "error.h"
#include "common_setup.hh"
#include "common_output.hh"
#include "common_range.hh"
#include "common_r.hh"
@ -252,10 +252,7 @@ parse_opt(int key, char* arg, struct argp_state*)
int
main(int argc, char** argv)
{
set_program_name(argv[0]);
// Simplify the program name, because argp() uses it to report errors
// and display help text.
argv[0] = const_cast<char*>(program_name);
setup(argv);
const argp ap = { options, parse_opt, "PROP...", argp_program_doc,
children, 0, 0 };