run method

  1. @override
void run()
override

Runs this command.

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

Implementation

@override
void run() async {
  final results = argResults!;
  final input = results.rest.map((e) => e.replaceAll('"', '').trim());

  final file = File(input.first);
  if (input.isEmpty) return stdout.writeln('Domains are empty.');
  if (!await file.exists()) return stdout.writeln('File does not exist.');

  final spinner = Spinner('Heating up...');

  if (stdout.hasTerminal) spinner.start();

  checkDomainsWithCLI(await file.readAsLines(), spinner: spinner);
}