I'm using Spring Shell for one of my projects, and I need a parameter to run my command with a different behavior like --without-logs
.
Basically I need a ShellOption
parameter to check if the parameter is given by the user or not.
Example:
my-command --without-logs --other-opts
my-command --other-opts
I found the solution, by default Spring Shell assign the option to true if we use that like only by option name.
Example:
my-commnand --x
-> x is true
my-command --x
false -> x is false