import { type CommandSpec, UsageStyle } from '../spec/types.ts'; export declare const ARGPARSE_EXIT = 2; /** * git's refusal for an option it does not know. * * Two nouns and no program name, pinned against git 2.50.1: a long option is an * "option" and a short one is a "switch", both named without their dashes and * quoted with a backquote-apostrophe pair. git follows this with the verb's * usage block, which is omitted the same way GNU's is elsewhere in the spec * machinery. * * @param token the offending token ('--nosuch') or cluster character ('Z'), as * the flat parser reports it */ export declare function gitUnknownOption(token: string): Uint8Array; /** * The options a clap usage line echoes back, in clap's order. * * clap reprints the options the line carried, in the order they were typed, * then the ones an environment variable supplied. A *defaulted* option is not * among them: pinned against ntn 0.21.9, whose --limit declares `[default: 25]` * and never appears unless it was typed. * * @param spec the leaf's grammar, for spellings and value names * @param typed dests the line carried, in scan order (canonical dashed * spellings, the key space the parser records flags under) * @param env the session environment, read for the options that declare one */ export declare function clapSupplied(spec: CommandSpec, typed: readonly string[], env: Readonly>): string[]; /** * clap's refusal for required operands the line did not supply. * * Pinned against ntn 0.21.9: the empty slots are listed one per line under a * fixed heading, then a usage line that carries the options the line supplied * and every operand slot, then the "try --help" footer. The usage line names * only what was supplied, which is why it is rebuilt here rather than taken * from the help page. * * @param prog the full display path of the leaf ("ntn pages get") * @param spec the leaf's grammar * @param missing bare names of the empty required slots * @param typed dests the line carried, in scan order * @param env the session environment */ export declare function clapMissingOperands(prog: string, spec: CommandSpec, missing: readonly string[], typed: readonly string[], env: Readonly>): Uint8Array; /** * The message and exit code a leaf answers a bad option with. * * A leaf usage error exits 2 under argparse's style regardless of the GNU * USAGE_EXIT table, because an installed CLI name is never a GNU tool with its * own pinned exit. git exits 129 for the same mistake, which is neither that * nor its own 128 for a fatal. clap exits 2, agreeing with argparse by * coincidence rather than by lineage. * * @param style the dialect the CLI's root declares * @param argparseMessage the message the spec machinery built, used as-is for * argparse and for anything git words the same * @param invalidOptions the offending tokens the parser reported, read when the * style rewrites the message */ export declare function leafRefusal(style: UsageStyle, argparseMessage: Uint8Array, invalidOptions: readonly string[]): [Uint8Array, number]; //# sourceMappingURL=refusal.d.ts.map