aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/mplayer.c
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2013-05-15 16:02:52 +0200
committerGravatar wm4 <wm4@nowhere>2013-05-15 16:02:52 +0200
commitd4987bf5ebc7f7830259326daf9dc1c685b34ac0 (patch)
tree07cd02a8904d818ed3c5b7916809713f2e8d5889 /core/mplayer.c
parenta32cc6fcb2d76a396935ee8bddf2023c0f1196be (diff)
options: fix exit code when using help options
Basically a cosmetic change. Fixes github issue #88.
Diffstat (limited to 'core/mplayer.c')
-rw-r--r--core/mplayer.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index 3bbaaf43b4..ac597beac1 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -4711,16 +4711,20 @@ static int mpv_main(int argc, char *argv[])
print_libav_versions();
if (!parse_cfgfiles(mpctx, mpctx->mconfig))
- exit_player(mpctx, EXIT_NONE, 1);
-
- if (!m_config_parse_mp_command_line(mpctx->mconfig, mpctx->playlist,
- argc, argv))
- {
exit_player(mpctx, EXIT_ERROR, 1);
+
+ int r = m_config_parse_mp_command_line(mpctx->mconfig, mpctx->playlist,
+ argc, argv);
+ if (r < 0) {
+ if (r <= M_OPT_EXIT) {
+ exit_player(mpctx, EXIT_NONE, 0);
+ } else {
+ exit_player(mpctx, EXIT_ERROR, 1);
+ }
}
if (handle_help_options(mpctx))
- exit_player(mpctx, EXIT_NONE, 1);
+ exit_player(mpctx, EXIT_NONE, 0);
mp_msg(MSGT_CPLAYER, MSGL_V, "Configuration: " CONFIGURATION "\n");
mp_tmsg(MSGT_CPLAYER, MSGL_V, "Command line:");