run method

  1. @override
Future run(
  1. Iterable<String> args
)
override

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 run(Iterable<String> args) async {
  final results = parse(args);
  final verbose = results[CliHelper.verboseFlag];

  if (verbose) {
    Logger.root.level = Level.ALL;
    Logger.root.onRecord.listen((record) {
      final level = record.level.name;
      final time = record.time.toString().substring(0, 19);
      print('$level: $time: ${record.message}');
    });
  }

  return super.run(args);
}