run method

  1. @override
Future<void> run()
override

Runs this command.

The return value is wrapped in a Future if necessary and returned by CommandRunner.runCommand.

Implementation

@override
Future<void> run() {
  final results = argResults!;
  var [String name] = results.rest;
  return userMethod(
    name,
    source: (results['source'] as String?) ?? null,
    type: (results['type'] as String?) ?? null,
    prefix: (results['prefix'] as String?) ?? null,
    maxSize:
        results['max-size'] != null ? int.parse(results['max-size']) : null,
    removeComments: (results['remove-comments'] as bool?) ?? true,
    format: (results['format'] as String?) ?? 'text',
  );
}