-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #21242: Add REPL flag to quit after evaluating init script #22636
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
Conversation
Can we have a test case for this? |
You can test it locally, the process terminates immediately, but I don't know how to create a test to verify that. |
I can see that it works the way it is now, but an automated anti-regression test would go a long way. |
Oh, I find this test we may be able to reuse: |
Seems the test is failing 🤔 |
3a88fae
to
1a9ba3a
Compare
Why |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the name, LGTM
I had the same reaction to naming, but I haven't followed the conversation, which mentions Ammonite as a model. Regular scala 2 REPL:
If I wanted to switch the order of evaluation, I'd be inclined to add Edit: quick musing: there's a set of such things I must always look up, such as how to turn off colors in sbt vs scalac. I kind of remember, but it's impractical to try out all the variants, In a problem space where I can't try it out (I could try out Another example is |
Maybe @Gedochao can point out more usages 🤔 |
Or |
Generally speaking, it allows to interact with the REPL without spawning a sub-terminal, which will make testing REPL integrations (on top of which Scala CLI builds) much easier. That's also been the primary motivation for this change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@noti0na1 not merging yet, as to let you finalize the naming of the option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not ship the repl
command, this diminishes SIP-46. No new script should go in the dist/bin
folder without careful thinking (and it shouldn't have a generic name as repl
).
Right, I didn't connect the dots that this script would get subsequently shipped alongside |
We all agree that we shouldn't ship a new script
|
Co-authored-by: Hamza Remmal <[email protected]>
Adding a new REPL flag
--repl-quit-after-init
: evaluate the init script and skip the interactive mode.Fix the remaining part of #21242
Test with flag at REPL startup: