Package com.google.appengine.tools.util

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


      }
      helpLines.add("Use 'help <action>' for a detailed description.");
      helpLines.add("");
      helpLines.add("options:");
      for (String optionName : actionsAndOptions.optionNames) {
        Option option = actionsAndOptions.getOption(optionName);
        helpLines.addAll(option.getHelpLines());
      }
      helpText = Joiner.on("\n").join(helpLines);
    }
    System.out.println(helpText);
    System.out.println();
View Full Code Here


        builtInOptionMap.put(option.getLongName(), option);
      }
    }
    List<Option> options = new LinkedList<Option>();
    for (String name : optionNames) {
      Option option = builtInOptionMap.get(name);
      if (option != null) {
        options.add(option);
      }
    }
    return options;
View Full Code Here

      List<String> helpLines = new LinkedList<String>();
      helpLines.addAll(getInitialHelpLines());
      helpLines.add("");
      helpLines.add("Options:");
      for (String optionName : actionsAndOptions.generalOptionNames) {
        Option option = actionsAndOptions.getOption(optionName);
        if (option != null) {
          helpLines.addAll(option.getHelpLines());
        }
      }
      if (extraOptions != null) {
        for (Option option : extraOptions) {
          helpLines.addAll(option.getHelpLines());
        }
      }
      return helpLines;
    }
View Full Code Here

   * Returns the list of built-in {@link Option Options} that apply to both the monolithic dev app
   * server (in the Java SDK) and instances running under the Python devappserver2.
   */
  protected List<Option> getSharedOptions() {
    return Arrays.asList(
        new Option("h", "help", true) {
          @Override
          public void apply() {
            printHelp(System.err);
            System.exit(0);
          }
          @Override
          public List<String> getHelpLines() {
            return ImmutableList.of(
                " --help, -h                 Show this help message and exit.");
          }
        },
        new Option(null, "sdk_root", false) {
          @Override
          public void apply() {
            System.setProperty("appengine.sdk.root", getValue());
          }
          @Override
          public List<String> getHelpLines() {
            return ImmutableList.of(
                " --sdk_root=DIR             Overrides where the SDK is located.");
          }
        },
        new Option(null, "disable_restricted_check", true) {
          @Override
          public void apply() {
            disableRestrictedCheck = true;
          }
        },
        new Option(null, DevAppServerMain.EXTERNAL_RESOURCE_DIR_ARG, false) {
          @Override
          public void apply() {
            externalResourceDir = getValue();
          }
        },
        new Option(null, "property", false) {
          @Override
          public void apply() {
            propertyOptions = getValues();
          }
        },
        new Option(null, "allow_remote_shutdown", true) {
          @Override
          public void apply() {
            System.setProperty("appengine.allowRemoteShutdown", "true");

          }
        },
        new Option(null, "no_java_agent", true) {
          @Override
          public void apply() {
            noJavaAgent = true;
          }
        }
View Full Code Here

    while (true) {
      ++currentArg;
      if (currentArg >= cmdLineArgs.length) {
        break;
      }
      Option option = parseArg(availableOptions, cmdLineArgs, currentArg);
      if (option != null) {
        parsedOptions.add(option);
        if (option.getArgStyle() == Option.Style.Short) {
          ++currentArg;
        }
        continue;
      }
      break;
View Full Code Here

  @VisibleForTesting
  List<Option> getBuiltInOptions() {
    List<Option> options = new ArrayList<>();
    options.addAll(getSharedOptions());
    options.addAll(Arrays.asList(
        new Option("s", "server", false) {
          @Override
          public void apply() {
            versionCheckServer = getValue();
          }
          @Override
          public List<String> getHelpLines() {
            return ImmutableList.of(
                " --server=SERVER            The server to use to determine the latest",
                "  -s SERVER                   SDK version.");
          }
        },
        new Option("a", "address", false) {
          @Override
          public void apply() {
            address = getValue();
          }
          @Override
          public List<String> getHelpLines() {
            return ImmutableList.of(
                " --address=ADDRESS          The address of the interface on the local machine",
                "  -a ADDRESS                  to bind to (or 0.0.0.0 for all interfaces).");
          }
        },
        new Option("p", "port", false) {
          @Override
          public void apply() {
            port = Integer.valueOf(getValue());
          }
          @Override
          public List<String> getHelpLines() {
            return ImmutableList.of(
                " --port=PORT                The port number to bind to on the local machine.",
                "  -p PORT");
          }
        },
        new Option(null, "disable_update_check", true) {
          @Override
          public void apply() {
            disableUpdateCheck = true;
          }
          @Override
          public List<String> getHelpLines() {
            return ImmutableList.of(
                " --disable_update_check     Disable the check for newer SDK versions.");
          }
        },
        new Option(null, "generated_dir", false) {
          @Override
          public void apply() {
            generatedDirectory = getValue();
          }
          @Override
          public List<String> getHelpLines() {
            return ImmutableList.of(
                " --generated_dir=DIR        Set the directory where generated files are created.");
          }
        },
        new Option(null, "default_gcs_bucket", false) {
          @Override
          public void apply() {
            defaultGcsBucketName = getValue();
          }
          @Override
          public List<String> getHelpLines() {
            return ImmutableList.of(
                " --default_gcs_bucket=NAME  Set the default Google Cloud Storage bucket name.");
          }
        },
        new Option(null, "instance_port", false) {
          @Override
          public void apply() {
            processInstancePorts(getValues());
          }
        }
View Full Code Here

TOP

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

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.