diff options
author | wm4 <wm4@nowhere> | 2017-07-02 16:46:27 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-07-02 16:47:27 +0200 |
commit | 4a084c0df8fd8aaa66073839d97e544c3b6903e7 (patch) | |
tree | a4de9fca4908a3f9a24ed130530cbde7af9b5ca4 /options/m_option.c | |
parent | e4bc563fd2dcff1059624efb7b948b2886a382ab (diff) | |
download | mpv-4a084c0df8fd8aaa66073839d97e544c3b6903e7.tar.bz2 mpv-4a084c0df8fd8aaa66073839d97e544c3b6903e7.tar.xz |
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.
Diffstat (limited to 'options/m_option.c')
-rw-r--r-- | options/m_option.c | 12 |
1 files changed, 10 insertions, 2 deletions
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) { |