@Override public Void apply(String errorMsg) { MainClassUtils.exitWithError(errorMsg, cmdLineParser, USAGE_PREFIX); return null; } };
@Override public Void apply(String errorMsg) { MainClassUtils.exitWithError(errorMsg, cmdLineParser, USAGE_PREFIX); return null; } };
@Override public Void apply(String errorMsg) { MainClassUtils.exitWithError(errorMsg, cmdLineParser, USAGE_PREFIX); return null; } };
@Override public Void apply(String errorMsg) { MainClassUtils.exitWithError(errorMsg, cmdLineParser, USAGE_PREFIX); return null; } };
/** * Parses command line flags written with args4j. * * @param objWithFlags An instance of a class containing args4j flag definitions. * @param args The args string to parse. * @param usagePrefix The string to prepend to the usage message (when reporting an error). * @return The CmdLineParser that was created and used to parse the args (can be used to print * usage text for flags when reporting errors). */ public static CmdLineParser parseFlags(Object objWithFlags, String[] args, String usagePrefix) { CmdLineParser cmdLineParser = new CmdLineParser(objWithFlags); cmdLineParser.setUsageWidth(100); try { cmdLineParser.parseArgument(args); } catch(CmdLineException cle) { exitWithError(cle.getMessage(), cmdLineParser, usagePrefix); } return cmdLineParser; }
MainClassUtils.exitWithError("Must provide output directory.", cmdLineParser, USAGE_PREFIX); MainClassUtils.exitWithError("Must provide Java package.", cmdLineParser, USAGE_PREFIX); MainClassUtils.exitWithError( "Must provide Java class name source.", cmdLineParser, USAGE_PREFIX);
MainClassUtils.exitWithError( "Must provide the output path format.", cmdLineParser, USAGE_PREFIX);