PubConstrainCommand constructor

PubConstrainCommand({
  1. required Logger logger,
  2. required PubspecLock pubspecLock,
  3. required PubspecYaml pubspecYaml,
  4. required Bindings bindings,
  5. required FileSystem fs,
  6. required FindFile findFile,
  7. required ConstrainPubspecVersions constrainPubspecVersions,
  8. required ScriptsYaml scriptsYaml,
})

Implementation

PubConstrainCommand({
  required this.logger,
  required this.pubspecLock,
  required this.pubspecYaml,
  required this.bindings,
  required this.fs,
  required this.findFile,
  required this.constrainPubspecVersions,
  required this.scriptsYaml,
}) {
  argParser
    ..addFlag(
      'recursive',
      abbr: 'r',
      negatable: false,
      help: 'Run command recursively in all subdirectories.',
    )
    ..addFlag(
      'dry-run',
      abbr: 'n',
      negatable: false,
      help: "Report what dependencies would change but don't change any.",
    )
    ..addFlag(
      'dev_dependencies',
      abbr: 'd',
      negatable: false,
      help: 'Constrain dev_dependencies as well.',
    )
    ..addOption(
      'bump',
      help: 'Bump the type of version constraint.',
      allowed: [
        for (final type in VersionBump.values) type.name,
      ],
      defaultsTo: VersionBump.breaking.name,
    )
    ..addFlag(
      'pin',
      negatable: false,
      help: 'Pin the version of the package.',
    )
    ..addFlag(
      'dart-only',
      negatable: false,
      help: 'Only run command in Dart projects.',
    )
    ..addFlag(
      'flutter-only',
      negatable: false,
      help: 'Only run command in Flutter projects.',
    );
}