From 7c01dee153fe8b7dabbc4ff8f206097f4191b48f Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 5 May 2014 23:50:17 +0200 Subject: options: let unknown option case be handled by final option parser If an option is completely missing, let m_config_parse_option() handle this case, instead of erroring out early. Needed for the following commit. --- options/parse_commandline.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'options/parse_commandline.c') diff --git a/options/parse_commandline.c b/options/parse_commandline.c index e1c84b9f27..cd1e70053c 100644 --- a/options/parse_commandline.c +++ b/options/parse_commandline.c @@ -82,11 +82,9 @@ static int split_opt_silent(struct parse_state *p) bool ambiguous = !bstr_split_tok(p->arg, "=", &p->arg, &p->param); - int r = m_config_option_requires_param(p->config, p->arg); - if (r < 0) - return r; + bool need_param = m_config_option_requires_param(p->config, p->arg) > 0; - if (ambiguous && r > 0) { + if (ambiguous && need_param) { if (p->argc < 1) return M_OPT_MISSING_PARAM; p->param = bstr0(p->argv[0]); -- cgit v1.2.3