summaryrefslogtreecommitdiffstats
path: root/options/m_option.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-02-13 03:16:29 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-13 17:45:29 -0800
commit223821d91c7ace8a4f7f726f1868bf2ae76b90ba (patch)
tree4083f216ae0b3cb6205ba3e73387345038a93fcc /options/m_option.h
parentd7c38a0b23970569afe76f1c647c895506bfb65d (diff)
downloadmpv-223821d91c7ace8a4f7f726f1868bf2ae76b90ba.tar.bz2
mpv-223821d91c7ace8a4f7f726f1868bf2ae76b90ba.tar.xz
options: minor cleanup to --no-... handling
Most options starting with --no-<name> are automatically translated to --<name>=no. Make the code slightly nicer by using a flag instead of explicitly comparing option types. Also fix an issue that made the option parser print nonsense error messages for if --no-... was used for options which don't support it.
Diffstat (limited to 'options/m_option.h')
-rw-r--r--options/m_option.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/options/m_option.h b/options/m_option.h
index af082a893d..726c080fa9 100644
--- a/options/m_option.h
+++ b/options/m_option.h
@@ -443,6 +443,11 @@ char *format_file_size(int64_t size);
// options can be used without "=" and value.
#define M_OPT_TYPE_OPTIONAL_PARAM (1 << 0)
+// Behaves fundamentally like a choice or a superset of it (all allowed string
+// values are from a fixed set, although other types of values like numbers
+// might be allowed too). E.g. m_option_type_choice and m_option_type_flag.
+#define M_OPT_TYPE_CHOICE (1 << 1)
+
///////////////////////////// Parser flags /////////////////////////////////
// OptionParserReturn