summaryrefslogtreecommitdiffstats
path: root/options/m_option.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-01-31 06:50:21 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-03 05:00:52 -0800
commitafb167cfd2521198539fbd23d772a252554221f0 (patch)
treedbd95c0f370734d94da5db9888b7e74ddd600431 /options/m_option.c
parent174261450589d8a6ff21426c1cfc3f2508620583 (diff)
downloadmpv-afb167cfd2521198539fbd23d772a252554221f0.tar.bz2
mpv-afb167cfd2521198539fbd23d772a252554221f0.tar.xz
options: slightly improve filter help output for lavfi bridge
--vf=help will now list libavfilter filters, and e.g. --vf=yadif=help will list libavfilter filter options. The latter is rather bare, because the AVOption API is really awful (holy shit how is it so bad), and would require us to handle _every_ option type manually. Alternatively we could call av_opt_show2(), which ffmpeg uses for help output in its CLI tools and which is much more detailed. But it's rather foreign and forces output through av_log(), so I don't really want to use it.
Diffstat (limited to 'options/m_option.c')
-rw-r--r--options/m_option.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/options/m_option.c b/options/m_option.c
index 522e771356..e777c5a19e 100644
--- a/options/m_option.c
+++ b/options/m_option.c
@@ -2940,6 +2940,8 @@ print_help: ;
if (desc->print_help)
desc->print_help(log);
m_config_print_option_list(config, "*");
+ } else if (list->print_unknown_entry_help) {
+ list->print_unknown_entry_help(log, mp_tprintf(80, "%.*s", BSTR_P(name)));
} else {
mp_warn(log, "Option %.*s: item %.*s doesn't exist.\n",
BSTR_P(opt_name), BSTR_P(name));
@@ -3155,11 +3157,17 @@ static int parse_obj_settings_list(struct mp_log *log, const m_option_t *opt,
if (!ol->get_desc(&desc, n))
break;
if (!desc.hidden) {
- mp_info(log, " %-15s: %s\n",
+ mp_info(log, " %-16s %s\n",
desc.name, desc.description);
}
}
mp_info(log, "\n");
+ if (ol->print_help_list)
+ ol->print_help_list(log);
+ if (!ol->use_global_options) {
+ mp_info(log, "Get help on individual entries via: --%s=entry=help\n",
+ opt->name);
+ }
return M_OPT_EXIT;
}