Use Null as return type for HelpCommand.run (#164)
This may make it easier to understand choices around nullability by
making it explicit that the help command can never return a useful value
from it's `run` method.
Remove the unnecessary return value and return statement since a `Null`
return type may be treated similarly to `void`.
diff --git a/lib/src/help_command.dart b/lib/src/help_command.dart
index c3c2bbf..d598cfd 100644
--- a/lib/src/help_command.dart
+++ b/lib/src/help_command.dart
@@ -22,11 +22,11 @@
bool get hidden => true;
@override
- T? run() {
+ Null run() {
// Show the default help if no command was specified.
if (argResults!.rest.isEmpty) {
runner!.printUsage();
- return null;
+ return;
}
// Walk the command tree to show help for the selected command or
@@ -56,6 +56,5 @@
}
command!.printUsage();
- return null;
}
}