From 981fcd2f64b4e8f1d8991b0a0697029d61235997 Mon Sep 17 00:00:00 2001 From: Michael Ferris Date: Tue, 10 Jul 2018 16:20:25 -0700 Subject: [PATCH] yargs (#27171) Add `hide` method according to http://yargs.js.org/docs/#api-hidekey Add `showhidden` method according to http://yargs.js.org/docs/#api-showhidden --- types/yargs/index.d.ts | 7 ++++++- types/yargs/yargs-tests.ts | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/types/yargs/index.d.ts b/types/yargs/index.d.ts index 882e8e9999..50901570a4 100644 --- a/types/yargs/index.d.ts +++ b/types/yargs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for yargs 11.0 +// Type definitions for yargs 11.1 // Project: https://github.com/chevex/yargs // Definitions by: Martin Poelstra // Mizunashi Mana @@ -116,6 +116,8 @@ declare namespace yargs { group(key: string | string[], groupName: string): Argv; + hide(key: string): Argv; + help(): Argv; help(enableExplicit: boolean): Argv; help(option: string, enableExplicit: boolean): Argv; @@ -185,6 +187,9 @@ declare namespace yargs { showCompletionScript(): Argv; + showhidden(option?: string | boolean): Argv; + showhidden(option: string, description?: string): Argv; + showHelp(consoleLevel?: string): Argv; showHelpOnFail(enable: boolean, message?: string): Argv; diff --git a/types/yargs/yargs-tests.ts b/types/yargs/yargs-tests.ts index 43779309bf..f98120d1c4 100644 --- a/types/yargs/yargs-tests.ts +++ b/types/yargs/yargs-tests.ts @@ -648,3 +648,16 @@ function Argv$check() { .check((argv, aliases) => void 0) .check((argv, aliases) => void 0, false); } + +function Argv$hide() { + const ya = yargs + .hide('a'); +} + +function Argv$showhidden() { + const ya = yargs + .showhidden() + .showhidden(true) + .showhidden('show-hidden') + .showhidden('show-hidden', 'Show hidden options'); +}