INNER CODE UNIT · TypeScript

addCommandsGroup

lmstudio-ai/lms · src/index.ts:70

function addCommandsGroup(
  title: string,
  commands: Array<CommandUnknownOpts>,
  colorHex?: string | null,
): void {
  const commandColor = colorHex ?? undefined;
  const groupTitle = chalk.bold(title);
  program.commandsGroup(groupTitle);
  commands.forEach(command => {
    program.addCommand(command);
    // After adding to program, we can compute the full path
    const commandPath = getCommandPath(command);
    commandColorByPath.set(commandPath, commandColor);
  });
}

type CommandWithOptionalParent = CommandUnknownOpts & { parent?: CommandUnknownOpts | null };

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…