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
Support execute-then-quit as arguments in addition to @/path/to/file #189
Support execute-then-quit as arguments in addition to @/path/to/file #189
Conversation
Handle exit as a dedicated case (prevents eg 'exit' commands in scripts to make script quit) Add an example of custom ApplicationRunner Fixes spring-projects#187 Fixes spring-projects#183
Codecov Report
@@ Coverage Diff @@
## master #189 +/- ##
============================================
- Coverage 53.53% 52.86% -0.67%
Complexity 291 291
============================================
Files 52 52
Lines 1429 1447 +18
Branches 223 228 +5
============================================
Hits 765 765
- Misses 603 619 +16
- Partials 61 63 +2
Continue to review full report at Codecov.
|
Merry Christmas @jvalkeal
and
|
This seem to have a side-effect for Current master:
This PR:
|
This is weird. I don't get the behavior you describe, but I do get something odd: |
It now works slightly better but looks like you get into trouble with options:
I'm not sure if this should now work OOB or if arguments needs some sort of a custom handling. |
This is because I used an I changed the example to use a
|
Merged as f90edd4 |
Hi Eric, Any reason not to include a CommandLineApplicationRunner as standard instead of just the example? I can't think of too many downsides since the In any case spring-shell 1.x had that behavior and we use it quite a bit for automation. |
The principal reason is that Spring Shell 2 applications are typically Spring Boot applications, and as such may certainly use the |
@ericbottard - Can you give me a few details on how the "non-interactive" mode functionality should work. Sample code works great in interactive mode;
However, after I add spring.shell.interactive.enabled=false to application.properties the console exits right away. It doesn't look like the command is running. I tried running the help command with the syntax mentioned above and that didn't even work. Any help would be greatful. FYI - I did clone the repo and build the code to make sure I had the latest and greatest. |
@ccaspanello The feature described here is not available "out-of-the-box". The setting you mention is supporting it, but additional setup is required. Have a look at ExampleApplicationRunnerConfiguration |
Make ResultHandlers configuration more explicit
Handle exit as a dedicated case (prevents eg 'exit' commands in scripts to make script quit)
Add an example of custom ApplicationRunner
Fixes #187
Fixes #183