From 924d4db0de4969b6713b96be73cc947bbff05ad1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 7 Jun 2014 23:41:47 +0200 Subject: options: change --sub-file behavior --sub-file is actually a string list, so you can add multipel external subtitle files. But to be able to set a list, the option value was split on ",". This made it impossible to add filenames. One possible solution would be adding escaping. That's probably a good idea (and some other options already do this), but it's also complicated both to implement and for the user. The simpler solution is making --sub-file appending, and make it take only a single entry. I'm not quite sure about this yet. It breaks the invariant that if a value is printed and parsed, you get the same value back. So for now, just go with the simple solution. Fixes #840. --- options/m_option.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'options/m_option.h') diff --git a/options/m_option.h b/options/m_option.h index 6a38a7f4e6..b7579bd5e9 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -47,6 +47,7 @@ extern const m_option_type_t m_option_type_float; extern const m_option_type_t m_option_type_double; extern const m_option_type_t m_option_type_string; extern const m_option_type_t m_option_type_string_list; +extern const m_option_type_t m_option_type_string_append_list; extern const m_option_type_t m_option_type_keyvalue_list; extern const m_option_type_t m_option_type_time; extern const m_option_type_t m_option_type_rel_time; @@ -575,6 +576,9 @@ extern const char m_option_path_separator; #define OPT_STRINGLIST(...) \ OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_string_list) +#define OPT_STRING_APPEND_LIST(...) \ + OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_string_append_list) + #define OPT_KEYVALUELIST(...) \ OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_keyvalue_list) -- cgit v1.2.3