summaryrefslogtreecommitdiffstats
path: root/parser-mecmd.c
diff options
context:
space:
mode:
authorgpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-09-02 08:29:30 +0000
committergpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-09-02 08:29:30 +0000
commit43844d090c5580b71228c7a13efa7ce13b37cab8 (patch)
tree4eba848365b1290435183da2cd7e2d95865b20f0 /parser-mecmd.c
parent2a9b3541abe07838a0fe62fa1524a934488393d1 (diff)
downloadmpv-43844d090c5580b71228c7a13efa7ce13b37cab8.tar.bz2
mpv-43844d090c5580b71228c7a13efa7ce13b37cab8.tar.xz
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
Diffstat (limited to 'parser-mecmd.c')
-rw-r--r--parser-mecmd.c9
1 files changed, 7 insertions, 2 deletions
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");