mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add arguments to commander ICommand interface
This commit is contained in:
parent
d6c68f5dcb
commit
c8b4fd92cb
@ -79,6 +79,13 @@ program
|
||||
console.log('unknown option is allowed');
|
||||
});
|
||||
|
||||
program
|
||||
.version('0.0.1')
|
||||
.arguments('<cmd> [env]')
|
||||
.action(function (cmd, env) {
|
||||
console.log(cmd, env);
|
||||
});
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
console.log('stuff');
|
||||
|
||||
5
commander/index.d.ts
vendored
5
commander/index.d.ts
vendored
@ -74,6 +74,11 @@ declare namespace commander {
|
||||
*/
|
||||
command(name:string, desc?:string, opts?: any):ICommand;
|
||||
|
||||
/**
|
||||
* Set / get the arguments usage `str`.
|
||||
*/
|
||||
arguments(str: string):ICommand;
|
||||
|
||||
/**
|
||||
* Add an implicit `help [cmd]` subcommand
|
||||
* which invokes `--help` for the given command.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user