From fc1c004cd8b869f268e3d8eb3bf605bc39902e99 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 10 Sep 2016 20:49:10 +0200 Subject: options: fix --list-options after previous commit Fixes #3509. --- options/m_config.c | 5 +++-- options/m_option.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'options') 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)); -- cgit v1.2.3