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:
committed by
Robert Fancsik
parent
c5ed46f5ac
commit
336fa45fa7
+1
-1
@@ -112,7 +112,7 @@ cli_consume_option (cli_state_t *state_p) /**< state of the command line option
|
|||||||
|
|
||||||
state_p->arg = arg;
|
state_p->arg = arg;
|
||||||
|
|
||||||
if (arg[0] != '-')
|
if (arg[0] != '-' || (arg[0] == '-' && arg[1] == '\0'))
|
||||||
{
|
{
|
||||||
return CLI_OPT_DEFAULT;
|
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",
|
CLI_OPT_DEF (.id = OPT_NO_PROMPT, .longopt = "no-prompt",
|
||||||
.help = "don't print prompt in REPL mode"),
|
.help = "don't print prompt in REPL mode"),
|
||||||
CLI_OPT_DEF (.id = CLI_OPT_DEFAULT, .meta = "FILE",
|
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.)")
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user