CmdLineParser cmdLineParser = new CmdLineParser(flags);
try {
cmdLineParser.parseArgument(strings);
} catch (CmdLineException e) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
cmdLineParser.printUsage(stream);
throw new InvalidFlagException(e.getMessage(), stream.toString());
}
if (strings.length == 0 || flags.getDisplayHelp()) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
cmdLineParser.printUsage(stream);