mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #26165 from eps1lon/argparse-fix-addArgument
fix(argparse): addArgument accepts strings
This commit is contained in:
@@ -20,6 +20,12 @@ simpleExample.addArgument(
|
||||
help: 'bar foo',
|
||||
}
|
||||
);
|
||||
simpleExample.addArgument(
|
||||
'positional',
|
||||
{
|
||||
help: 'bar foo',
|
||||
}
|
||||
);
|
||||
|
||||
simpleExample.printHelp();
|
||||
console.log('-----------');
|
||||
|
||||
Vendored
+2
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user