option_map: Diagnose unused option on request
* spot/misc/optionmap.hh, spot/misc/optionmap.cc (report_unused_options, set_, set_set_): New methods. * bin/autfilt.cc, bin/dstar2tgba.cc, bin/ltl2tgba.cc, bin/ltl2tgta.cc: Call report_unused_options(). * tests/core/ltlcross2.test, tests/core/readsave.test: Fix typos in options. * tests/core/minusx.test: New file. * tests/Makefile.am: Add it. * NEWS: Mention this.
This commit is contained in:
parent
f7f353db68
commit
e419150c30
11 changed files with 133 additions and 30 deletions
|
|
@ -230,13 +230,23 @@ main(int argc, char** argv)
|
|||
error(2, 0, "No formula to translate? Run '%s --help' for usage.",
|
||||
program_name);
|
||||
|
||||
spot::translator trans(&extra_options);
|
||||
trans.set_pref(pref | comp | sbacc);
|
||||
trans.set_type(type);
|
||||
trans.set_level(level);
|
||||
try
|
||||
{
|
||||
spot::translator trans(&extra_options);
|
||||
trans.set_pref(pref | comp | sbacc);
|
||||
trans.set_type(type);
|
||||
trans.set_level(level);
|
||||
|
||||
trans_processor processor(trans);
|
||||
if (processor.run())
|
||||
return 2;
|
||||
// Diagnose unused -x options
|
||||
extra_options.report_unused_options();
|
||||
}
|
||||
catch (const std::runtime_error& e)
|
||||
{
|
||||
error(2, 0, "%s", e.what());
|
||||
}
|
||||
|
||||
trans_processor processor(trans);
|
||||
if (processor.run())
|
||||
return 2;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue