...
Wiki Markup \[http://www.devx.com/Java/Article/30117 Extend the JDK Classes with Jakarta Commons, Part III\] - Explore Jakarta Commons components that enable you to parse arguments in a command-line application, connect to various file systems at the same time, allow an application to uniformly access configurations loaded from various sources, and pool any object. \\
Documentation Bugs
The Usage Scenarios documentation shows the PosixParser being used for the Ant example. This won't work. Either the BasicParser or GnuParser should be used for this example.
Wiki Markup |
---|
The \[http://jakarta.apache.org/commons/cli/usage.html Usage Scenarios\] documentation gives an API usage example for the Ant *logfile* option of: |
Option logfile = OptionBuilder.withArgName( "file" )
BR
No Format |
---|
.hasArg() |
No Format |
---|
.withDescription( "use given file for log" ) |
No Format |
---|
.create( " |
file" );
This should instead be:
Option logfile = OptionBuilder.withArgName( "file" )
BR
No Format |
---|
.hasArg() |
No Format |
---|
.withDescription( "use given file for log" ) |
No Format |
---|
.create( " |
logfile" );
Similarly for the find option:
Option find = OptionBuilder.withArgName( "file" )
BR
No Format |
---|
.hasArg() |
No Format |
---|
.withDescription( "use given file for log" ) |
No Format |
---|
.create( " |
find" );
The section titled "Retrieving the argument value" shows an example of accessing the getOptionValue() method of Options. This is actually a method of CommandLine.
// get c option value
BR
String countryCode =
options.getOptionValue("c");
// (Wrong if options is an instance of Options)
This should instead be:
...