1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 00:42:57 +00:00

m_config: deprecate top-level suboptions

This is a really old weird MPlayer feature. While the MPlayer requires
you to use the sub-option syntax in these cases, mpv "flattens" them to
normal options. The still-supported alternate sub-option syntax remains
a weird artifact that hopefully nobody uses.

For example you can do "-sub-text font=Foo:color=0.5" instead of using
"--sub-text-font=Foo --sub-text-color=0.5". For --sub-text this is an
accidental feature, but it used to be documented for
--demuxer-rawaudio and some others.

This should just be removed, but for now only print a warning to preempt
complaints from weird users wanting this feature back.
This commit is contained in:
wm4 2016-08-31 17:39:30 +02:00
parent b10dcecf7d
commit 2057209057
2 changed files with 7 additions and 0 deletions

View File

@ -626,6 +626,11 @@ static int m_config_parse_option(struct m_config *config, struct bstr name,
// Option with children are a bit different to parse
if (co->opt->type->flags & M_OPT_TYPE_HAS_CHILD) {
char prefix[110];
if (!config->subopt_deprecation_warning) {
MP_WARN(config, "Suboptions (--%.*s=...) are deprecated. Use "
"flat options instead.\n", BSTR_P(name));
config->subopt_deprecation_warning = true;
}
assert(strlen(co->name) < 100);
sprintf(prefix, "%s-", co->name);
return parse_subopts(config, (char *)co->name, prefix, param, flags);

View File

@ -77,6 +77,8 @@ typedef struct m_config {
// For the command line parser
int recursion_depth;
bool subopt_deprecation_warning;
void *optstruct; // struct mpopts or other
} m_config_t;