airlift / airline

Java annotation-based framework for parsing Git like command line structures
Apache License 2.0
846 stars 141 forks source link

Allow CommandMetadata to be injected into Cli commands #31

Open nhinds opened 10 years ago

nhinds commented 10 years ago

This allows HelpOption to be used with commands via Cli.parse.

Without this, attempting to use HelpOption with a command via the Cli class instead of SingleCommand results in a NullPointerException when HelpOption.showHelpIfRequested() is called. This commit allows the pattern git add -h to show help correctly.

nhinds commented 9 years ago

@lptr Good idea. I've added something similar to your code from #35 and included a test for it.

@electrum any chance of taking a look at this or #35 and merging one of them?