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<CommandStatus> run(Iterable<String> args) async {
try {
final _argResults = parse(args);
return await runCommand(_argResults) ?? CommandStatus.success;
} on FormatException catch (e, stackTrace) {
_logger.e(e.message, e, stackTrace);
_logger.i(usage);
return CommandStatus.warning;
} on UsageException catch (e) {
_logger.e(e.message);
_logger.i(usage);
return CommandStatus.warning;
}
}