summaryrefslogtreecommitdiffstats
path: root/parser-mpcmd.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-mpcmd.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-mpcmd.c')
-rw-r--r--parser-mpcmd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/parser-mpcmd.c b/parser-mpcmd.c
index 137f72cbca..67b579b644 100644
--- a/parser-mpcmd.c
+++ b/parser-mpcmd.c
@@ -63,6 +63,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
char *opt,*splitpos=NULL;
char entbuf[10];
int no_more_opts = 0;
+ int opt_exit = 0; // flag indicating whether mplayer should exit without playing anything
play_tree_t *last_parent, *last_entry = NULL, *root;
#ifdef MACOSX_FINDER_SUPPORT
extern play_tree_t *macosx_finder_args(m_config_t *, int , char **);
@@ -196,9 +197,11 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
}
}
+ if (tmp <= M_OPT_EXIT) {
+ opt_exit = 1;
+ tmp = M_OPT_EXIT - tmp;
+ } else
if (tmp < 0) {
- if (tmp == M_OPT_EXIT)
- exit(0);
goto err_out;
}
i += tmp;
@@ -252,6 +255,8 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
}
}
+ if (opt_exit)
+ goto err_out;
--recursion_depth;
if(last_parent != root)
mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Missing }- ?\n");