buildArgParser static method

ArgParser buildArgParser({
  1. void addExtraArgs(
    1. ArgParser
    )?,
})

Builds an arg parser for DevTools integration tests.

Implementation

static ArgParser buildArgParser({
  void Function(ArgParser)? addExtraArgs,
}) {
  final argParser = ArgParser()
    ..addFlag(
      _helpArg,
      abbr: 'h',
      help: 'Prints help output.',
    )
    ..addOption(
      testTargetArg,
      abbr: 't',
      help:
          'The integration test target (e.g. path/to/test.dart). If left empty,'
          ' all integration tests will be run.',
    )
    ..addFlag(
      _headlessArg,
      negatable: false,
      help:
          'Runs the integration test on the \'web-server\' device instead of '
          'the \'chrome\' device. For headless test runs, you will not be '
          'able to see the integration test run visually in a Chrome browser.',
    )
    ..addOption(
      _shardArg,
      valueHelp: '1/3',
      help: 'The shard number for this run out of the total number of shards '
          '(e.g. 1/3)',
    );
  addExtraArgs?.call(argParser);
  return argParser;
}