run method
Runs this command.
The return value is wrapped in a Future if necessary and returned by
CommandRunner.runCommand.
Implementation
@override
@nonVirtual
Future<int> run() async {
print.setRootLoggerLevel(isVerbose: isVerbose);
try {
return _jsonResultIfNeeded(await doRun());
} on RunException catch (e) {
return _jsonResultIfNeeded(errorBy(e));
} catch (e, st) {
printVerbose('Exception: $e\nStackTrace: $st');
return _jsonResultIfNeeded(error(2, message: 'Failed by: $e'));
}
}