summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-10 20:49:10 +0200
committerwm4 <wm4@nowhere>2016-09-10 20:49:10 +0200
commitfc1c004cd8b869f268e3d8eb3bf605bc39902e99 (patch)
treef5a56042a5f5460c36acadc7fcb9d6017ca0a548 /options
parent484328fe04be40807bfcf170383528feeb03451d (diff)
downloadmpv-fc1c004cd8b869f268e3d8eb3bf605bc39902e99.tar.bz2
mpv-fc1c004cd8b869f268e3d8eb3bf605bc39902e99.tar.xz
options: fix --list-options after previous commit
Fixes #3509.
Diffstat (limited to 'options')
-rw-r--r--options/m_config.c5
-rw-r--r--options/m_option.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/options/m_config.c b/options/m_config.c
index 1f9d334026..6992ca8c25 100644
--- a/options/m_config.c
+++ b/options/m_config.c
@@ -184,7 +184,8 @@ static int list_options(struct m_config *config, bstr val, bool show_help)
snprintf(s, sizeof(s), "%.*s", BSTR_P(val));
if (show_help)
mp_info(config->log, "%s", mp_help_text);
- m_config_print_option_list(config, s);
+ if (s[0])
+ m_config_print_option_list(config, s);
return M_OPT_EXIT;
}
@@ -776,7 +777,7 @@ static int m_config_parse_option(struct m_config *config, struct bstr name,
if (bstr_equals0(name, "h") || bstr_equals0(name, "help"))
return list_options(config, param, true);
if (bstr_equals0(name, "list-options"))
- return list_options(config, (bstr){0}, false);
+ return list_options(config, bstr0("*"), false);
// Option with children are a bit different to parse
if (co->opt->type->flags & M_OPT_TYPE_HAS_CHILD) {
diff --git a/options/m_option.c b/options/m_option.c
index cdc6b41e34..fa9a9578ab 100644
--- a/options/m_option.c
+++ b/options/m_option.c
@@ -2771,7 +2771,7 @@ print_help: ;
if (config) {
if (desc->print_help)
desc->print_help(log);
- m_config_print_option_list(config, "");
+ m_config_print_option_list(config, "*");
} else {
mp_warn(log, "Option %.*s: item %.*s doesn't exist.\n",
BSTR_P(opt_name), BSTR_P(name));