handle method

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

Called automatically before executing the command. You can override to do pre-validation or setup.

Implementation

@override
Future<void> handle(List<String> args) async {
  final rows = [..._commands]..sort((a, b) => a.name.compareTo(b.name));

  logger.info('Available commands:');
  for (final row in rows) {
    final padded = row.name.padRight(18);
    logger.info('  $padded ${row.description}');
  }

  exitCode = 0;
}