]> git.proxmox.com Git - pve-eslint.git/commitdiff
exit sanely if no args are given
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 9 Apr 2020 16:27:48 +0000 (18:27 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 9 Apr 2020 16:27:51 +0000 (18:27 +0200)
I mean some seem to like python style throwing up in ones face on
every occasion.. I don't though..

nodes drops the original argv0 in favor of process.execPath and the
path to the JavaScript file being executed, so we need more than two
args to be OK.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/app.js

index dbab0abb6c80bd96f434a0b83907f8cdf5933689..c00079ad1b03da8669aaed777ecd7bfe4ec195ca 100644 (file)
@@ -18,6 +18,10 @@ program.on('--help', function() {
     console.log('');
 });
 
+if (process.argv.length <= 2) {
+    program.help();
+}
+
 program.parse(process.argv);
 
 let paths = program.args;