From dc48893630d11829121a45137460afb45e24ef2d Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 17 Sep 2016 18:07:40 +0200 Subject: options: simplify M_OPT_EXIT There were multiple values under M_OPT_EXIT (M_OPT_EXIT-n for n>=0). Somehow M_OPT_EXIT-n either meant error code n (with n==0 no error?), or the number of option valus consumed (0 or 1). The latter is MPlayer legacy, which left it to the option type parsers to determine whether an option took a value or not. All of this was changed in mpv, by requiring the user to use explicit syntax ("--opt=val" instead of "-opt val"). In any case, the n value wasn't even used (anymore), so rip this all out. Now M_OPT_EXIT-1 doesn't mean anything, and could be used by a new error code. --- options/parse_commandline.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'options/parse_commandline.c') diff --git a/options/parse_commandline.c b/options/parse_commandline.c index ab1f28f72b..b90912e786 100644 --- a/options/parse_commandline.c +++ b/options/parse_commandline.c @@ -151,11 +151,10 @@ int m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, if (mode == LOCAL) flags |= M_SETOPT_BACKUP | M_SETOPT_CHECK_ONLY; int r = m_config_set_option_ext(config, p.arg, p.param, flags); - if (r <= M_OPT_EXIT) { + if (r == M_OPT_EXIT) { ret = r; goto err_out; - } - if (r < 0) { + } else if (r < 0) { MP_FATAL(config, "Setting command line option '--%.*s=%.*s' failed.\n", BSTR_P(p.arg), BSTR_P(p.param)); goto err_out; -- cgit v1.2.3