75lb / command-line-args

A mature, feature-complete library to parse command-line options.
MIT License
689 stars 106 forks source link

Allow typescript definition at @types/command-line-args of commandLineArgs to accept a readonly array #104

Closed ellis closed 5 years ago

ellis commented 5 years ago

Could you please update the typescript definitions so that the commandLineArgs function can accept a Readonly array of options? The function definition could then look something like this:

declare function commandLineArgs(
    optionDefinitions: ReadonlyArray<commandLineArgs.OptionDefinition>,
    options?: commandLineArgs.ParseOptions
): commandLineArgs.CommandLineOptions;
75lb commented 5 years ago

could you post a PR on DefinitelyTyped please? I don't use Typescript, I learned the basics a year or two ago but have forgotten everything already. If you post a PR, I will check and approve it if all is good.