aspargvs
Version:
Parse argv as json object
16 lines (15 loc) • 611 B
TypeScript
import * as p from 'peberminta';
import { JsonObject } from './json';
import { Options } from './options';
export declare type BareCommandId = 'version' | 'help' | 'inspect' | 'unparse';
export declare type CommandWithDataId = 'json' | 'preset' | 'inspect' | 'unparse';
export declare type CommandResult = {
type: 'command';
command: BareCommandId;
};
export declare type CommandResultWithData = {
type: 'commandWithData';
command: CommandWithDataId;
json: JsonObject;
};
export declare const parseAnyCommand: p.Parser<string, Options, CommandResult | CommandResultWithData>;