@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
40 lines • 2.38 kB
TypeScript
import { type Argument, type CommandSpec, UsageStyle } from './types.ts';
/**
* The bare name of an option's value, declared or derived.
*
* clap derives one from the long spelling when the author declares no
* `value_name`: dashes to underscores, uppercased. Deriving it the same way
* means only the options that actually override it have to say so.
*/
export declare function optionMetavar(opt: Argument): string;
/**
* One operand's slot in a clap usage line. Required slots take angle brackets
* and optional ones square, which is the only thing clap's usage line says
* about arity besides the trailing ellipsis on a variadic.
*/
export declare function operandSlot(operand: Argument, ellipsis?: boolean): string;
/** Display rows [flag spelling, description] for a spec's options. */
export declare function flagRows(spec: CommandSpec): [string, string][];
/**
* Display rows [operand name, description] for the operands a spec explains,
* the ones with help of their own.
*/
export declare function operandRows(spec: CommandSpec): [string, string][];
/**
* Render one command's help; a CLI group is the same shape plus a Commands
* section. `subcommands` carries (name, one-line help) rows for a CLI
* group node; when given, the usage line reads `<command> [<args>]`
* instead of the operand slots.
*/
export declare function usageLine(name: string, spec: CommandSpec, subcommands: readonly [string, string][], style: UsageStyle, synopsis?: string): string;
export declare function renderHelp(name: string, spec: CommandSpec, subcommands?: readonly [string, string][], style?: UsageStyle, synopsis?: string): string;
export declare function clapUnexpectedArgument(token: string): string;
export declare function clapGroupRefusal(name: string, spec: CommandSpec, subcommands: readonly [string, string][], message: string): string;
/**
* The usage line and the operand and option rows of a CLI's argparse-shaped
* help, before they are laid out.
*/
export declare function argparseParts(name: string, spec: CommandSpec, subcommands?: readonly [string, string][]): [string, [string, string][], [string, string][]];
/** Render the declared CLI grammar without serializing internal spec objects. */
export declare function argparseHelp(name: string, spec: CommandSpec, subcommands?: readonly [string, string][]): string;
//# sourceMappingURL=help.d.ts.map