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 {
  final config = await ConfigService.load();

  if (args.isEmpty) {
    const ConfigDisplayService().display(config);
    return;
  }

  final section = ConfigSection.fromName(args.first);

  if (section == null) {
    LoggerService.error('Unknown configuration section "${args.first}".');
    LoggerService.blank();
    LoggerService.info('Available sections:');
    for (final value in ConfigSection.values) {
      LoggerService.info('  • ${value.name}');
    }
    return;
  }

  // ConfigUpdateService will be connected here next.
  await const ConfigUpdateService().update(section: section, config: config);
}