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 | |
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.
-rw-r--r-- | DOCS/interface-changes.rst | 2 | ||||
-rw-r--r-- | options/m_option.c | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 1d0f89a09e..61fa1f5779 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -50,6 +50,8 @@ Interface changes (the compatibility hacks for this will be removed after this release) - remove property `vo-performance`, and add `vo-passes` as a more general replacement + - deprecate passing multiple arguments to -add/-pre options (affects the + vf/af commands too) --- mpv 0.25.0 --- - remove opengl-cb dxva2 dummy hwdec interop (see git "vo_opengl: remove dxva2 dummy hwdec backend") 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) { |