Package com.google.appengine.tools.util

Examples of com.google.appengine.tools.util.Action


      List<String> helpLines = new LinkedList<String>();
      helpLines.add("usage: AppCfg [options] <action> [<app-dir>] [<argument>]");
      helpLines.add("");
      helpLines.add("Action must be one of:");
      for (String actionName : actionsAndOptions.actionNames) {
        Action action = actionsAndOptions.getAction(actionName);
        if (action != null) {
          helpLines.add("  " + actionName + ": " + action.getShortDescription());
        }
      }
      helpLines.add("Use 'help <action>' for a detailed description.");
      helpLines.add("");
      helpLines.add("options:");
View Full Code Here


    @Override
    public void apply() {
      if (getArgs().isEmpty()) {
        printHelp();
      } else {
        Action foundAction = Parser.lookupAction(actionsAndOptions.actions,
                                                 getArgs().toArray(new String[0]), 0);
        if (foundAction == null) {
          System.out.println("No such command \"" + getArgs().get(0) + "\"\n\n");
          printHelp();
        } else {
          System.out.println(foundAction.getHelpString());
          System.out.println();
        }
      }
      System.exit(1);
    }
View Full Code Here

    String actionString = cmdLineArgs[currentArg];
    if (actionString.startsWith("-") || actionString.startsWith("--")) {
      throw new IllegalArgumentException("Unknown option: " + actionString);
    }

    Action foundAction = lookupAction(actions, cmdLineArgs, currentArg);
    if (foundAction == null) {
      throw new IllegalArgumentException("Expected an action: " + buildActionString(actions));
    }
    currentArg += foundAction.getNames().length;

    List<String> actionArgs = Arrays.asList(cmdLineArgs).subList(currentArg, cmdLineArgs.length);
    foundAction.setArgs(actionArgs);
    return new ParseResult(parsedOptions, foundAction);
  }
View Full Code Here

  private static String buildActionString(List<Action> actions) {
    StringBuffer msg = new StringBuffer("[");

    for (int i = 0; i < actions.size(); ++i) {
      Action action = actions.get(i);
      msg.append(action.getNameString());
      if (i != actions.size() - 1) {
        msg.append(", ");
      } else {
        msg.append("]");
      }
View Full Code Here

TOP

Related Classes of com.google.appengine.tools.util.Action

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.