Sitelet https://github.com/nodejs/node/issues/1197
Skip to content

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

Description

@radare

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

$ iojs -ie 'console.log ("hi")' 

Activity

  1. added
    replIssues and PRs related to the REPL subsystem.
    on Mar 19, 2015
  2. silverwind commented on Mar 19, 2015

    @silverwind
    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).

  3. bnoordhuis commented on Mar 19, 2015

    @bnoordhuis
    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.

  4. Trott commented on Mar 11, 2016

    @Trott
    Member

    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.

  5. Trott commented on Mar 16, 2016

    @Trott
    Member

    #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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.replIssues and PRs related to the REPL subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions