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

CLI: all --eval <code> should evaluate #23665

Closed
StefanKarpinski opened this issue Sep 11, 2017 · 1 comment · Fixed by #23775
Closed

CLI: all --eval <code> should evaluate #23665

StefanKarpinski opened this issue Sep 11, 2017 · 1 comment · Fixed by #23775
Assignees
Milestone

Comments

@StefanKarpinski
Copy link
Member

Currently we only evaluate the last --eval <code> argument. This makes it impossible to build up a sequence of code to run via separate --eval arguments, which is often useful. Our current behavior is also at odds with Perl and Ruby which are generally considered to be good models for useful CLI behavior:

$ perl -e 'print("this\n");' -e 'print("that\n");'
this
that
$ ruby -e 'print("this\n");' -e 'print("that\n");'
this
that

In Python, the first occurrence of -c terminates option parsing, which we do not do, so following Python here would not make sense. A more conservative choice would be erroring on multiple --eval options, which would allow us to change the behavior in the future without breaking code.

@StefanKarpinski StefanKarpinski added the triage This should be discussed on a triage call label Sep 11, 2017
@JeffBezanson JeffBezanson added this to the 1.0 milestone Sep 14, 2017
@JeffBezanson
Copy link
Member

For now should at least have an error for multiple occurrences (same deal for the -L option) to prevent dependence on the current strange behavior. I agree it would be good to eval all -e expressions, but implementing that is a bit difficult due to how options are stored and passed around.

@JeffBezanson JeffBezanson removed the triage This should be discussed on a triage call label Sep 14, 2017
@vtjnash vtjnash self-assigned this Sep 14, 2017
vtjnash added a commit that referenced this issue Sep 19, 2017
vtjnash added a commit that referenced this issue Sep 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants