diff --git a/packages/shorebird_cli/lib/src/commands/patch/patch_command.dart b/packages/shorebird_cli/lib/src/commands/patch/patch_command.dart index c127f586..1218e9e0 100644 --- a/packages/shorebird_cli/lib/src/commands/patch/patch_command.dart +++ b/packages/shorebird_cli/lib/src/commands/patch/patch_command.dart @@ -28,7 +28,7 @@ class PatchCommand extends ShorebirdCommand { _resolvePatcher = resolvePatcher ?? getPatcher; argParser ..addMultiOption( - 'platform', + 'platforms', abbr: 'p', help: 'The platform(s) to to build this release for.', allowed: ReleaseType.values.map((e) => e.cliName).toList(), diff --git a/packages/shorebird_cli/lib/src/commands/release/release_command.dart b/packages/shorebird_cli/lib/src/commands/release/release_command.dart index 1d9b0270..16d385fb 100644 --- a/packages/shorebird_cli/lib/src/commands/release/release_command.dart +++ b/packages/shorebird_cli/lib/src/commands/release/release_command.dart @@ -79,7 +79,7 @@ On Xcode builds it is used as "CFBundleVersion".''', }, ) ..addMultiOption( - 'platform', + 'platforms', abbr: 'p', help: 'The platform(s) to to build this release for.', allowed: ReleaseType.values.map((e) => e.cliName).toList(), diff --git a/packages/shorebird_cli/lib/src/release_type.dart b/packages/shorebird_cli/lib/src/release_type.dart index c705ad80..b25d0330 100644 --- a/packages/shorebird_cli/lib/src/release_type.dart +++ b/packages/shorebird_cli/lib/src/release_type.dart @@ -48,8 +48,8 @@ enum ReleaseType { extension ReleaseTypeArgs on ArgResults { Iterable get releaseTypes { final List releaseTypeCliNames; - if (wasParsed('platform')) { - releaseTypeCliNames = this['platform'] as List; + if (wasParsed('platforms')) { + releaseTypeCliNames = this['platforms'] as List; } else { final platformCliName = arguments.first; if (ReleaseType.values diff --git a/packages/shorebird_cli/test/src/commands/patch/patch_command_test.dart b/packages/shorebird_cli/test/src/commands/patch/patch_command_test.dart index 076910d3..be9da2e2 100644 --- a/packages/shorebird_cli/test/src/commands/patch/patch_command_test.dart +++ b/packages/shorebird_cli/test/src/commands/patch/patch_command_test.dart @@ -27,7 +27,7 @@ import '../../matchers.dart'; import '../../mocks.dart'; void main() { - group('PatchNewCommand', () { + group(PatchCommand, () { const appId = 'test-app-id'; const appDisplayName = 'Test App'; const arch = 'aarch64'; @@ -132,7 +132,7 @@ void main() { shorebirdFlutter = MockShorebirdFlutter(); when(() => argResults['dry-run']).thenReturn(false); - when(() => argResults['platform']).thenReturn(['android']); + when(() => argResults['platforms']).thenReturn(['android']); when(() => argResults['release-version']).thenReturn(releaseVersion); when(() => argResults.wasParsed(any())).thenReturn(true); diff --git a/packages/shorebird_cli/test/src/commands/release/release_command_test.dart b/packages/shorebird_cli/test/src/commands/release/release_command_test.dart index 208830fa..8cd61e15 100644 --- a/packages/shorebird_cli/test/src/commands/release/release_command_test.dart +++ b/packages/shorebird_cli/test/src/commands/release/release_command_test.dart @@ -91,7 +91,7 @@ void main() { shorebirdFlutter = MockShorebirdFlutter(); when(() => argResults['dry-run']).thenReturn(false); - when(() => argResults['platform']).thenReturn(['android']); + when(() => argResults['platforms']).thenReturn(['android']); when(() => argResults.wasParsed(any())).thenReturn(true); when(cache.updateAll).thenAnswer((_) async => {}); diff --git a/packages/shorebird_cli/test/src/release_type_test.dart b/packages/shorebird_cli/test/src/release_type_test.dart index a462b679..a90d2750 100644 --- a/packages/shorebird_cli/test/src/release_type_test.dart +++ b/packages/shorebird_cli/test/src/release_type_test.dart @@ -24,32 +24,35 @@ void main() { setUp(() { parser = ArgParser() ..addMultiOption( - 'platform', + 'platforms', allowed: ReleaseType.values.map((e) => e.cliName), ); }); - group('when the platform argument is provided', () { + group('when the platforms argument is provided', () { test('parses the release types', () { expect( - parser.parse(['--platform', 'android']).releaseTypes.toList(), + parser.parse(['--platforms', 'android']).releaseTypes.toList(), [ReleaseType.android], ); expect( - parser.parse(['--platform', 'ios']).releaseTypes.toList(), + parser.parse(['--platforms', 'ios']).releaseTypes.toList(), [ReleaseType.ios], ); expect( - parser.parse(['--platform', 'ios-framework']).releaseTypes.toList(), + parser + .parse(['--platforms', 'ios-framework']) + .releaseTypes + .toList(), [ReleaseType.iosFramework], ); expect( - parser.parse(['--platform', 'aar']).releaseTypes.toList(), + parser.parse(['--platforms', 'aar']).releaseTypes.toList(), [ReleaseType.aar], ); }); - group('when the platform is provided as a raw arg', () { + group('when the platforms is provided as a raw arg', () { test('throws an ArgumentError if the platform is invalid', () { expect( () => parser.parse(['foo']).releaseTypes.toList(),