From 7dde096d8a6d9e82cac82bec439fef47d078f352 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 31 Aug 2016 17:09:10 +0200 Subject: m_config: introduce and use OPT_ALIAS for some options OPT_ALIAS redirects the options at a higher level, instead of introducing "duplicate" options with different name but same backing storage. This uses the OPT_REPLACED mechanisms - only the deprecation warning had to be made conditional. Note that e.g. --no-video still works, because the "--no-..." redirection and OPT_ALIAS are orthogonal. The deprecated --sub -> --sub-file alias had to be dropped, because it essentially conflicts with --no-sub. If anyone complains, this could probably still be undone by letting m_config_find_negation_opt do a special mapping for --no-sub. (Which would be dumb, but simple and effective.) --- options/options.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'options/options.c') diff --git a/options/options.c b/options/options.c index dc880d3339..92eb0fd9c5 100644 --- a/options/options.c +++ b/options/options.c @@ -119,7 +119,7 @@ static const m_option_t mp_vo_opt_list[] = { OPT_FLOATRANGE("monitoraspect", force_monitor_aspect, 0, 0.0, 9.0), OPT_FLOATRANGE("monitorpixelaspect", monitor_pixel_aspect, 0, 0.2, 9.0), OPT_FLAG("fullscreen", fullscreen, M_OPT_FIXED), - OPT_FLAG("fs", fullscreen, M_OPT_FIXED), + OPT_ALIAS("fs", "fullscreen"), OPT_FLAG("native-keyrepeat", native_keyrepeat, M_OPT_FIXED), OPT_FLOATRANGE("panscan", panscan, 0, 0.0, 1.0), OPT_FLOATRANGE("video-zoom", zoom, 0, -20.0, 20.0), @@ -303,9 +303,9 @@ const m_option_t mp_opts[] = { OPT_TRACKCHOICE("ff-aid", stream_id_ff[STREAM_AUDIO]), OPT_TRACKCHOICE("ff-vid", stream_id_ff[STREAM_VIDEO]), OPT_TRACKCHOICE("ff-sid", stream_id_ff[STREAM_SUB]), - OPT_FLAG_STORE("no-sub", stream_id[0][STREAM_SUB], 0, -2), - OPT_FLAG_STORE("no-video", stream_id[0][STREAM_VIDEO], 0, -2), - OPT_FLAG_STORE("no-audio", stream_id[0][STREAM_AUDIO], 0, -2), + OPT_ALIAS("sub", "sid"), + OPT_ALIAS("video", "vid"), + OPT_ALIAS("audio", "aid"), OPT_STRINGLIST("alang", stream_lang[STREAM_AUDIO], 0), OPT_STRINGLIST("slang", stream_lang[STREAM_SUB], 0), @@ -689,7 +689,6 @@ const m_option_t mp_opts[] = { OPT_REPLACED("ss", "start"), OPT_REPLACED("stop-xscreensaver", "stop-screensaver"), OPT_REPLACED("sub-fuzziness", "sub-auto"), - OPT_REPLACED("sub", "sub-file"), OPT_REPLACED("subcp", "sub-codepage"), OPT_REPLACED("subdelay", "sub-delay"), OPT_REPLACED("subfile", "sub-file"), -- cgit v1.2.3