I have created a shell application with Spring Boot. In the application.yaml I have enabled interactive mode and script execution:
spring:
application:
name: AMELIOShell
shell:
history:
name: "amelioshell.log"
interactive:
enabled: true
script:
enabled: true
With version Spring Shell 3.4 I could execute the shell non interactively by simply passing a command, e.g.:
java -jar .\amelioshell-5.3.0-SNAPSHOT.jar get-jobstate
The output of the command is displayed, and then the shell exits.
When I run the same command with a jar that was built with version 4.0 the shell starts interactively, and it stops at the prompt. If I add the parameter --spring.shell.interactive.enabled=false then the shell is executed non-interactively.
This is a valid bypass for me, but the previous behaviour was much better.
Is ist possible to find out at runtime whether a command was executed interactively or non interactively?