Closed mattyclarkson closed 6 years ago
Hi, thank you for this PR! (And sorry for the late reply.)
Though I have two major concerns:
private options: CLIOptions
as the third argument of CLI
constructor with those two options, and turn related static methods into instance methods?I could update the help.ts
to use the constants from CLI
?
That would make more sense. I initially added exactly that but realised there were static methods that require the same information and didn't want to land a big refactor in a PR if you weren't going to be happy with it. Would you expect that information to be passed to the nested sub-commands?
You are right. It seems that this could lead to a major refactoring. Maybe we should just use the static options you added this time and use them directly in helper.ts
.
I think I may need a command resolver abstraction in the future.
@vilic just hit this again. Still good for the above comment changes, to update help.ts
to use the static values?
@vilic Have updated the help.ts
as you said. Would love to get this in.
@mattyclarkson Thanks! I made some coding style updates and minor tweaks. Will merge after CI success.
This patch allows the customisation of the default command module name and the extension to use for lookups. Depending on the users build they may be using a different extensions for their CommonJS modules. Being able to specify the default command module name allows the user to re-use a nested sub-command as the default command.