This file contains 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
// check to see if they need help | |
// notice we only use the short-version, but it checks both! | |
if(cmdLine.hasOption("h")) { | |
new HelpFormatter().printHelp("sop4j-cli", options); | |
return; | |
} | |
// check to see if they passed in an opt | |
// recommended to use the long version as it's more readable | |
if(cmdLine.hasOption("opt")) { |
This file contains 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; |
NewerOlder