perfectsense / gyro

Gyro is a command-line tool for creating, updating, and maintaining cloud infrastructure. Gyro makes infrastructure-as-code possible.
https://gyro.dev
Apache License 2.0
134 stars 7 forks source link

Allow Gyro commands to throw exception that displays help message of the command #356

Closed deepanjan90 closed 3 years ago

deepanjan90 commented 3 years ago

Is your feature request related to a problem? Please describe. Implementations of gyro commands should be able to trigger usage help of the respective command conditionally at runtime.

Describe the solution you'd like Currently the command line execution only handles parse exceptions for which usage help is displayed. All other exceptions are just thrown.

https://github.com/perfectsense/gyro/blob/master/cli/src/main/java/gyro/cli/Gyro.java#L108 should be modified to accept CommandLine and another exception should be introduced that allows a flag to display help message.