mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 20:03:10 +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 argc, char **argv)
|
||||||
{
|
{
|
||||||
int mode = 0;
|
int mode = 0;
|
||||||
bool opt_exit = false; // exit immediately after parsing (help options)
|
|
||||||
struct playlist_entry *local_start = NULL;
|
struct playlist_entry *local_start = NULL;
|
||||||
bool shuffle = false;
|
bool shuffle = false;
|
||||||
|
|
||||||
@ -182,10 +181,9 @@ bool m_config_parse_mp_command_line(m_config_t *config, struct playlist *files,
|
|||||||
} else {
|
} else {
|
||||||
r = m_config_check_option(config, p.arg, p.param);
|
r = m_config_check_option(config, p.arg, p.param);
|
||||||
}
|
}
|
||||||
if (r <= M_OPT_EXIT) {
|
if (r <= M_OPT_EXIT)
|
||||||
opt_exit = true;
|
goto err_out;
|
||||||
r = M_OPT_EXIT - r;
|
if (r < 0) {
|
||||||
} else if (r < 0) {
|
|
||||||
char *msg = m_option_strerror(r);
|
char *msg = m_option_strerror(r);
|
||||||
if (!msg)
|
if (!msg)
|
||||||
goto print_err;
|
goto print_err;
|
||||||
@ -316,9 +314,6 @@ bool m_config_parse_mp_command_line(m_config_t *config, struct playlist *files,
|
|||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt_exit)
|
|
||||||
goto err_out;
|
|
||||||
|
|
||||||
if (shuffle)
|
if (shuffle)
|
||||||
playlist_shuffle(files);
|
playlist_shuffle(files);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user