Provide Mount-points for common CLI - Help, Version etc.
See original GitHub issueIn gluegun 2.0 let’s handle the common CLI options in a classy way.
98% of CLIs
If you want the built-in support, you can just use commonCommands
function.
Maybe even more succinct as .commonCommands(['help', 'version'])
These will stop the copy-pasta mess which is mandatory, but not the focus of most CLIs. You can offload it to us.
BUT! What if they want to write their own?
No problem!, we’ll also support .help()
and .version()
of every common command, where a user could inject their own function, so they could do something complex like, spit out 2 versions (I’m looking at you react-native-cli
). Or simply take control of how things should be displayed.
No thanks Gluegun, you’re getting in my way!!!
No problem!, don’t use either of the aforementioned functions and just you do you.
Common Commands Should Include ['version', 'help', 'silent']
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
i like you.
I’d love for this fluent api interface to be:
The absence of any would mean they are disabled.
The presence of them without params would mean they get defaults.
Passing stuff would allow us to customize their behaviour.