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() {
  if (argResults != null) {
    if (argResults!['format'] != null) {
      print(
          '${ColorsText.cyan}═══════════════════════════════════════════════════════════${ColorsText.reset}');
      print('${ColorsText.cyan}          Formatting Code${ColorsText.reset}');
      print(
          '${ColorsText.cyan}═══════════════════════════════════════════════════════════${ColorsText.reset}\n');
      formatCode();
    }

    if (argResults!.arguments.isEmpty) {
      print(
          '${ColorsText.yellow}No valid options provided.${ColorsText.reset}');
      print(
          '${ColorsText.yellow}Use --help for usage information.${ColorsText.reset}');
    }
  } else {
    print('${ColorsText.yellow}No arguments found.${ColorsText.reset}');
    print(
        '${ColorsText.yellow}Use --help for usage information.${ColorsText.reset}');
  }
}