options: --loop without argument means looping forever

Adding a "yes" choice makes the option parser consider this option as a
multi-state flag option, and without argument "yes" is implicitly
selected. "yes" is made an alias for "inf", so it will loop infinitely.

As a negative side effect, the old syntax "-loop inf" does not work
anymore. Since this is ambiguous, the option parser prefers interpreting
the "inf" as filename.

Fixes #1970.
This commit is contained in:
wm4 2015-05-22 14:56:26 +02:00
parent 8c795d7963
commit eb296d4fde
1 changed files with 1 additions and 1 deletions

View File

@ -477,7 +477,7 @@ const m_option_t mp_opts[] = {
OPT_CHOICE_OR_INT("loop", loop_times, 0, 1, 10000,
({"no", 1},
{"inf", -1},
{"inf", -1}, {"yes", -1},
{"force", -2})),
OPT_CHOICE_OR_INT("loop-file", loop_file, 0, 0, 10000,
({"no", 0},