Skip to content
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

iojs -i does nothing when -e is used #1197

Closed
radare opened this issue Mar 18, 2015 · 4 comments
Closed

iojs -i does nothing when -e is used #1197

radare opened this issue Mar 18, 2015 · 4 comments
Labels
feature request Issues that request new features to be added to Node.js. repl Issues and PRs related to the REPL subsystem.

Comments

@radare
Copy link

radare commented Mar 18, 2015

The following command should evaluate that expression and then enter into the REPL, but it does not

$ iojs -ie 'console.log ("hi")' 
@mscdex mscdex added the repl Issues and PRs related to the REPL subsystem. label Mar 19, 2015
@silverwind
Copy link
Contributor

I'm not sure -i works like that:

  -i, --interactive    always enter the REPL even if stdin
                       does not appear to be a terminal

It appears to just be a switch to force a repl on strange terminals (with no other arguments).

@bnoordhuis
Copy link
Member

Yes, that's what it's for. I suspect that the expectation is that -ie works like -ic does with python:

$ python -ic 'x = 42'
>>> x
42

Right now, it's rejected as a bad flag. I'd be fine with a PR that adds such functionality.

@brendanashworth brendanashworth added the feature request Issues that request new features to be added to Node.js. label Jun 24, 2015
Trott added a commit to Trott/io.js that referenced this issue Mar 11, 2016
If both -i and -e flags are specified, do not ignore the -i. Instead,
launch the interactive REPL and start by evaluating the passed string.

Fixes: nodejs#1197
@Trott
Copy link
Member

Trott commented Mar 11, 2016

There are really two separate issues here:

  • if -i and -e are specified, then -i is ignored
  • if multiple flags are specified together (that is, something like node -ie rather than node -i -e), the CLI will not pick the flags apart

#5655 is a proposed fix to the first issue, but not the second one.

@Trott Trott closed this as completed in ba16a12 Mar 16, 2016
@Trott
Copy link
Member

Trott commented Mar 16, 2016

#5655 has landed so node -i -e will now work with node build from the current master branch. node -ie will be fixed by improved args parsing which @evanlucas hopes to land soon-ish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants