UNPKG

@liplum/cli

Version:

A helpful wrapper around command-line-args and command-line-usage

28 lines (27 loc) 1.17 kB
import commandLineUsage from 'command-line-usage'; import { Command, MultiCommand } from './cmd.js'; /** Options available to all CLIs created with this tool */ export declare const globalOptions: commandLineUsage.OptionDefinition[]; declare const errorReportingStyles: readonly ["exit", "throw", "object"]; type ErrorReportingStyle = typeof errorReportingStyles[number]; interface Options { /** Override the agreements that command-line-application parses */ argv?: string[]; /** Configure whether command-line-application shows the help prompt */ showHelp?: boolean; /** Control how command-line-application reports errors */ error?: ErrorReportingStyle; /** Convert parsed options to camelCase */ camelCase?: boolean; } /** * Create a command line application with all the bells and whistles * @param command the command to create an application for * @param options Advanced options for the application */ export declare function cli(command: Command | MultiCommand, { showHelp, argv, error, camelCase }?: Options): (({ _command: string | string[]; } | { error: string; } | {}) & Record<string, any>) | undefined; export {};