From 933db1b95f6c476230fa86ee06e1fec5cd36e697 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 24 Jun 2017 11:32:40 +0200 Subject: Revert "parse_commandline: fail gracefully on bad args" This reverts commit 38b05daf7d16898f4a63e4ccf48479d8964e6e19. There was actually no LGPL relicensing agreement with wd0. --- options/m_option.c | 2 +- options/parse_commandline.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/options/m_option.c b/options/m_option.c index c141850e75..2899ad01d5 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -62,7 +62,7 @@ char *m_option_strerror(int code) case M_OPT_MISSING_PARAM: return "option requires parameter"; case M_OPT_INVALID: - return "option could not be parsed"; + return "option parameter could not be parsed"; case M_OPT_OUT_OF_RANGE: return "parameter is outside values allowed for option"; case M_OPT_DISALLOW_PARAM: diff --git a/options/parse_commandline.c b/options/parse_commandline.c index f65af9e41e..4b2f4f880e 100644 --- a/options/parse_commandline.c +++ b/options/parse_commandline.c @@ -78,9 +78,6 @@ static int split_opt_silent(struct parse_state *p) bool ambiguous = !bstr_split_tok(p->arg, "=", &p->arg, &p->param); - if (!p->arg.len) - return M_OPT_INVALID; - bool need_param = m_config_option_requires_param(p->config, p->arg) > 0; if (ambiguous && need_param) { @@ -101,7 +98,7 @@ static bool split_opt(struct parse_state *p) return r == 0; p->error = true; - MP_FATAL(p->config, "Error parsing command line option '%.*s': %s\n", + MP_FATAL(p->config, "Error parsing commandline option %.*s: %s\n", BSTR_P(p->arg), m_option_strerror(r)); return false; } @@ -154,7 +151,7 @@ int m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, ret = r; goto err_out; } else if (r < 0) { - MP_FATAL(config, "Setting command line option '--%.*s=%.*s' failed.\n", + MP_FATAL(config, "Setting commandline option --%.*s=%.*s failed.\n", BSTR_P(p.arg), BSTR_P(p.param)); goto err_out; } -- cgit v1.2.3