mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 12:02:23 +02:00
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").
This commit is contained in:
parent
2b35fc13ed
commit
826c19f706
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user