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.
This commit is contained in:
Pasi Kallinen
2021-02-11 18:22:14 +02:00
parent 918bfca387
commit 7f51e59770

View File

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