run method

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

Executes the command using the provided command-line args.

Implementation

@override
Future<void> run(List<String> args) async {
  if (args.isEmpty) {
    LoggerService.error('Usage: $usage');
    return;
  }

  switch (args.first) {
    case 'generate':
      await _generate();
      break;

    case 'configure':
      await _configure();
      break;

    case 'doctor':
      await _doctor();
      break;

    default:
      LoggerService.error('Unknown command "${args.first}".');
      LoggerService.blank();
      LoggerService.info('Supported commands:');
      LoggerService.blank();
      LoggerService.info('generate');
      LoggerService.info('configure');
      LoggerService.info('doctor');
  }
}