diff --git a/optimist/optimist-tests.ts b/optimist/optimist-tests.ts index 2fe670cbf6..feaa3d6f7d 100644 --- a/optimist/optimist-tests.ts +++ b/optimist/optimist-tests.ts @@ -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]); diff --git a/optimist/optimist.d.ts b/optimist/optimist.d.ts index 7393190bd4..c2783b9b63 100644 --- a/optimist/optimist.d.ts +++ b/optimist/optimist.d.ts @@ -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