Parser#check(...) is a chainable function, just like all the others

This commit is contained in:
Christopher Brown
2016-02-16 16:35:04 -06:00
parent be0077fc10
commit 3ac0f658bd
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ parser = parser.options({});
parser = parser.usage(str);
parser.check(checkFn);
parser = parser.check(checkFn);
parser = parser.boolean(str);
parser = parser.boolean([str]);
+1 -1
View File
@@ -60,7 +60,7 @@ declare module "optimist" {
/** Check that certain conditions are met in the provided arguments. If fn
throws or returns false, show the thrown error, usage information, and exit.
*/
check(fn: (argv: any) => any): void;
check(fn: (argv: any) => any): Parser;
/** Interpret key as a boolean. If a non-flag option follows key in process.argv,
that string won't get set as the value of key. If key never shows up as a