path: root/core/cfg-mplayer.h
diff options
authorwm4 <wm4@nowhere>2012-09-21 09:22:25 +0200
committerwm4 <wm4@nowhere>2013-02-09 00:21:17 +0100
commit267a889cc2c5ca688a2b8fc93cf8e5349a3c8a44 (patch)
treeee2561f256db05092e61fa797be4b7ecaf3db991 /core/cfg-mplayer.h
parent5412993724aee1126bfc8dfbc0422ebe5251b9b6 (diff)
options: unify single dash and double dash options
There were two option syntax variations: "old": -opt value "new": --opt=value "-opt=value" was invalid, and "--opt value" meant "--opt=" followed by a separate option "value" (i.e. interpreted as filename). There isn't really any reason to do this. The "old" syntax used to be ambiguous (you had to call the option parser to know whether the following argument is an option value or a new option), but that has been removed. Further, using "=" in the option string is always unambiguous. Since the distinction between the two option variants is confusing, just remove the difference and allow "--opt value" and "-opt=value". To make this easier, do some other cleanups as well (e.g. avoid having to do a manual lookup of the option just to check for M_OPT_PRE_PARSE, which somehow ended up with finally getting rid of the m_config.mode member). Error reporting is still a mess, and we opt for reporting too many rather than too few errors to the user. There shouldn't be many user-visible changes. The --framedrop and --term-osd options now always require parameters. The --mute option is intentionally made ambiguous: it works like a flag option, but a value can be passed to it explicitly ("--mute=auto"). If the interpretation of the option is ambiguous (like "--mute auto"), the second string is interpreted as separate option or filename. (Normal flag options are actually ambiguous in this way too.)
Diffstat (limited to 'core/cfg-mplayer.h')
1 files changed, 4 insertions, 4 deletions
diff --git a/core/cfg-mplayer.h b/core/cfg-mplayer.h
index c581fe59fe..edab5f37e4 100644
--- a/core/cfg-mplayer.h
+++ b/core/cfg-mplayer.h
@@ -549,10 +549,10 @@ const m_option_t mplayer_opts[]={
OPT_FLOATRANGE("softvol-max", softvol_max, 0, 10, 10000),
{"volstep", &volstep, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
OPT_FLOATRANGE("volume", mixer_init_volume, 0, -1, 10000),
- OPT_CHOICE("mute", mixer_init_mute, 0,
+ OPT_CHOICE("mute", mixer_init_mute, M_OPT_OPTIONAL_PARAM,
({"auto", -1},
{"no", 0},
- {"yes", 1})),
+ {"yes", 1}, {"", 1})),
OPT_MAKE_FLAGS("gapless-audio", gapless_audio, 0),
// override audio buffer size (used only by -ao oss/win32, obsolete)
OPT_INT("abs", ao_buffersize, 0),
@@ -635,7 +635,7 @@ const m_option_t mplayer_opts[]={
OPT_CHOICE("framedrop", frame_dropping, 0,
({"no", 0},
- {"yes", 1}, {"", 1},
+ {"yes", 1},
{"hard", 2})),
OPT_FLAG_ON("untimed", untimed, 0),
@@ -673,7 +673,7 @@ const m_option_t mplayer_opts[]={
OPT_CHOICE("term-osd", term_osd, 0,
({"force", 1},
- {"auto", 2}, {"", 2},
+ {"auto", 2},
{"no", 0})),
OPT_STRING("term-osd-esc", term_osd_esc, 0, OPTDEF_STR("\x1b[A\r\x1b[K")),