You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Version flag is passed as function for plugin args #1300
But to clarify, if you make a plugin that has a --version flag, this flag is now (not sure which commit/PR changed this) passed as a function
Reproducible Demo
Make a plugin with this, the version should be logging function instead of string:
module.exports={commands: [{name: 'foo',func: (_,config,args)=>{// at least when --version is not specified, I'm receiving a function here.console.log(args.version)// Function instead of string},options: [{name: '--version [String]',description: 'Foo'},]}]}
If this is not really a problem, I at least expect to be warned in the docs about this..
Does it happen when you name the arg to something different? --version is a special case for the commanderjs lib we're using for parsing arguments. And it gave us headaches as well.
Nop, I thought that it would be the case, so I've already changed the flag to semver.. so for me it's solved, but a warning in the docs would be welcome
I could open a PR for that of you wish so... But maybe there are other reserved words that I don't know that could be documented 🤔
Activity
thymikee commentedon Oct 22, 2020
Does it happen when you name the arg to something different?
--versionis a special case for thecommanderjslib we're using for parsing arguments. And it gave us headaches as well.Grohden commentedon Oct 22, 2020
@thymikee thx for the reply!
Nop, I thought that it would be the case, so I've already changed the flag to semver.. so for me it's solved, but a warning in the docs would be welcome
I could open a PR for that of you wish so... But maybe there are other reserved words that I don't know that could be documented 🤔
thymikee commentedon Oct 22, 2020
PR appreciated! To my knowledge
--versionis the only tricky one.