Package util

Examples of util.CommandLine


      Thread.sleep(50);
    }
  }

  public static Options parseCommandLine(String[] args) {
    CommandLine commandLine = new CommandLine(OPTION_DESCRIPTOR);
    if (commandLine.parse(args)) {
      boolean verbose = commandLine.hasOption("v");
      String interactionClassName = commandLine.getOptionArgument("i", "interactionClass");
      String portString = commandLine.getArgument("port");
      int port = (portString == null) ? 8099 : Integer.parseInt(portString);
      String statementTimeoutString = commandLine.getOptionArgument("s", "statementTimeout");
      Integer statementTimeout = (statementTimeoutString == null) ? null : Integer.parseInt(statementTimeoutString);
      boolean daemon = commandLine.hasOption("d");
      return new Options(verbose, port, getInteractionClass(interactionClassName), daemon, statementTimeout);
    }
    return null;
  }
View Full Code Here


    fixture.listener = fixtureListener;
    return fixture;
  }

  public void args(String[] argv) {
    CommandLine commandLine = new CommandLine("[-v][-x][-s] host port socketToken");
    if (commandLine.parse(argv)) {
      host = commandLine.getArgument("host");
      port = Integer.parseInt(commandLine.getArgument("port"));
      socketToken = Integer.parseInt(commandLine.getArgument("socketToken"));
      verbose = commandLine.hasOption("v");
      noExit = commandLine.hasOption("x");
      sentinel = commandLine.hasOption("s");
    } else
      usage();
  }
View Full Code Here

TOP

Related Classes of util.CommandLine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.