Allow commands to access the Cli class
The command should be able to either access the Cli instance to allow them to either cause the help/usage text to be displayed, or to cause the program to exit with a specific message and status.
The design of the CLI ends at once the command line is parsed and the command object is created. I chose this line because everyone seems to have a different idea of how actual execution should occur (especially around output messages and exit codes).
Using the current design your command objects could implement an interface with a method like this:
int run(CLI cli);
As for help specifically, your commands can add a field @Inject Help help to get a reference to the help system.
Does this design work for you?
I hadn't noticed the @Inject Help help; reference before, that should do what I need.