Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jerry-main/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion jerry-main/main-unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.)")
};

/**
Expand Down