Package org.kohsuke.args4j

Examples of org.kohsuke.args4j.CmdLineParser


    {
     
      // * Parse and check the command line input
      Run run = new Run();
     
      CmdLineParser parser = new CmdLineParser(run);
      try
    {
      parser.parseArgument(args);
    } catch (CmdLineException e)
    {
      usageExit(e.getMessage(), parser);
    }
     
View Full Code Here


    }

    flags.flag_file = "";
    List<String> processedFileArgs
        = processArgs(argsInFile.toArray(new String[] {}));
    CmdLineParser parserFileArgs = new CmdLineParser(flags);
    Flags.warningGuardSpec.clear();
    parserFileArgs.parseArgument(processedFileArgs.toArray(new String[] {}));

    // Currently we are not supporting this (prevent direct/indirect loops)
    if (!flags.flag_file.equals("")) {
      err.println("ERROR - Arguments in the file cannot contain "
          + "--flagfile option.");
View Full Code Here

  private void initConfigFromFlags(String[] args, PrintStream err) {

    List<String> processedArgs = processArgs(args);

    CmdLineParser parser = new CmdLineParser(flags);
    Flags.warningGuardSpec.clear();
    isConfigValid = true;
    try {
      parser.parseArgument(processedArgs.toArray(new String[] {}));
      // For contains --flagfile flag
      if (!flags.flag_file.equals("")) {
        processFlagFile(err);
      }
    } catch (CmdLineException e) {
      err.println(e.getMessage());
      isConfigValid = false;
    } catch (IOException ioErr) {
      err.println("ERROR - " + flags.flag_file + " read error.");
      isConfigValid = false;
    }

    if (flags.version) {
      ResourceBundle config = ResourceBundle.getBundle(configResource);
      err.println(
          "Closure Compiler (http://code.google.com/closure/compiler)\n" +
          "Version: " + config.getString("compiler.version") + "\n" +
          "Built on: " + config.getString("compiler.date"));
      err.flush();
    }

    if (!isConfigValid || flags.display_help) {
      isConfigValid = false;
      parser.printUsage(err);
    } else {
      getCommandLineConfig()
          .setPrintTree(flags.print_tree)
          .setPrintAst(flags.print_ast)
          .setPrintPassGraph(flags.print_pass_graph)
View Full Code Here

      }
    }

    Params.baseFolder = folder;
    Params params = new Params();
    CmdLineParser parser = new CmdLineParser(params);
    try {
      parser.parseArgument(filtered);
      if (params.help) {
        server.usage(parser, null);
      }
    } catch (CmdLineException t) {
      server.usage(parser, t);
View Full Code Here

      }
    }

    Params.baseFolder = folder;
    Params params = new Params();
    CmdLineParser parser = new CmdLineParser(params);
    try {
      parser.parseArgument(filtered);
      if (params.help) {
        server.usage(parser, null);
      }
    } catch (CmdLineException t) {
      server.usage(parser, t);
View Full Code Here

*/
public class FederationClient {

  public static void main(String[] args) {
    Params params = new Params();
    CmdLineParser parser = new CmdLineParser(params);
    try {
      parser.parseArgument(args);
    } catch (CmdLineException t) {
      usage(parser, t);
    }

    System.out.println("Gitblit Federation Client v" + Constants.getVersion() + " (" + Constants.getBuildDate() + ")");
View Full Code Here

      }
    }

    Params.baseFolder = folder;
    Params params = new Params();
    CmdLineParser parser = new CmdLineParser(params);
    try {
      parser.parseArgument(filtered);
      if (params.help) {
        migrate.usage(parser, null);
        return;
      }
    } catch (CmdLineException t) {
View Full Code Here

      }
    }

    Params.baseFolder = folder;
    Params params = new Params();
    CmdLineParser parser = new CmdLineParser(params);
    try {
      parser.parseArgument(filtered);
      if (params.help) {
        reindex.usage(parser, null);
        return;
      }
    } catch (CmdLineException t) {
View Full Code Here

*/
public class AddIndexedBranch {

  public static void main(String... args) {
    Params params = new Params();
    CmdLineParser parser = new CmdLineParser(params);
    try {
      parser.parseArgument(args);
    } catch (CmdLineException t) {
      System.err.println(t.getMessage());
      parser.printUsage(System.out);
      return;
    }

    // create a lowercase set of excluded repositories
    Set<String> exclusions = new TreeSet<String>();
View Full Code Here

        // Setup logger
        System.setProperty("org.restlet.engine.loggerFacadeClass",
                "org.restlet.ext.slf4j.Slf4jLoggerFacade");
       
        CmdLineSettings settings = new CmdLineSettings();
        CmdLineParser parser = new CmdLineParser(settings);
        try {
            parser.parseArgument(args);
        } catch (CmdLineException e) {
            parser.printUsage(System.out);
            System.exit(1);
        }
       
        // Load modules
        FloodlightModuleLoader fml = new FloodlightModuleLoader();
View Full Code Here

TOP

Related Classes of org.kohsuke.args4j.CmdLineParser

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.