clef-parse
Version:
Simple, lightweight argv parser. Powers the cleffa and clefairy packages
27 lines (26 loc) • 759 B
TypeScript
import { Path } from "nice-path";
export type Hint = typeof String | typeof Boolean | typeof Number | typeof Path;
export { Path };
export declare function parseArgv(argv?: Array<string>, hints?: {
[key: string]: Hint | undefined | null;
}, { isAbsolute, resolvePath, getCwd, }?: {
isAbsolute?: (somePath: string) => boolean;
resolvePath?: (...parts: Array<string>) => string;
getCwd?: () => string;
}): {
options: {
[key: string]: any;
};
positionalArgs: Array<string>;
metadata: {
keys: {
[key: string]: string | undefined;
};
hints: {
[key: string]: string | undefined;
};
guesses: {
[key: string]: string | undefined;
};
};
};