Package com.google.devtools.moe.client.directives

Examples of com.google.devtools.moe.client.directives.Directive


    if (args.length < 1) {
      System.err.println("Usage: moe <directive>");
      System.exit(1);
    }

    Directive d = DirectiveFactory.makeDirective(args[0]);
    if (d == null) {
      // DirectiveFactory.makeDirective has failed and reported the error.
      System.exit(1);
    }

    MoeOptions flags = d.getFlags();
    CmdLineParser parser = new CmdLineParser(flags);
    boolean parseError = false;
    try {
      List<String> nextArgs = Lists.newArrayList(args);
      nextArgs.remove(0); // Remove the directive.
      parser.parseArgument(
          processArgs(nextArgs).toArray(new String[] {}));
    } catch (CmdLineException e) {
      logger.log(Level.SEVERE, "Failure", e);
      parseError = true;
    }

    if (flags.shouldDisplayHelp() || parseError) {
      parser.printUsage(System.err);
      System.exit(parseError ? 1 : 0);
    }

    try {
      int result = d.perform();
      Ui.Task terminateTask = AppContext.RUN.ui.pushTask(
          Ui.MOE_TERMINATION_TASK_NAME, "Final clean-up");
      AppContext.RUN.fileSystem.cleanUpTempDirs();
      AppContext.RUN.ui.popTask(terminateTask, "");
      System.exit(result);
View Full Code Here

TOP

Related Classes of com.google.devtools.moe.client.directives.Directive

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.