From 43844d090c5580b71228c7a13efa7ce13b37cab8 Mon Sep 17 00:00:00 2001 From: gpoirier Date: Fri, 2 Sep 2005 08:29:30 +0000 Subject: allow multiple help clauses on the command line, Patch by kiriuja " mplayer-patches AH en-directo POUM net " This one makes mplayer -vo help -ao help -ac help -vc help -pphelp -af help -vfm help -vf help -afm help -fstype help produce the desired output. From the thread: Date: Jul 16, 2005 8:25 PM Subject: [MPlayer-dev-eng] [PATCH] allow multiple help clauses on the command line git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16346 b3059339-0415-0410-9bf9-f77b7e298cf2 --- parser-mecmd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'parser-mecmd.c') diff --git a/parser-mecmd.c b/parser-mecmd.c index b25d440420..b77f8c421e 100644 --- a/parser-mecmd.c +++ b/parser-mecmd.c @@ -51,6 +51,7 @@ m_config_parse_me_command_line(m_config_t *config, int argc, char **argv) int tmp; char *opt; int no_more_opts = 0; + int opt_exit = 0; m_entry_t *lst = NULL, *entry = NULL; #ifdef MP_DEBUG @@ -98,6 +99,10 @@ m_config_parse_me_command_line(m_config_t *config, int argc, char **argv) } } else { tmp = m_config_check_option(config, opt, argv[i + 1]); + if (tmp <= M_OPT_EXIT) { + opt_exit = 1; + tmp = M_OPT_EXIT - tmp; + } if(tmp >= 0) { entry->opts = realloc(entry->opts,(no+2)*2*sizeof(char*)); entry->opts[2*no] = strdup(opt); @@ -106,8 +111,6 @@ m_config_parse_me_command_line(m_config_t *config, int argc, char **argv) no++; } else { // mp_msg(MSGT_CFGPARSER, MSGL_ERR, "m_config_set_option() failed (%d)\n",tmp); - if(tmp == M_OPT_EXIT) - exit(0); goto err_out; } } @@ -124,6 +127,8 @@ m_config_parse_me_command_line(m_config_t *config, int argc, char **argv) } } + if (opt_exit) + exit(0); if(nf == 0) { m_entry_list_free(lst); mp_msg(MSGT_CFGPARSER, MSGL_ERR, "No file given\n"); -- cgit v1.2.3