UNPKG

@compas/cli

Version:

CLI containing utilities and simple script runner

37 lines (36 loc) 1.43 kB
/** * Init help command and flags. Note that we are after the validators. So be good about * things. * The help command adds all other commands as their sub commands, this way we can auto * complete for sub commands. * Also registers both `-h` and `--help`. The `-h` is officially not allowed, but works * after the validators. * * @param {import("./types.js").CliResolved} cli */ export function cliHelpInit(cli: import("./types.js").CliResolved): void; /** * Make sure other commands are not using flags and command names used by the 'help' * system. * * @param {import("./types.js").CliResolved} command */ export function cliHelpCheckForReservedKeys(command: import("./types.js").CliResolved): void; /** * * @param {Array<string>} commandArgs * @param {Array<string>} flagArgs * @returns {boolean} */ export function cliHelpShouldRun(commandArgs: Array<string>, flagArgs: Array<string>): boolean; /** * Print help message for the specified command * * @param {import("@compas/stdlib").InsightEvent} event * @param {import("./types.js").CliResolved} cli * @param {Array<string>} userInput * @returns {Promise<import("@compas/stdlib").Either<string, { message: string }>>} */ export function cliHelpGetMessage(event: import("@compas/stdlib").InsightEvent, cli: import("./types.js").CliResolved, userInput: Array<string>): Promise<import("@compas/stdlib").Either<string, { message: string; }>>;