From cfcd7148adacc8e757fc2fe287a7aa726aaffc52 Mon Sep 17 00:00:00 2001 From: Roey Fuchs <44167563+RoeyFuchs@users.noreply.github.com> Date: Fri, 24 Feb 2023 23:47:51 +0200 Subject: [PATCH] fix: make "unexpected argument" error message easier to read (#5029) --- daemon/daemon.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/daemon/daemon.cc b/daemon/daemon.cc index 83af1128a..08de7efd2 100644 --- a/daemon/daemon.cc +++ b/daemon/daemon.cc @@ -628,6 +628,12 @@ bool tr_daemon::parse_args(int argc, char const* const* argv, bool* dump_setting tr_variantDictAddBool(&settings_, TR_KEY_utp_enabled, false); break; + case TR_OPT_UNK: + fprintf(stderr, "Unexpected argument: %s \n", optstr); + tr_getopt_usage(MyName, Usage, std::data(Options)); + *exit_code = 1; + return false; + default: tr_getopt_usage(MyName, Usage, std::data(Options)); *exit_code = 0;