This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final GnuParser parser = new GnuParser(); | |
final Options options = configureOptions(); | |
// parse with the parser | |
CommandLine cmdLine = null; | |
try { | |
cmdLine = parser.parse(options, args); | |
} catch(ParseException e) { | |
e.printStackTrace(); | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Options options = new Options(); | |
// create the simple option without using the OptionBuilder | |
options.addOption("o", "opt", false, "An option, no args"); | |
// simple help option using the builder | |
options.addOption(OptionBuilder.withLongOpt("help") | |
.create("h")); | |
// an option with a value separator, defaults to = |
NewerOlder