mirror of
https://github.com/mpv-player/mpv
synced 2024-12-31 19:52:16 +00:00
print meaningful error message for missing parameter
noticed by Colin Leroy <colin@colino.net> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9223 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
534d1a275c
commit
e8b3a3bd4a
12
m_config.c
12
m_config.c
@ -253,6 +253,10 @@ m_config_parse_option(m_config_t *config, char* arg, char* param,int set) {
|
||||
if(sr == M_OPT_UNKNOW){
|
||||
mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Error: option '%s' has no suboption '%s'\n",co->name,lst[2*i]);
|
||||
r = M_OPT_INVALID;
|
||||
} else
|
||||
if(sr == M_OPT_MISSING_PARAM){
|
||||
mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Error: suboption '%s' of '%s' must have a parameter!\n",lst[2*i],co->name);
|
||||
r = M_OPT_INVALID;
|
||||
} else
|
||||
r = sr;
|
||||
}
|
||||
@ -284,8 +288,14 @@ m_config_set_option(m_config_t *config, char* arg, char* param) {
|
||||
|
||||
int
|
||||
m_config_check_option(m_config_t *config, char* arg, char* param) {
|
||||
int r;
|
||||
mp_msg(MSGT_CFGPARSER, MSGL_DBG2,"Checking %s=%s\n",arg,param);
|
||||
return m_config_parse_option(config,arg,param,0);
|
||||
r=m_config_parse_option(config,arg,param,0);
|
||||
if(r==M_OPT_MISSING_PARAM){
|
||||
mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Error: option '%s' must have a parameter!\n",arg);
|
||||
return M_OPT_INVALID;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user