diff options
author | wm4 <wm4@nowhere> | 2012-11-01 00:42:27 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-11-01 02:12:18 +0100 |
commit | 826c19f706ffbbf901d493fa603d2586712e4f18 (patch) | |
tree | 97699263a88b24c941d5556366da4780fafb1489 | |
parent | 2b35fc13eddb4cbad2422e53bb9be26df3dfc205 (diff) | |
download | mpv-826c19f706ffbbf901d493fa603d2586712e4f18.tar.bz2 mpv-826c19f706ffbbf901d493fa603d2586712e4f18.tar.xz |
parser-mpcmd: minor simplification
Note that we don't care that mpv prints "fatal error" as exit reason
when help was requested and printed (e.g. "mpv -h").
-rw-r--r-- | parser-mpcmd.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/parser-mpcmd.c b/parser-mpcmd.c index d87e820e0f..730e4c581f 100644 --- a/parser-mpcmd.c +++ b/parser-mpcmd.c @@ -156,7 +156,6 @@ bool m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, int argc, char **argv) { int mode = 0; - bool opt_exit = false; // exit immediately after parsing (help options) struct playlist_entry *local_start = NULL; bool shuffle = false; @@ -182,10 +181,9 @@ bool m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, } else { r = m_config_check_option(config, p.arg, p.param); } - if (r <= M_OPT_EXIT) { - opt_exit = true; - r = M_OPT_EXIT - r; - } else if (r < 0) { + if (r <= M_OPT_EXIT) + goto err_out; + if (r < 0) { char *msg = m_option_strerror(r); if (!msg) goto print_err; @@ -316,9 +314,6 @@ bool m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, goto err_out; } - if (opt_exit) - goto err_out; - if (shuffle) playlist_shuffle(files); |