Examples of PosixParser


Examples of com.alibaba.antx.util.cli.PosixParser

    public CommandLine parse(String[] args) {
        CommandLine cli;

        try {
            cli = new PosixParser().parse(options, args);
        } catch (ParseException e) {
            throw new CLIException(e);
        }

        return cli;
View Full Code Here

Examples of com.zaranux.client.org.apache.commons.cli.PosixParser

  }
  @Override
  protected final void main(String[] args) {
      try
      {
        CommandLineParser parser = new PosixParser();
        cmd = parser.parse( options, args,true);
        execute( new AsyncCallback<Boolean>()
      {
        public void onSuccess(Boolean b) // ture, got user's credential, false user cancelled, ...
        {
          Log.debug("ending command " + this.getClass().getName());
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

  /**
   * @return
   */
  protected CommandLineParser getParser() {
    if( parser == null )
      parser = new PosixParser();
    return parser;
  }
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

  private static CommandLine parseCommands(String[] args, boolean constart) {
   
    if (args==null)
      return null;
   
    CommandLineParser parser = new PosixParser();
    Options options = new Options();
    options.addOption("h", "help", false, "Show this help.");
    OptionBuilder.withLongOpt("exec");
    OptionBuilder.hasArg();
    OptionBuilder.withArgName("file");
    OptionBuilder.withDescription("Execute script file. The file should end with 'logout', otherwise the parser thread doesn't stop.");
    options.addOption( OptionBuilder.create('e'));
   
    OptionBuilder.withLongOpt("command");
    OptionBuilder.hasArg();
    OptionBuilder.withArgName("command");
    OptionBuilder.withDescription("Execute single script command. Try '-c help' for help on commands.");
    options.addOption(OptionBuilder.create('c'));
   
    OptionBuilder.withLongOpt("ui");
    OptionBuilder.withDescription("Run <uis>. ',' separated list of user interfaces to run. The first one given will respond to requests without determinable source UI (e.g. further torrents added via command line).");
    OptionBuilder.withArgName("uis");
    OptionBuilder.hasArg();
    options.addOption(OptionBuilder.create('u'));
   
    CommandLine commands = null;
    try {
      commands = parser.parse(options, args, true);
    } catch( ParseException exp ) {
      Logger.getLogger("azureus2").error("Parsing failed.  Reason: " + exp.getMessage(), exp);
      if (constart)
        System.exit(2);
    }
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

     *         options.
     */
    public CommandLine parseCommands(String[] args)
        throws ParseException
    {
        CommandLineParser parser = new PosixParser();
        return parser.parse(options, args);
    }
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

    options.addOption(helpOption);
    options.addOption(serverURLOption);
    options.addOption(keyOption);

    CommandLineParser argsParser = new PosixParser();

    try {
      CommandLine commandLine = argsParser.parse(options, args);

      if (commandLine.hasOption(helpOption.getOpt())) {
        printUsage(options);
        System.exit(0);
      }
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

  public static void main(String[] args)
    throws Exception
  {
    Options options = createCliOptions();
    CommandLineParser argsParser = new PosixParser();

    try {
      CommandLine commandLine = argsParser.parse(options, args);

      if (commandLine.hasOption(helpOption.getOpt())) {
        printUsage(options);
      }
      else if (commandLine.hasOption(versionOption.getOpt())) {
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

    OptionGroup connectGroup = new OptionGroup();
    connectGroup.addOption(serverURLOption);
    connectGroup.addOption(dirOption);
    options.addOptionGroup(connectGroup);

    CommandLineParser argsParser = new PosixParser();

    try {
      CommandLine commandLine = argsParser.parse(options, args);

      if (commandLine.hasOption(helpOption.getOpt())) {
        printUsage(options);
        System.exit(0);
      }
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

     * @param args    the command line args.
     * @return parsed command line.
     * @throws ParseException if there was a problem.
     */
    private static CommandLine parseCommandLine(Options options, String[] args) throws ParseException {
        CommandLineParser parser = new PosixParser();
        return parser.parse(options, args, true);
    }
View Full Code Here

Examples of org.apache.commons.cli.PosixParser

                } else {
                    // hand crank it so we can add our own compiler configuration
                    try {
                        Options options = FileSystemCompiler.createCompilationOptions();

                        PosixParser cliParser = new PosixParser();

                        CommandLine cli;
                        cli = cliParser.parse(options, commandLine);

                        configuration = FileSystemCompiler.generateCompilerConfigurationFromOptions(cli);
                        configuration.setScriptExtensions(getScriptExtensions());
                        String tmpExtension = getScriptExtension();
                        if (tmpExtension.startsWith("*.")) tmpExtension = tmpExtension.substring(1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.