diff options
Diffstat (limited to 'core/m_option.h')
-rw-r--r-- | core/m_option.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/core/m_option.h b/core/m_option.h index a3da08ea7a..e63bf3610f 100644 --- a/core/m_option.h +++ b/core/m_option.h @@ -363,6 +363,9 @@ struct m_option { // (e.g. "--parent=child=value" becomes "--child=value") #define M_OPT_MERGE (1 << 9) +// See M_OPT_TYPE_OPTIONAL_PARAM. +#define M_OPT_OPTIONAL_PARAM (1 << 10) + // These are kept for compatibility with older code. #define CONF_MIN M_OPT_MIN #define CONF_MAX M_OPT_MAX @@ -397,10 +400,11 @@ struct m_option { */ #define M_OPT_TYPE_DYNAMIC (1 << 2) -// The parameter is optional and by default no parameter is preferred. If the -// "old syntax" is used, the command line parser will assume that the argument -// takes no parameter. -#define M_OPT_TYPE_OLD_SYNTAX_NO_PARAM (1 << 3) +// The parameter is optional and by default no parameter is preferred. If +// ambiguous syntax is used ("--opt value"), the command line parser will +// assume that the argument takes no parameter. In config files, these +// options can be used without "=" and value. +#define M_OPT_TYPE_OPTIONAL_PARAM (1 << 3) // modify M_OPT_TYPE_HAS_CHILD so that m_option::p points to // struct m_sub_options, instead of a direct m_option array. @@ -408,7 +412,9 @@ struct m_option { ///////////////////////////// Parser flags ///////////////////////////////// -// On success parsers return the number of arguments consumed: 0 or 1. +// OptionParserReturn +// +// On success parsers return a number >= 0. // // To indicate that MPlayer should exit without playing anything, // parsers return M_OPT_EXIT minus the number of parameters they @@ -429,13 +435,16 @@ struct m_option { // vary from type to type. #define M_OPT_OUT_OF_RANGE -4 +// The option doesn't take a parameter. +#define M_OPT_DISALLOW_PARAM -5 + // Returned if the parser failed for any other reason than a bad parameter. -#define M_OPT_PARSER_ERR -5 +#define M_OPT_PARSER_ERR -6 // Returned when MPlayer should exit. Used by various help stuff. /** M_OPT_EXIT must be the lowest number on this list. */ -#define M_OPT_EXIT -6 +#define M_OPT_EXIT -7 char *m_option_strerror(int code); |