runCommands method
Processes command-line arguments and enters interactive command mode. Handles the execution of server commands such as:
help- Display available commandsmigrate- Database migration operationslanguage- Language management commandsinfo- Server information displayroute- Route inspectionexit- Graceful server shutdown If no arguments are provided, the method returns immediately. Otherwise, it starts an interactive command prompt (Finch>) where users can continue entering commands.args- List of command-line arguments to process
Implementation
Future<void> runCommands(List<String> args, [bool direct = false]) async {
if (args.isEmpty) {
return;
}
if (direct) {
await _getCommandManager(args).process(newArgs: args);
return;
}
return _getCommandManager(args).processWhile(
initArgs: args,
appLabel: () => 'Finch> ',
);
}