public static void main(String[] args) throws Exception { VerifySegmentState verifier = new VerifySegmentState(); CmdLineParser cmdLineParser = new CmdLineParser(verifier); try { cmdLineParser.parseArgument(args); } catch (CmdLineException e) { LOGGER.error("Failed to read command line arguments: ", e); cmdLineParser.printUsage(System.err); System.exit(1); } verifier.execute(); } }
/** * Main method for the class. Parses the command line arguments, and invokes the benchmark. * * @param args Command line arguments. * @throws Exception */ public static void main(String[] args) throws Exception { RawIndexBenchmark benchmark = new RawIndexBenchmark(); CmdLineParser parser = new CmdLineParser(benchmark); parser.parseArgument(args); benchmark.run(); } }
public void execute(String[] args) throws Exception { try { CmdLineParser parser = new CmdLineParser(this); parser.parseArgument(args); if ((_subCommand == null) || _help) { printUsage(); } else if (_subCommand.getHelp()) { _subCommand.printUsage(); } else { _subCommand.execute(); } } catch (CmdLineException e) { LOGGER.error("Error: {}", e.getMessage()); } catch (Exception e) { LOGGER.error("Exception caught: ", e); } }
private int run(String[] args) { CmdLineParser p = new CmdLineParser(this); try { p.parseArgument(args); run(); return 0; } catch (CmdLineException e) { System.err.println(e.getMessage()); p.printUsage(System.err); return 1; } }
public void doMain(String[] args) throws Exception { CmdLineParser parser = new CmdLineParser(this); parser.parseArgument(args); System.out.print("\t"); System.out.println(); System.out.print("\t"); System.out.println(); if (starTrees != null) { for (StarTreeV2 starTree : starTrees) { System.out.println(); starTree.getStarTree().printTree(dictionaries);
private void printUsage(Object options) { CmdLineParser parser = new CmdLineParser(options); StringWriter sw = new StringWriter(); sw.append(USAGE_PREFIX + "\n"); sw.append(ALT_USAGE_PREFIX + " <source> <destination>\n"); sw.append(ALT_USAGE_PREFIX + " [OPTION]... [<value>...]\n\n"); sw.append("Options:"); System.out.println(sw.toString()); parser.getProperties().withUsageWidth(100); parser.printUsage(System.out); }
public void printUsage (PrintStream out) { CmdLineParser parser; parser = new CmdLineParser(options); parser.printUsage(out); }
public static void main(String[] args) throws IOException { CryptFileCommands commands = new CryptFileCommands(); CmdLineParser parser = new CmdLineParser(commands); try { parser.parseArgument(args); } catch (CmdLineException e) { System.out.println(e); System.out.println(); e.getParser().printUsage(System.out); System.exit(1); } commands.command.run(); } }
CmdLineParser parser = new CmdLineParser(options); try { parser.parseArgument(args); } catch (CmdLineException cle) { usage(parser); System.err.println( Main.class.getPackage().getImplementationVersion()); System.exit(0); System.err.println("Multiple configurations require" + " identical s3proxy properties"); System.exit(1); s3Proxy = s3ProxyBuilder.build(); } catch (IllegalArgumentException | IllegalStateException e) { System.err.println(e.getMessage()); System.exit(1); throw e;
private void printUsage(Object options) { CmdLineParser parser = new CmdLineParser(options); StringWriter sw = new StringWriter(); sw.append(USAGE_PREFIX + "\n"); sw.append(ALT_USAGE_PREFIX + " <source> <destination>\n"); sw.append(ALT_USAGE_PREFIX + " [OPTION]... [<value>...]\n\n"); sw.append("Options:"); System.out.println(sw.toString()); parser.getProperties().withUsageWidth(100); parser.printUsage(System.out); }
/** * Main method for the class. * * @param args Arguments for the converter * @throws Exception */ public static void main(String[] args) throws Exception { DictionaryToRawIndexConverter converter = new DictionaryToRawIndexConverter(); CmdLineParser parser = new CmdLineParser(converter); parser.parseArgument(args); converter.convert(); } }
public void execute(String[] args) throws Exception { try { CmdLineParser parser = new CmdLineParser(this); parser.parseArgument(args); if ((_subCommand == null) || _help) { printUsage(); } else if (_subCommand.getHelp()) { _subCommand.printUsage(); _status = true; } else { _status = _subCommand.execute(); } } catch (CmdLineException e) { LOGGER.error("Error: {}", e.getMessage()); } catch (Exception e) { LOGGER.error("Exception caught: ", e); } }
public static void main(String[] args) throws Exception { MoveReplicaGroup mrg = new MoveReplicaGroup(); CmdLineParser parser = new CmdLineParser(mrg); try { parser.parseArgument(args); } catch (CmdLineException e) { LOGGER.error("Failed to parse arguments: {}", e); parser.printUsage(System.err); System.exit(1); } mrg.execute(); } }
/** * Prints the usage information for the CLI * * @param out */ public static void printUsage(final PrintWriter out) { final CliArguments arguments = new CliArguments(); final CmdLineParser parser = new CmdLineParser(arguments); parser.setUsageWidth(120); parser.printUsage(out, null); }
public static void main(String[] args) throws IOException, CmdLineException { SnippetCommands commands = new SnippetCommands(); CmdLineParser parser = new CmdLineParser(commands); try { parser.parseArgument(args); } catch (CmdLineException e) { System.out.println(e); System.out.println(); e.getParser().printUsage(System.err); System.exit(1); } commands.command.run(); } }
public static void main(final String[] args) { Arguments arguments = new Arguments(); try { CmdLineParser parser = new CmdLineParser(arguments); parser.parseArgument(args); } catch (CmdLineException e) { System.out.println("Error: " + e.getLocalizedMessage()); return; } start(arguments); }
public static void main(String[] args) throws Exception { QueryRunner queryRunner = new QueryRunner(); CmdLineParser parser = new CmdLineParser(queryRunner); parser.parseArgument(args); if (queryRunner._help) { queryRunner.printUsage(); } else { queryRunner.execute(); } } }
private LaunchOptions parseArguments(String[] args) { LaunchOptions res = new LaunchOptions(); CmdLineParser parser = new CmdLineParser(res); try { parser.parseArgument(args); } catch (final CmdLineException e) { printUsage(res); throw new JBakeException("Invalid commandline arguments: " + e.getMessage(), e); } return res; }
public DeepLearning4jDistributedApp(String[] args) { CmdLineParser parser = new CmdLineParser(this); try { parser.parseArgument(args); } catch (CmdLineException e) { parser.printUsage(System.err); log.error("Unable to parse args",e); } }
/** * Prints the usage of the command. */ public void printUsage() { CmdLineParser parser = new CmdLineParser(this); LOG.info(getDescription()); LOG.info(""); parser.printUsage(new OutputStreamWriter(LOG.getOutputStream()), null, OptionHandlerFilter.ALL); }