diff --git a/lib/src/cli/command/log_sub_command.dart b/lib/src/cli/command/log_sub_command.dart index ab53175..6645bf6 100644 --- a/lib/src/cli/command/log_sub_command.dart +++ b/lib/src/cli/command/log_sub_command.dart @@ -21,7 +21,7 @@ class LogSubCommand extends CiderCommand { @override Future exec(Project project) async { - await project.addUnreleased(type.name, argResults!.rest[0]); + await project.addUnreleased(type.name, argResults!.rest.first); return 0; } diff --git a/test/functional_test.dart b/test/functional_test.dart index e35fc82..7174222 100644 --- a/test/functional_test.dart +++ b/test/functional_test.dart @@ -237,7 +237,7 @@ I love my dog. test('incorrect usage', () async { final code = await run(['bump']); expect(code, 64); - expect(err.buffer.toString().trim().split('\n')[0], + expect(err.buffer.toString().trim().split('\n').first, 'Usage: cider bump [arguments]'); }); test('help usage', () async { @@ -253,7 +253,7 @@ I love my dog. test('incorrect usage', () async { final code = await run(['log']); expect(code, 64); - expect(err.buffer.toString().trim().split('\n')[0], + expect(err.buffer.toString().trim().split('\n').first, 'Usage: cider log [arguments]'); }); test('help usage', () async {