From 1dc9929cf7b90ee886d529fa4e63b2c659dfc849 Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Mon, 27 Oct 2014 22:55:20 +0100 Subject: [PATCH] Remove password argument from add command --- src/command-line/add.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/command-line/add.js b/src/command-line/add.js index 0029146..830b802 100644 --- a/src/command-line/add.js +++ b/src/command-line/add.js @@ -6,7 +6,7 @@ var mkdirp = require("mkdirp"); var Helper = require("../helper"); program - .command("add []") + .command("add ") .description("Add a new user") .action(function(name, password) { var path = Helper.HOME + "/users"; @@ -38,16 +38,12 @@ program console.log(""); return; } - if (password) { - add(manager, name, password); - } else { - require("read")({ - prompt: "Password: ", - silent: true - }, function(err, password) { - if (!err) add(manager, name, password); - }); - } + require("read")({ + prompt: "Password: ", + silent: true + }, function(err, password) { + if (!err) add(manager, name, password); + }); }); function add(manager, name, password) {