PubUpgradeCommand constructor

PubUpgradeCommand({
  1. required PubspecLock pubspecLock,
  2. required PubspecYaml pubspecYaml,
  3. required Bindings bindings,
  4. required FindFile findFile,
  5. required FileSystem fs,
  6. required Logger logger,
  7. required ScriptsYaml scriptsYaml,
  8. required RunManyScripts runManyScripts,
  9. required RunOneScript runOneScript,
})

Implementation

PubUpgradeCommand({
  required super.pubspecLock,
  required super.pubspecYaml,
  required super.bindings,
  required super.findFile,
  required super.fs,
  required super.logger,
  required super.scriptsYaml,
  required super.runManyScripts,
  required super.runOneScript,
}) {
  argParser.addFlag(
    'offline',
    help: 'Use cached packages instead of accessing the network.',
  );

  argParser.addFlag(
    'dry-run',
    abbr: 'n',
    negatable: false,
    help: "Report what dependencies would change but don't change any.",
  );

  argParser.addFlag(
    'precompile',
    help: 'Precompile executables in immediate dependencies.',
  );

  argParser.addFlag(
    'tighten',
    help:
        'Updates lower bounds in pubspec.yaml to match the resolved version.',
    negatable: false,
  );

  argParser.addFlag(
    'unlock-transitive',
    help: 'Also upgrades the transitive dependencies '
        'of the listed [dependencies]',
    negatable: false,
  );

  argParser.addFlag(
    'major-versions',
    help: 'Upgrades packages to their latest resolvable versions, '
        'and updates pubspec.yaml.',
    aliases: ['major', 'majors'],
    negatable: false,
  );
}