run method

Future<void> run()
override

Implementation

Future<void> run() async {
  String classCode = cli.commandToClassCode(command);
  if (cli.allCommands.containsKey(classCode)) {
    var commandObj = cli.allCommands[classCode]!;
    var parser = cli.getCommandArgParser(commandObj);
    var annotations = cli.availableCommands.allSubtypes[classCode]!.annotations;
    String help = annotations.containsKey('HelpText') ? annotations['HelpText'] : '';
    print(command + ' [options] ' + commandObj.params.map((e) => '[$e]').join(' ') + '\t' + help);
    print('detailed options:');
    print(parser.usage);
  } else {
    print('unknown command $command');
  }
}