1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-30 10:52:00 +00:00

fix: make "unexpected argument" error message easier to read (#5029)

This commit is contained in:
Roey Fuchs 2023-02-24 23:47:51 +02:00 committed by GitHub
parent 394defe98e
commit cfcd7148ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;