Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Trivial
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: command line processing
-
Labels:None
-
Number of attachments :
Description
My organization has specific standards for --help messages, usage instructions and such. Very UNIX-y, very Close to what CliBuilder give you out of the box. So this is a general appeal to give the user more opportunity to customize the output with a few specific requests.
When you type XXX --help for any command that has a non-existent option. You get the error: ParseException.message before the usage() message. First, our norm is a blank line between the error message and the usage message, which I can't do because of the way parse(args) is written. Adding a blank line would be good. Adding a public string that lets you specify error handing would be good. Placing the exception handler in a closure and letting the user over-ride error conditions might also work.
Second, the parse exception should probably be handled differently when the only option passed is --help. This may be more of an issue for how Commons CLI handles their exception policy and thus rightly belong to them, but CliBuilder's genius is that is make Apache CLI workable, so you might think about it anyways.
Lastly, we have introduced Groovy UNIX shell scripts into an org where Python and PERL dominate the scripting world and scheduled scripts are important to our business, so the combo of the CliBuilder and shell scripting support has made Groovy and the JVM relevant in a way this organization would never have imagined a few years ago.
Hi Jonathan, glad most of the Groovy ecosystem is working out for you. You might like to also look at groovyserv in terms of reducing startup times for Groovy - another issue which non-JVM unix people often criticise about languages on the JVM.
Just on the CLI suggestions, I read your comments above and think I know what you are after but am not 100% sure. Any chance you could provide some more examples?
To get the ball rolling, does the below workaround solve one of your issues?