cmd-ts
Version:
> 💻 A type-driven command line argument parser, with awesome error reporting 🤤
24 lines (23 loc) • 441 B
TypeScript
export declare type Token = {
index: number;
type: 'argumentDivider';
raw: ' ';
} | {
index: number;
type: 'shortPrefix';
raw: '-';
} | {
index: number;
type: 'longPrefix';
raw: '--';
} | {
index: number;
type: 'char';
raw: string;
};
/**
* Tokenize a list of arguments
*
* @param strings arguments, based on `process.argv`
*/
export declare function tokenize(strings: string[]): Token[];