mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
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:
parent
c5ed46f5ac
commit
336fa45fa7
@ -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;
|
||||
}
|
||||
|
||||
@ -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.)")
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user