From 98973e345d4e0480a625bf12ece9bbb39ba4b3e2 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 23 Aug 2020 19:41:51 +0200 Subject: [PATCH] Bugfix for command line parser - did not print name of unknown option --- src/tl/tl/tlCommandLineParser.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tl/tl/tlCommandLineParser.cc b/src/tl/tl/tlCommandLineParser.cc index bfd215acb..471688905 100644 --- a/src/tl/tl/tlCommandLineParser.cc +++ b/src/tl/tl/tlCommandLineParser.cc @@ -502,7 +502,7 @@ CommandLineOptions::parse (int argc, char *argv[]) ex.read_word (n, "_-"); std::map::const_iterator a = arg_by_long_option.find (n); if (a == arg_by_long_option.end ()) { - throw tl::Exception (tl::sprintf (tl::to_string (tr ("Unknown command line option --%1 (use -h for help)")), n)); + throw tl::Exception (tl::sprintf (tl::to_string (tr ("Unknown command line option --%s (use -h for help)")), n)); } arg = a->second; @@ -512,14 +512,14 @@ CommandLineOptions::parse (int argc, char *argv[]) ex.read_word (n); std::map::const_iterator a = arg_by_short_option.find (n); if (a == arg_by_short_option.end ()) { - throw tl::Exception (tl::sprintf (tl::to_string (tr ("Unknown command line option -%1 (use -h for help)")), n)); + throw tl::Exception (tl::sprintf (tl::to_string (tr ("Unknown command line option -%s (use -h for help)")), n)); } arg = a->second; } else { if (next_plain_arg == plain_args.end ()) { - throw tl::Exception (tl::sprintf (tl::to_string (tr ("Unknown command line component %1 - no further plain argument expected (use -h for help)")), arg_as_utf8)); + throw tl::Exception (tl::sprintf (tl::to_string (tr ("Unknown command line component %s - no further plain argument expected (use -h for help)")), arg_as_utf8)); } arg = *next_plain_arg;