[meow] add booleanDefault option (#28520)

This commit is contained in:
Yuya Tanaka
2018-10-09 12:09:51 -07:00
committed by Andy
parent 51a7427bab
commit 2bd9965877
2 changed files with 8 additions and 1 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for meow 4.x
// Type definitions for meow 5.x
// Project: https://github.com/sindresorhus/meow
// Definitions by: KnisterPeter <https://github.com/KnisterPeter>
// Lindsey Smith <https://github.com/praxxis>
@@ -26,6 +26,11 @@ declare namespace meow {
flags?: buildOptions.Options;
autoHelp?: boolean;
autoVersion?: boolean;
/**
* Caution: Explicitly specifying undefined for booleanDefault
* has different meaning from omitting key itself.
*/
booleanDefault?: boolean | null;
}
interface Result {
+2
View File
@@ -1,6 +1,7 @@
import meow = require('meow');
const cli = meow('Help text', {
booleanDefault: undefined,
flags: {
unicorn: {
type: 'boolean',
@@ -29,6 +30,7 @@ const cli3 = meow({
inferType: true,
autoHelp: true,
autoVersion: true,
booleanDefault: false,
flags: {
unicorn: {
type: 'boolean',