From 50008adf4af5360f87109d6264aa77ac82f2a80a Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 26 Jun 2017 21:07:00 +0200 Subject: options: handle suffixes like -add in a more generic way This affects options like --vf or --display-tags. These used a "*" suffix to match all options starting with a specific name, and handled the rest in the option parser. Change this to remove the "*" special case, and require every option parser to declare a list of allowed suffixes via m_option_type.actions. The new way is conceptually simpler, because we don't have to account for the "*" in a bunch of places anymore, and instead everything is centrally handled in the CLI part of the option parser, where it's actually needed. It automatically enables suffixes like -add for a bunch of other stringlist options. --- options/options.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'options/options.c') diff --git a/options/options.c b/options/options.c index 1937a7fe65..a803dccf5d 100644 --- a/options/options.c +++ b/options/options.c @@ -367,7 +367,7 @@ const m_option_t mp_opts[] = { OPT_CHOICE_OR_INT("hls-bitrate", hls_bitrate, 0, 0, INT_MAX, ({"no", -1}, {"min", 0}, {"max", INT_MAX})), - OPT_STRINGLIST("display-tags*", display_tags, 0), + OPT_STRINGLIST("display-tags", display_tags, 0), #if HAVE_CDDA OPT_SUBSTRUCT("cdda", stream_cdda_opts, stream_cdda_conf, 0), @@ -414,9 +414,9 @@ const m_option_t mp_opts[] = { // ------------------------- codec/vfilter options -------------------- OPT_SETTINGSLIST("af-defaults", af_defs, 0, &af_obj_list, ), - OPT_SETTINGSLIST("af*", af_settings, 0, &af_obj_list, ), + OPT_SETTINGSLIST("af", af_settings, 0, &af_obj_list, ), OPT_SETTINGSLIST("vf-defaults", vf_defs, 0, &vf_obj_list, ), - OPT_SETTINGSLIST("vf*", vf_settings, 0, &vf_obj_list, ), + OPT_SETTINGSLIST("vf", vf_settings, 0, &vf_obj_list, ), OPT_CHOICE("deinterlace", deinterlace, 0, ({"auto", -1}, -- cgit v1.2.3