defaultArgParser function

ArgParser defaultArgParser ()

Returns the default parser which is used to parse raw arguments given by users.

By utilizing the builder pattern, you can extends the default CLI options conveniently.

This needs some understanding of package: args.

Implementation

ArgParser defaultArgParser() => new ArgParser()
  ..addFlag(
    CliOption.lowResourcesMode,
    abbr: 'l',
    defaultsTo: false,
    negatable: false,
    help:
        'Reduces the amount of memory consumed by the build process.\nThis will slow down builds but allow them to progress in resource constrained environments.',
  )
  ..addOption(
    CliOption.config,
    abbr: 'c',
    help: 'Reads `build.<name>.yaml` instead of the default `build.yaml`.',
  )
  ..addOption(
    CliOption.define,
    help: 'Sets the global `options` config for a builder by key.',
  )
  ..addFlag(
    CliOption.singlePageApplication,
    defaultsTo: true,
    help: 'Serves a single page application.',
  )
  ..addOption(
    CliOption.hostName,
    defaultsTo: 'localhost',
    help: 'Specifies the hostname to serve on.',
  )
  ..addOption(
    CliOption.buildRunnerPort,
    abbr: 'b',
    defaultsTo: defaultPorts[CliOption.buildRunnerPort],
    help: 'Changes the port number where `build_runner` serves.',
  )
  ..addOption(
    CliOption.proxyPort,
    abbr: 'p',
    defaultsTo: defaultPorts[CliOption.proxyPort],
    help: 'Changes the port number of the proxy server.',
  )
  ..addOption(
    CliOption.webSocketPort,
    abbr: 'w',
    defaultsTo: defaultPorts[CliOption.webSocketPort],
    help: 'Changes the port number of the websocket.',
  )
  ..addFlag(
    CliOption.help,
    abbr: 'h',
    defaultsTo: false,
    negatable: false,
    help: 'Displays help information for livereload.',
  );