DiffCommand constructor

DiffCommand()

Implementation

DiffCommand() {
  argParser.addOption(
    _optionNameOld,
    mandatory: true,
    help: 'Old package reference. $packageRefExplanation',
  );
  argParser.addOption(
    _optionNameNew,
    mandatory: true,
    help: 'New package reference. $packageRefExplanation',
  );
  argParser.addFlag(
    _optionNameIncludePathDependencies,
    abbr: 'p',
    help: includePathDependenciesExplanation,
  );
  argParser.addOption(
    _optionNameVersionCheckMode,
    help: '''
Defines the mode the versions of the packages shall be compared.
This affects the exit code of this program.
''',
    allowed: VersionCheckMode.values.map((e) => e.name).toList(),
    defaultsTo: VersionCheckMode.fully.name,
  );
  argParser.addFlag(
    _optionNameCheckSdkVersion,
    help: 'Determines if the SDK version should be checked.',
    defaultsTo: true,
    negatable: true,
  );
  argParser.addFlag(
    _optionNameIgnorePrerelease,
    help: '''
Determines if the pre-release aspect of the new version
shall be ignored when checking versions.
You may want to do this if you want to make sure
(in your CI) that the version - once ready - matches semver.
''',
    defaultsTo: true,
    negatable: true,
  );
  argParser.addFlag(
    _optionNameNoAnalyzePlatformConstraints,
    help: 'Disables analysis of platform constraints.',
    defaultsTo: false,
    negatable: false,
  );
  argParser.addOption(
    _optionNameDependencyCheckMode,
    help: 'DEPRECATED - this option as no effect any more',
    // ignore: deprecated_member_use_from_same_package
    allowed: DependencyCheckMode.values.map((e) => e.name).toList(),
    // ignore: deprecated_member_use_from_same_package
    defaultsTo: DependencyCheckMode.allowAdding.name,
  );
  argParser.addFlag(
    _optionNameRemoveExample,
    help: 'Removes examples from the package to analyze.',
    defaultsTo: true,
    negatable: true,
  );
  argParser.addFlag(
    _optionNameIgnoreRequiredness,
    help:
        'Whether to ignore the required aspect of interfaces (yielding less strict version bump requirements)',
    defaultsTo: false,
    negatable: true,
  );
  argParser.addOption(
    _optionReportFormat,
    help: 'Which output format should be used',
    defaultsTo: ReportFormat.cli.name,
    allowed: ReportFormat.values.map((e) => e.name),
    mandatory: false,
  );
  argParser.addOption(
    _optionReportPath,
    help: 'Where to store the report file (no effect on cli option)',
    mandatory: false,
  );
}