From 7f79c9f9c617178541a9259b07c4b1fa23359b97 Mon Sep 17 00:00:00 2001 From: Joe Lencioni Date: Tue, 23 Aug 2016 21:26:40 -0700 Subject: [PATCH] Default importjsd to --help instead of start This currently does not work correctly when used like `importjsd --parent-pid n`, which has caused some breakages in our editor plugins. Since this does not seem to be a thing that commander.js likes to do very easily, I think the best path forward at this point is to simply default to `--help` instead. I've already updated the editor plugins to use `importjsd start --parent-pid n`. Fixes #345 --- lib/daemon.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/daemon.js b/lib/daemon.js index bd58c7b8..474023be 100644 --- a/lib/daemon.js +++ b/lib/daemon.js @@ -109,11 +109,10 @@ commander.command('logpath') }); export default function daemon(argv: Array) { - const args = argv; - if (args.length <= 2) { - // no arguments were given, so default to start - args.push('start'); - } + commander.parse(argv); - commander.parse(args); + if (argv.length <= 2) { + // no arguments were given, so default to help + commander.help(); + } }