grafana-wizzy / wizzy

Manage & automate Grafana with easy wizzy
https://grafana-wizzy.com
Apache License 2.0
468 stars 60 forks source link

Error when launching wizzy without parameters #162

Closed michael-doubez closed 5 years ago

michael-doubez commented 5 years ago

Info

Version: 0.6.0

*OS: Linux

How to reproduce

Command:

$ wizzy

Output:

.../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()
}
michael-doubez commented 5 years ago

Already fixed in 22f432bb4efa7792fd2edb10fb8cd49e7583f3a1