Closed cakoose closed 5 years ago
Oh, I think I figured it out:
parser.parseArgs(['-a', 'x', '-b', 'y', 'yy', '-b', 'z', 'zz']);
Output:
{"optionString":"-a","values":"x"}
{"optionString":"-b","values":["y","yy"]}
{"optionString":"-b","values":["z","zz"]}
I'm trying to create a custom
Action
class and ran into something unexpected:Output:
I'm not sure why
values
is an array in thenargs='*'
case. Are there any circumstances wherevalues
will be something other than a 1-element array?(BTW, I'm trying to add support for the
Action
class to the DefinitelyTyped type definitions for argparse. I'm stuck on thisstring
vsArray<string>
situation.)