PubConstrainCommand constructor
PubConstrainCommand({
- required Logger logger,
- required PubspecLock pubspecLock,
- required PubspecYaml pubspecYaml,
- required Bindings bindings,
- required FileSystem fs,
- required FindFile findFile,
- required ConstrainPubspecVersions constrainPubspecVersions,
- 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.',
);
}