From: Pasi Kallinen Date: Thu, 11 Feb 2021 16:22:14 +0000 (+0200) Subject: Don't complain about unknown option if param is wrong X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f51e597704dde9dc151fe807a1485eeeab11813;p=nethack Don't complain about unknown option if param is wrong When a compound option was given an erroneous parameter, for example "OPTIONS=runmode:foo", you first got "Unknown runmode parameter 'foo", and then "Unknown option 'runmode:foo'". Prevent the Unknown option complaint, if we actually did find a match. --- diff --git a/src/options.c b/src/options.c index cfd6ad216..a15c4e128 100644 --- a/src/options.c +++ b/src/options.c @@ -472,6 +472,8 @@ parseoptions(register char *opts,boolean tinitial, boolean tfrom_file) if (optresult == optn_silenterr) return FALSE; + if (got_match && optresult == optn_err) + return FALSE; if (optresult == optn_ok) return retval;