summaryrefslogtreecommitdiffstats
path: root/options/m_option.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-05 21:05:47 +0200
committerwm4 <wm4@nowhere>2016-09-05 21:26:39 +0200
commit633eb30cbe0e52879443633760e9460fe5bdcdfa (patch)
tree3eabbb8e58062833905344abc74f59103503ca0f /options/m_option.h
parent327cb2a06c32f2c05fc266272936080d06103a63 (diff)
downloadmpv-633eb30cbe0e52879443633760e9460fe5bdcdfa.tar.bz2
mpv-633eb30cbe0e52879443633760e9460fe5bdcdfa.tar.xz
options: add automagic hack for handling sub-option deprecations
I decided that it's too much work to convert all the VO/AOs to the new option system manually at once. So here's a shitty hack instead, which achieves almost the same thing. (The only user-visible difference is that e.g. --vo=name:help will list the sub-options normally, instead of showing them as deprecation placeholders. Also, the sub-option parser will verify each option normally, instead of deferring to the global option parser.) Another advantage is that once we drop the deprecated options, converting the remaining things will be easier, because we obviously don't need to add the compatibility hacks. Using this mechanism is separate in the next commit to keep the diff noise down.
Diffstat (limited to 'options/m_option.h')
-rw-r--r--options/m_option.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/options/m_option.h b/options/m_option.h
index 48afc23df7..024b62521a 100644
--- a/options/m_option.h
+++ b/options/m_option.h
@@ -132,6 +132,10 @@ struct m_obj_desc {
const char *replaced_name;
// For convenience: these are added as global command-line options.
const struct m_sub_options *global_opts;
+ // Evil hack to essentially force-move .options to global_opts. All options
+ // will be added as global options with the given prefix, and using
+ // sub-options will be treated as deprecated and redirected.
+ const char *legacy_prefix;
};
// Extra definition needed for \ref m_option_type_obj_settings_list options.