mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
update to support allowUnknownOption()
This commit is contained in:
parent
32029fcb4e
commit
e29d691d41
@ -95,6 +95,13 @@ program.on('--help', () => {
|
||||
console.log('');
|
||||
});
|
||||
|
||||
program
|
||||
.command('allow-unknown-option')
|
||||
.allowUnknownOption()
|
||||
.action(() => {
|
||||
console.log('unknown option is allowed');
|
||||
});
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
console.log('stuff');
|
||||
|
||||
9
commander/commander.d.ts
vendored
9
commander/commander.d.ts
vendored
@ -158,6 +158,15 @@ declare module commander {
|
||||
option(flags:string, description?:string, fn?:(arg1:any, arg2:any)=>void, defaultValue?:any):ICommand;
|
||||
option(flags:string, description?:string, defaultValue?:any):ICommand;
|
||||
|
||||
/**
|
||||
* Allow unknown options on the command line.
|
||||
*
|
||||
* @param {Boolean} arg if `true` or omitted, no error will be thrown
|
||||
* for unknown options.
|
||||
* @api public
|
||||
*/
|
||||
allowUnknownOption(arg?: boolean):ICommand;
|
||||
|
||||
/**
|
||||
* Parse `argv`, settings options and invoking commands when defined.
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user