Make REPL option parser handle "-" option properly (#3384)

REPL could read JS file from standard input when we passed "-" option,
but after #1896 "-" became invalid option mistakenly.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
This commit is contained in:
Csaba Osztrogonác 2019-11-29 14:52:54 +01:00 committed by Robert Fancsik
parent c5ed46f5ac
commit 336fa45fa7
2 changed files with 2 additions and 2 deletions

View File

@ -112,7 +112,7 @@ cli_consume_option (cli_state_t *state_p) /**< state of the command line option
state_p->arg = arg;
if (arg[0] != '-')
if (arg[0] != '-' || (arg[0] == '-' && arg[1] == '\0'))
{
return CLI_OPT_DEFAULT;
}

View File

@ -366,7 +366,7 @@ static const cli_opt_t main_opts[] =
CLI_OPT_DEF (.id = OPT_NO_PROMPT, .longopt = "no-prompt",
.help = "don't print prompt in REPL mode"),
CLI_OPT_DEF (.id = CLI_OPT_DEFAULT, .meta = "FILE",
.help = "input JS file(s)")
.help = "input JS file(s) (If file is -, read standard input.)")
};
/**