diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-07-29 07:52:29 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-07-29 07:58:56 +0300 |
commit | ad48f8038cf3aa6392912ba65fede7cf71250001 (patch) | |
tree | c9b1352d6e83f80a7b8fbe55075272061d94c32f /m_option.h | |
parent | 5d5ca22a6d9e87d3865ea2feb54218a6e0dfffea (diff) | |
download | mpv-ad48f8038cf3aa6392912ba65fede7cf71250001.tar.bz2 mpv-ad48f8038cf3aa6392912ba65fede7cf71250001.tar.xz |
options: commandline: print error type for parse failures
If parsing an option fails, print a string corresponding to the parse
function return value (M_OPT_MISSING_PARAM etc). The primary
motivation is that the parsing code already outputs messages
explaining most problems, but does not itself print anything in the
missing parameter case. Before double-dash --options such errors were
rare (or rather they resulted in the next commandline argument being
silently misinterpreted as an argument to the previous option
instead); but now an argument like "--ss" should give a better
indication about the problem than just "Error parsing option".
Diffstat (limited to 'm_option.h')
-rw-r--r-- | m_option.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/m_option.h b/m_option.h index 48f94781a3..78ed856f6d 100644 --- a/m_option.h +++ b/m_option.h @@ -423,6 +423,8 @@ struct m_option { #define ERR_OUT_OF_RANGE M_OPT_OUT_OF_RANGE #define ERR_FUNC_ERR M_OPT_PARSER_ERR +char *m_option_strerror(int code); + // Find the option matching the given name in the list. /** \ingroup Options * This function takes the possible wildcards into account (see |