Comparing version 0.0.0 to 0.0.1
import 'colors'; | ||
import { argsParser } from './parser'; | ||
export interface Options { | ||
strict?: boolean; | ||
strict?: boolean; | ||
} | ||
declare class Program { | ||
__name: string; | ||
__version: string; | ||
__cfg: Options; | ||
__options: Record<string, string[]>; | ||
__optionsDetails: Record<string, { | ||
des: string; | ||
default?: any; | ||
raw: string; | ||
}>; | ||
__optionsDefault: Record<string, any>; | ||
private currentCommand; | ||
private commands; | ||
constructor(name: string, opts?: Options); | ||
name(name: string): this; | ||
version(version: string): this; | ||
option(opt: string, description: string, defaultValue?: any): this; | ||
command(cmd: string, alias?: string[]): this; | ||
describe(des: string): this; | ||
action(action: Function): this; | ||
showHelp(command?: string): this; | ||
showVersion(): void; | ||
parse(args: string[]): this; | ||
__name: string; | ||
__version: string; | ||
__cfg: Options; | ||
__options: Record<string, string[]>; | ||
__optionsDetails: Record< | ||
string, | ||
{ | ||
des: string; | ||
default?: any; | ||
raw: string; | ||
} | ||
>; | ||
__optionsDefault: Record<string, any>; | ||
private currentCommand; | ||
private commands; | ||
constructor(name: string, opts?: Options); | ||
name(name: string): this; | ||
version(version: string): this; | ||
option(opt: string, description: string, defaultValue?: any): this; | ||
command(cmd: string, alias?: string[]): this; | ||
/** | ||
* describe specific command | ||
* @param des | ||
* @returns | ||
*/ | ||
describe(des: string): this; | ||
/** | ||
* add a callback to the specific command | ||
* @param action Handler | ||
* @returns | ||
*/ | ||
action(action: Function): this; | ||
/** | ||
* print help | ||
* @param command command for more information | ||
* @returns this | ||
*/ | ||
showHelp(command?: string): this; | ||
/** | ||
* print current version | ||
*/ | ||
showVersion(): void; | ||
/** | ||
* parse args and run application | ||
* ```js | ||
* program.parse(process.argv); | ||
* ``` | ||
* @param args argv | ||
*/ | ||
parse(args: string[]): this; | ||
} | ||
declare function cli(name: string): Program; | ||
declare namespace cli { | ||
var Program: { | ||
new (name: string, opts?: Options): Program; | ||
}; | ||
var parser: typeof argsParser; | ||
var Program: { | ||
new (name: string, opts?: Options): Program; | ||
}; | ||
var parser: typeof argsParser; | ||
} | ||
export default cli; |
{ | ||
"name": "animaux", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "Javascript Library for CLI applications.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
14474
106