mirror of
https://github.com/mpv-player/mpv
synced 2025-03-29 15:00:27 +00:00
Small fix with object list (-vf) help.
Tell the user when an object have no option description instead of falling back to the "normal" help, like with -vf pp=help. Don't display a useless error message when querying the help of an object option (as in -vf scale=presize=help). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17875 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
55d26da094
commit
122744d6ed
10
m_option.c
10
m_option.c
@ -1211,7 +1211,8 @@ static int get_obj_param(char* opt_name,char* obj_name, m_struct_t* desc,
|
||||
}
|
||||
r = m_option_parse(opt,str,p,NULL,M_CONFIG_FILE);
|
||||
if(r < 0) {
|
||||
mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Option %s: Error while parsing %s parameter %s (%s)\n",opt_name,obj_name,str,p);
|
||||
if(r > M_OPT_EXIT)
|
||||
mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Option %s: Error while parsing %s parameter %s (%s)\n",opt_name,obj_name,str,p);
|
||||
eq[0] = '=';
|
||||
return r;
|
||||
}
|
||||
@ -1229,7 +1230,8 @@ static int get_obj_param(char* opt_name,char* obj_name, m_struct_t* desc,
|
||||
opt = &desc->fields[(*nold)];
|
||||
r = m_option_parse(opt,opt->name,str,NULL,M_CONFIG_FILE);
|
||||
if(r < 0) {
|
||||
mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Option %s: Error while parsing %s parameter %s (%s)\n",opt_name,obj_name,opt->name,str);
|
||||
if(r > M_OPT_EXIT)
|
||||
mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Option %s: Error while parsing %s parameter %s (%s)\n",opt_name,obj_name,opt->name,str);
|
||||
return r;
|
||||
}
|
||||
if(dst) {
|
||||
@ -1424,6 +1426,10 @@ static int parse_obj_settings(char* opt,char* str,m_obj_list_t* list,
|
||||
|
||||
if(param) {
|
||||
if(!desc && _ret) {
|
||||
if(!strcmp(param,"help")) {
|
||||
mp_msg(MSGT_CFGPARSER, MSGL_INFO, "Option %s: %s have no option description.\n",opt,str);
|
||||
return M_OPT_EXIT - 1;
|
||||
}
|
||||
plist = calloc(4,sizeof(char*));
|
||||
plist[0] = strdup("_oldargs_");
|
||||
plist[1] = strdup(param);
|
||||
|
Loading…
Reference in New Issue
Block a user