CLIServer()

Source

CLIServer() {
  options
    ..addOption("sink",
        abbr: "s",
        help:
            "The name of the RequestSink subclass to be instantiated to serve requests. "
            "By default, this subclass is determined by reflecting on the application library in the [directory] being served.")
    ..addOption("port",
        abbr: "p",
        help: "The port number to listen for HTTP requests on.",
        defaultsTo: "8081")
    ..addOption("address",
        abbr: "a",
        help:
            "The address to listen on. See HttpServer.bind for more details; this value is used as the String passed to InternetAddress.lookup."
            " Using the default will listen on any address.")
    ..addOption("config-path",
        abbr: "c",
        help:
            "The path to a configuration file. This File is available in the ApplicationConfiguration "
            "for a RequestSink to use to read application-specific configuration values. Relative paths are relative to [directory].",
        defaultsTo: "config.yaml")
    ..addOption("timeout",
        help: "Number of seconds to wait to ensure startup succeeded.",
        defaultsTo: "20")
    ..addOption("isolates",
        abbr: "n",
        help: "Number of isolates processing requests",
        defaultsTo: "3")
    ..addOption("ssl-key-path",
        help: "The path to an SSL private key file. If provided along with --ssl-certificate-path, the application will be HTTPS-enabled.")
    ..addOption("ssl-certificate-path",
        help: "The path to an SSL certicate file. If provided along with --ssl-certificate-path, the application will be HTTPS-enabled.")
    ..addFlag("local",
        abbr: "l",
        help:
            "Overrides [address] to only accept connectiosn from local addresses.",
        negatable: false,
        defaultsTo: false)
    ..addFlag("ipv6-only",
        help: "Limits listening to IPv6 connections only.",
        negatable: false,
        defaultsTo: false)
    ..addFlag("observe",
        help: "Enables Dart Observatory", defaultsTo: false, negatable: false)
    ..addFlag("monitor",
        help:
            "Monitors the application during startup to report errors. Turn this off if startup monitoring is done by another or service or if writing to the filesystem isn't available on the deployment platform.",
        defaultsTo: true)
    ..addFlag("detached",
        help:
            "Runs the application detached from this script. This script will terminate and the application will continue executing",
        defaultsTo: false,
        negatable: false);

  registerCommand(new CLIServeStop());
}