DpkCommandRunner constructor

DpkCommandRunner(
  1. DpkContext context
)

Implementation

DpkCommandRunner(this.context)
  : super(
      'dpk',
      'A package manager for Dart that adds scripts, hooks, workspace '
          'catalogs, and dependency patches to dart pub.',
    ) {
  argParser
    ..addOption(
      'directory',
      abbr: 'C',
      valueHelp: 'dir',
      help: 'Run as if dpk was started in <dir>.',
    )
    ..addOption(
      'cache-dir',
      valueHelp: 'dir',
      help:
          'Use <dir> as the project cache in project mode. Default: '
          'pub_packages, or cache_dir in dpk.yaml.',
    )
    ..addFlag(
      'verbose',
      abbr: 'v',
      negatable: false,
      help: 'Print what dpk runs, and pass --verbose to pub.',
    )
    ..addFlag(
      'quiet',
      abbr: 'q',
      negatable: false,
      help: 'Do not print the scripts and hooks dpk runs.',
    )
    ..addFlag(
      'color',
      help: 'Use colors. Default: on in a terminal unless NO_COLOR is set.',
    )
    ..addFlag(
      'version',
      negatable: false,
      help: 'Print the dpk and Dart versions.',
    );

  addCommand(GetCommand(context));
  addCommand(RunCommand(context));
  addCommand(ExecCommand(context));
  addCommand(ListCommand(context));
  addCommand(CleanCommand(context));
  addCommand(CatalogCommand(context));
  addCommand(PatchCommand(context));
  addCommand(ReleaseCommand(context));
  addCommand(InitCommand(context));
  addCommand(DoctorCommand(context));
  addCommand(SkillsCommand(context));
  for (final definition in pubPassthroughCommandDefinitions) {
    addCommand(PubPassthroughCommand(context, definition));
  }
}