mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-11 11:50:54 +08:00
Add optional function parameter to command()
This commit is contained in:
@@ -134,6 +134,22 @@ function Argv$options() {
|
||||
;
|
||||
}
|
||||
|
||||
function command() {
|
||||
var argv = yargs
|
||||
.usage('npm <command>')
|
||||
.command('install', 'tis a mighty fine package to install')
|
||||
.command('publish', 'shiver me timbers, should you be sharing all that', yargs => {
|
||||
argv = yargs.option('f', {
|
||||
alias: 'force',
|
||||
description: 'yar, it usually be a bad idea'
|
||||
})
|
||||
.help('help')
|
||||
.argv;
|
||||
})
|
||||
.help('help')
|
||||
.argv;
|
||||
}
|
||||
|
||||
function Argv$help() {
|
||||
var yargs1 = yargs
|
||||
.usage("$0 -operand1 number -operand2 number -operation [add|subtract]");
|
||||
|
||||
Reference in New Issue
Block a user