UNPKG

cmd-ts

Version:

> 💻 A type-driven command line argument parser, with awesome error reporting 🤤

18 lines (17 loc) • 903 B
import { ArgParser } from './argparser'; import { OutputOf } from './from'; import { ProvidesHelp, Descriptive, Displayed } from './helpdoc'; import { Type, HasType } from './type'; declare type PositionalParser<Decoder extends Type<string, any>> = ArgParser<OutputOf<Decoder>> & ProvidesHelp & Partial<Descriptive>; declare type StringType = Type<string, string>; /** * A positional command line argument. * * Decodes one argument that is not a flag or an option: * In `hello --key value world` we have 2 positional arguments — `hello` and `world`. * * @param config positional argument config */ export declare function positional<Decoder extends Type<string, any>>(config: HasType<Decoder> & Partial<Displayed & Descriptive>): PositionalParser<Decoder>; export declare function positional(config?: Partial<HasType<never> & Displayed & Descriptive>): PositionalParser<StringType>; export {};