decline
decline copied to clipboard
Expose `val command: Command[IO[ExitCode]]` in `CommandIOApp`
If you want to show the help when handling errors in the IO
part of the app, you need to call .showHelp
on the command instance. This is not possible with CommandIOApp
since it doesn't expose the app but creates and uses it on the fly.
This PR adds a val command: Command[IO[ExitCode]]
to CommandIOApp
so you can have similar errors to the errors printed by validate
but when handling IO errors in the app with .handleErrorWith
in the application logic.
This came out as a problem while implementing https://github.com/Quafadas/live-server-scala-cli-js/pull/17 and the current workaround is to copy paste the --version
option from CommandIOApp
and move to IOApp