summaryrefslogtreecommitdiffstats
path: root/core/m_option.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-21 22:10:21 +0100
committerwm4 <wm4@nowhere>2013-02-23 00:07:11 +0100
commit9b7fb867f77bf0819bdfe1a4ceb55aade7db6f1b (patch)
tree99b1f9f42a5902ee56629306317f5fae431ab05c /core/m_option.h
parente540e5d4da607420cc10f4c2b412aa0ff3d1fb5c (diff)
downloadmpv-9b7fb867f77bf0819bdfe1a4ceb55aade7db6f1b.tar.bz2
mpv-9b7fb867f77bf0819bdfe1a4ceb55aade7db6f1b.tar.xz
options: drop --opt:subopt option names
For all suboptions, "flat" options were available by separating the parent option and the sub option with ":", e.g. "--rawvideo:w=123". Drop this syntax and use "-" as separator. This means even suboptions are available as normal options now, e.g. "--rawvideo-w=123". The old syntax doesn't work anymore. Note that this is completely separate from actual suboptions. For example, "-rawvideo w=123:h=123" still works. (Not that this syntax is worth supporting, but it's needed anyway, for for other things like vf and vo suboptions.) As a consequence of this change, we also have to add new "no-" prefixed options for flag suboptions, so that "--no-input-default-bindings" works. ("--input-no-default-bindings" also works as a consequence of allowing "-input no-default-bindings" - they are handled by the same underlying option.) For --input, always use the full syntax in the manpage. There exist suboptions other than --input (like --tv, --rawvideo, etc.), but since they might be handled differently in the future, don't touch these yet. M_OPT_PREFIXED becomes the default, so remove it. As a minor unrelated cleanup, get rid of M_OPT_MERGE too and use the OPT_SUBSTRUCT() macro in some places. Unrelated: remove the duplicated --tv:buffersize option, fix a typo in changes.rst.
Diffstat (limited to 'core/m_option.h')
-rw-r--r--core/m_option.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/core/m_option.h b/core/m_option.h
index bbf1efaec7..7b1e36eed7 100644
--- a/core/m_option.h
+++ b/core/m_option.h
@@ -355,14 +355,6 @@ struct m_option {
// The option should be set during command line pre-parsing
#define M_OPT_PRE_PARSE (1 << 6)
-// For options with children, add all children as top-level arguments
-// (e.g. "--parent=child=value" becomes "--parent-child=value")
-#define M_OPT_PREFIXED (1 << 8)
-
-// Similar to M_OPT_PREFIXED, but drop the prefix.
-// (e.g. "--parent=child=value" becomes "--child=value")
-#define M_OPT_MERGE (1 << 9)
-
// See M_OPT_TYPE_OPTIONAL_PARAM.
#define M_OPT_OPTIONAL_PARAM (1 << 10)
@@ -555,10 +547,12 @@ static inline void m_option_free(const m_option_t *opt, void *dst)
#define OPT_TRACKCHOICE(name, var) OPT_CHOICE_OR_INT(name, var, 0, 0, 8190, ({"no", -2}, {"auto", -1}))
// subconf must have the type struct m_sub_options.
-// flagv should be M_OPT_MERGE or M_OPT_FLATTEN.
+// All sub-options are prefixed with "name-" and are added to the current
+// (containing) option list.
+// If name is "", add the sub-options directly instead.
// varname refers to the field, that must be a pointer to a field described by
// the subconf struct.
-#define OPT_SUBSTRUCT(varname, subconf, flagv) OPT_GENERAL("-", varname, flagv, .type = &m_option_type_subconfig_struct, .priv = (void*)&subconf)
+#define OPT_SUBSTRUCT(name, varname, subconf, flagv) OPT_GENERAL(name, varname, flagv, .type = &m_option_type_subconfig_struct, .priv = (void*)&subconf)
#define OPT_BASE_STRUCT struct MPOpts