diff options
author | wm4 <wm4@nowhere> | 2018-02-13 03:16:29 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-02-13 17:45:29 -0800 |
commit | 223821d91c7ace8a4f7f726f1868bf2ae76b90ba (patch) | |
tree | 4083f216ae0b3cb6205ba3e73387345038a93fcc /options/m_option.h | |
parent | d7c38a0b23970569afe76f1c647c895506bfb65d (diff) | |
download | mpv-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.h | 5 |
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 |