run method
Main entry point for running a command.
Implementation
@override
Future<void> run(Iterable<String> args) async {
try {
final argsWithDefaultCommand = _addDefaultCommand(args);
final results = parse(argsWithDefaultCommand);
final showVersion = results[FlagNames.version] as bool;
if (showVersion) {
_logger.info('DCL version: $packageVersion');
return;
}
await super.run(argsWithDefaultCommand);
} on UsageException catch (e) {
_logger
..info(e.message)
..info(e.usage);
exit(64);
} on Exception catch (e) {
_logger.error('Oops; metrics has exited unexpectedly: "$e"');
exit(1);
}
await _checkForUpdates();
exit(0);
}