Type Command.run()'s return value as FutureOr<T> (#87)
Closes #85
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c026ae6..8771808 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.3.0
+
+* Type `Command.run()`'s return value as `FutureOr<T>`.
+
## 1.2.0
* Type the `callback` parameter to `ArgParser.addOption()` as `Function` rather
diff --git a/lib/command_runner.dart b/lib/command_runner.dart
index 13b0a6e..3135dbf 100644
--- a/lib/command_runner.dart
+++ b/lib/command_runner.dart
@@ -352,10 +352,9 @@
/// Runs this command.
///
- /// This must return a `T`, a `Future<T>`, or `null`. The value is returned by
- /// [CommandRunner.runCommand]. Subclasses must explicitly declare a return
- /// type for `run()`, and may not use `void` if `T` is defined.
- run() {
+ /// The return value is wrapped in a `Future` if necessary and returned by
+ /// [CommandRunner.runCommand].
+ FutureOr<T> run() {
throw new UnimplementedError("Leaf command $this must implement run().");
}
diff --git a/pubspec.yaml b/pubspec.yaml
index 42a4718..2c5fa59 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: args
-version: 1.2.0
+version: 1.3.0
author: "Dart Team <misc@dartlang.org>"
homepage: https://github.com/dart-lang/args
description: >