run method
Parses args
and invokes Command.run
on the chosen command.
This always returns a Future in case the command is asynchronous. The
Future will throw a UsageException
if args
was invalid.
Implementation
@override
Future<T?> run(Iterable<String> args) async {
try {
return await super.run(args);
} on Exception catch (e) {
print('$e\n');
print('Usage:\n${argParser.usage}');
exit(1);
}
}