import { BETA_TAGLINE, IS_BETA } from '../src/beta' import { getCliVersion } from '../src/cli-version' import { rnxPublicBrand } from '../src/public-brand' import { renderRnxHelp } from './help-core' import { maybeHint } from './hints' import { getRuntimeSummary } from './runtime-summary' function versionSummaryLine(): string { return `${rnxPublicBrand.commandName} CLI v${getCliVersion()} ยท ${getRuntimeSummary().primary}` } export function printHelp(): void { const betaLine = IS_BETA ? `\n${BETA_TAGLINE}\n` : '' console.log( `${versionSummaryLine()}\n${betaLine}${renderRnxHelp({ backend: 'node' })}\n`, ) maybeHint('clean-uninstall') } export function printGroupHelp(group: string): boolean { const output = renderRnxHelp({ backend: 'node', command: group, group, }) if (output.startsWith('unknown command:')) return false console.log(`${output}\n`) return true } export function printCommandHelp( name: string, options: { prefer?: 'command' | 'verb'; group?: string | null } = {}, ): void { const command = options.group ?? name const output = renderRnxHelp({ backend: 'node', command, commandArgs: options.group ? [name] : [], prefer: options.prefer, group: options.group, }) console.log(`${output}\n`) }