decline-ts
Version:
Composable command-line parser for TypeScript - a (partial) porting of Scala decline using fp-ts
10 lines (9 loc) • 534 B
TypeScript
import { Either } from 'fp-ts/Either';
import { Option } from 'fp-ts/Option';
import { Command } from './Command';
import { Help } from './Help';
export declare const longOpt: (str: string) => Option<string>;
export declare const longOptWithEquals: (str: string) => Option<readonly [string, string]>;
export declare const shortOpt: (str: string) => Option<readonly [string, string]>;
export declare type Parser<A> = (args: ReadonlyArray<string>) => Either<Help, A>;
export declare const Parser: <A>(command: Command<A>) => Parser<A>;