mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
Merge pull request #12776 from nikeee/types-2.0
Fix builder function return type
This commit is contained in:
Vendored
+3
-4
@@ -65,11 +65,10 @@ declare namespace yargs {
|
||||
usage(options?: { [key: string]: Options }): Argv;
|
||||
|
||||
command(command: string, description: string): Argv;
|
||||
command(command: string, description: string, handler: (args: Argv) => void): Argv;
|
||||
command(command: string, description: string, builder: (args: Argv) => Options): Argv;
|
||||
command(command: string, description: string, builder: (args: Argv) => Argv): Argv;
|
||||
command(command: string, description: string, builder: { [optionName: string]: Options }): Argv;
|
||||
command(command: string, description: string, builder: { [optionName: string]: Options }, handler: (args: Argv) => void): Argv;
|
||||
command(command: string, description: string, builder: (args: Argv) => Options, handler: (args: Argv) => void): Argv;
|
||||
command(command: string, description: string, builder: { [optionName: string]: Options }, handler: (args: any) => void): Argv;
|
||||
command(command: string, description: string, builder: (args: Argv) => Argv, handler: (args: any) => void): Argv;
|
||||
command(command: string, description: string, module: CommandModule): Argv;
|
||||
command(module: CommandModule): Argv;
|
||||
|
||||
|
||||
+30
-4
@@ -188,14 +188,13 @@ 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', {
|
||||
.command('publish', 'shiver me timbers, should you be sharing all that', yargs =>
|
||||
yargs.option('f', {
|
||||
alias: 'force',
|
||||
description: 'yar, it usually be a bad idea'
|
||||
})
|
||||
.help('help')
|
||||
.argv;
|
||||
})
|
||||
)
|
||||
.command("build", "arghh, build it mate", {
|
||||
tag: {
|
||||
default: true,
|
||||
@@ -226,6 +225,33 @@ function command() {
|
||||
})
|
||||
.help('help')
|
||||
.argv;
|
||||
|
||||
yargs
|
||||
.command('get', 'make a get HTTP request', function (yargs) {
|
||||
return yargs.option('url', {
|
||||
alias: 'u',
|
||||
default: 'http://yargs.js.org/'
|
||||
})
|
||||
})
|
||||
.help()
|
||||
.argv
|
||||
|
||||
yargs
|
||||
.command(
|
||||
'get',
|
||||
'make a get HTTP request',
|
||||
function (yargs) {
|
||||
return yargs.option('u', {
|
||||
alias: 'url',
|
||||
describe: 'the URL to make an HTTP request to'
|
||||
})
|
||||
},
|
||||
function (argv: { url: string }) {
|
||||
console.dir(argv.url)
|
||||
}
|
||||
)
|
||||
.help()
|
||||
.argv
|
||||
}
|
||||
|
||||
function completion_sync() {
|
||||
|
||||
Reference in New Issue
Block a user