From bb4107dc401097d8143c642b56a4d1228bdca5ee Mon Sep 17 00:00:00 2001 From: Jeff Kenney Date: Thu, 26 Jan 2017 16:01:19 -0800 Subject: [PATCH] yargs: add conflicts() --- yargs/index.d.ts | 3 +++ yargs/yargs-tests.ts | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/yargs/index.d.ts b/yargs/index.d.ts index bd512a7773..1cd96e68e1 100644 --- a/yargs/index.d.ts +++ b/yargs/index.d.ts @@ -109,6 +109,9 @@ declare namespace yargs { config(key: string, parseFn: (configPath: string) => Object): Argv; config(keys: string[], parseFn: (configPath: string) => Object): Argv; + conflicts(key: string, value: string): Argv; + conflicts(conflicts: { [key: string]: string }): Argv; + wrap(columns: number): Argv; strict(): Argv; diff --git a/yargs/yargs-tests.ts b/yargs/yargs-tests.ts index 90448bce77..f68c1113e9 100644 --- a/yargs/yargs-tests.ts +++ b/yargs/yargs-tests.ts @@ -599,3 +599,12 @@ function Argv$demandOption() { .demandOption(['a', 'b'], true) .argv; } + +function Argv$conflicts() { + var ya = yargs + .conflicts('a', 'b') + .conflicts({ + a: 'b' + }) + .argv; +}