.../lib/node_modules/wizzy/src/index.js:16
commands.help();
^
TypeError: commands.help is not a function
at Object.<anonymous> (.../lib/node_modules/wizzy/src/index.js:16:11)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
Expected output: Help message
Analysis
In index.js, code is wrong:
// If there is no argument also, we will show help
program.parse(process.argv);
if (process.argv.length < 3) {
commands.help();
}
It should be
// If there is no argument also, we will show help
program.parse(process.argv);
if (process.argv.length < 3) {
program.outputHelp()
}
Info
Version: 0.6.0
*OS: Linux
How to reproduce
Command:
Output:
Expected output: Help message
Analysis
In index.js, code is wrong:
It should be