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
Nice to meet you, shadowspawn , and Merry Christmas. I am a Web developer, my name is jasmin
I'd like to ask you a question and hope you can help me answer it.
Please see the bellow codes:
I have installed version 11.1.0 of Commander
npm i commander@11.1.0
And the code is defined as follows:
constcommander=require("commander");constprogram=newcommander.Command();program.name("test-cli").usage("<command> [options]").version("1.0.0").option("-tp, --target-path <target-path>","Whether to specify a local debug file path?","");program.command("init [projectName]").option("-f, --force","Whether to force to init the program? ").action(function(projectName,cmdObj,program){console.log("init",projectName,cmdObj,program.parent.opts());});program.on("option: target-path",function(){console.log("target path test");});program.parse(process.argv);
When I execute the code bellow,
test-cli init --target-path /xxx
Why it can't print the test text "target path test" ?
Can you help with this question?
Nice to meet you, shadowspawn , and Merry Christmas. I am a Web developer, my name is jasmin
I'd like to ask you a question and hope you can help me answer it.
Please see the bellow codes:
I have installed version 11.1.0 of Commander
npm i commander@11.1.0
And the code is defined as follows:
When I execute the code bellow,
test-cli init --target-path /xxx
Why it can't print the test text "target path test" ?
Can you help with this question?
Originally posted by @jasmin2014 in #1969 (comment)
The text was updated successfully, but these errors were encountered: