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:
parent
394defe98e
commit
cfcd7148ad
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
tr_variantDictAddBool(&settings_, TR_KEY_utp_enabled, false);
|
||||||
break;
|
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:
|
default:
|
||||||
tr_getopt_usage(MyName, Usage, std::data(Options));
|
tr_getopt_usage(MyName, Usage, std::data(Options));
|
||||||
*exit_code = 0;
|
*exit_code = 0;
|
||||||
|
|
Loading…
Reference in a new issue