diff options
-rw-r--r-- | cfg-mplayer.h | 3 | ||||
-rw-r--r-- | mplayer.c | 8 | ||||
-rw-r--r-- | parser-mpcmd.c | 8 | ||||
-rw-r--r-- | parser-mpcmd.h | 3 |
4 files changed, 12 insertions, 10 deletions
diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 6d105569ae..66b381a920 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -373,7 +373,8 @@ const m_option_t common_opts[] = { // ------------------------- common options -------------------- OPT_MAKE_FLAGS("quiet", quiet, CONF_GLOBAL), {"really-quiet", &verbose, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_PRE_PARSE, 0, -10, NULL}, - {"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOSAVE, 0, 0, NULL}, + // -v is handled in command line preparser + {"v", NULL, CONF_TYPE_FLAG, CONF_NOCFG, 0, 0, NULL}, {"msglevel", (void *) msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, {"msgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, {"nomsgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, @@ -149,12 +149,6 @@ char *heartbeat_cmd; // Config file //**************************************************************************// -static int cfg_inc_verbose(m_option_t *conf) -{ - ++verbose; - return 0; -} - #include "path.h" //**************************************************************************// @@ -3952,7 +3946,7 @@ int main(int argc, char *argv[]) mp_input_register_options(mpctx->mconfig); // Preparse the command line - m_config_preparse_command_line(mpctx->mconfig, argc, argv); + m_config_preparse_command_line(mpctx->mconfig, argc, argv, &verbose); #if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) set_path_env(); diff --git a/parser-mpcmd.c b/parser-mpcmd.c index 49b4e0c5fd..93011d3760 100644 --- a/parser-mpcmd.c +++ b/parser-mpcmd.c @@ -308,7 +308,8 @@ extern int mp_msg_levels[]; * command line parsing), and --really-quiet suppresses messages printed * during normal options parsing. */ -int m_config_preparse_command_line(m_config_t *config, int argc, char **argv) +int m_config_preparse_command_line(m_config_t *config, int argc, char **argv, + int *verbose) { int ret = 0; @@ -330,6 +331,11 @@ int m_config_preparse_command_line(m_config_t *config, int argc, char **argv) // Ignore invalid options if (map_to_option(config, old_syntax, NULL, &opt, ¶m) < 0) continue; + // "-v" is handled here + if (!bstrcmp0(opt, "v")) { + (*verbose)++; + continue; + } // Set, non-pre-parse options will be ignored int r = m_config_set_option(config, opt, param, old_syntax); if (r < 0) diff --git a/parser-mpcmd.h b/parser-mpcmd.h index 3de9f626b5..948105ab6f 100644 --- a/parser-mpcmd.h +++ b/parser-mpcmd.h @@ -24,6 +24,7 @@ play_tree_t *m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv); -int m_config_preparse_command_line(m_config_t *config, int argc, char **argv); +int m_config_preparse_command_line(m_config_t *config, int argc, char **argv, + int *verbose); #endif /* MPLAYER_PARSER_MPCMD_H */ |