changeset 17874:1973600f8f3e

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).
author albeu
date Wed, 15 Mar 2006 17:16:13 +0000
parents 1ea882991bb4
children 3bf109509189
files m_option.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/m_option.c	Wed Mar 15 16:28:31 2006 +0000
+++ b/m_option.c	Wed Mar 15 17:16:13 2006 +0000
@@ -1211,7 +1211,8 @@
     }
     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 @@
     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 @@
 
   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);