From 4a084c0df8fd8aaa66073839d97e544c3b6903e7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 2 Jul 2017 16:46:27 +0200 Subject: m_option: deprecate multiple items for -add etc. This is more confusing than it helps, and forces escaping more stuff. For example, for string lists we could remove all need for escaling with -add and -pre. The user can simply use multiple of those options. --- options/m_option.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'options') diff --git a/options/m_option.c b/options/m_option.c index 162d57ee8e..0ec85825b6 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -1159,8 +1159,6 @@ static int str_list_del(struct mp_log *log, char **del, int n, void *dst) talloc_free(lst[idx]); lst[idx] = NULL; s--; - if (i > 0) - mp_warn(log, "Passing multiple -del arguments is deprecated!\n"); } talloc_free(del); @@ -1282,6 +1280,11 @@ static int parse_str_list_impl(struct mp_log *log, const m_option_t *opt, res[n] = NULL; talloc_free(ptr); + if (op != OP_NONE && n > 1) { + mp_warn(log, "Passing multiple arguments to %.*s is deprecated!\n", + BSTR_P(name)); + } + switch (op) { case OP_ADD: return str_list_add(res, n, dst, 0); @@ -2976,6 +2979,11 @@ static int parse_obj_settings_list(struct mp_log *log, const m_option_t *opt, } } + if (op != OP_NONE && res && res[0].name && res[1].name) { + mp_warn(log, "Passing more than 1 argument to %.*s is deprecated!\n", + BSTR_P(name)); + } + if (dst) { m_obj_settings_t *list = VAL(dst); if (op == OP_PRE) { -- cgit v1.2.3