Merge pull request #26165 from eps1lon/argparse-fix-addArgument

fix(argparse): addArgument accepts strings
This commit is contained in:
Daniel Rosenwasser
2018-05-31 17:34:29 -07:00
committed by GitHub
2 changed files with 8 additions and 1 deletions
+6
View File
@@ -20,6 +20,12 @@ simpleExample.addArgument(
help: 'bar foo',
}
);
simpleExample.addArgument(
'positional',
{
help: 'bar foo',
}
);
simpleExample.printHelp();
console.log('-----------');
+2 -1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/nodeca/argparse
// Definitions by: Andrew Schurman <https://github.com/arcticwaters>
// Tomasz Łaziuk <https://github.com/tlaziuk>
// Sebastian Silbermann <https://github.com/eps1lon>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -34,7 +35,7 @@ export class SubParser {
}
export class ArgumentGroup {
addArgument(args: string[], options?: ArgumentOptions): void;
addArgument(args: string[] | string, options?: ArgumentOptions): void;
addArgumentGroup(options?: ArgumentGroupOptions): ArgumentGroup;
addMutuallyExclusiveGroup(options?: { required: boolean }): ArgumentGroup;
setDefaults(options?: {}): void;