Remove password argument from add command
This commit is contained in:
parent
a0ed791926
commit
1dc9929cf7
|
@ -6,7 +6,7 @@ var mkdirp = require("mkdirp");
|
||||||
var Helper = require("../helper");
|
var Helper = require("../helper");
|
||||||
|
|
||||||
program
|
program
|
||||||
.command("add <name> [<password>]")
|
.command("add <name>")
|
||||||
.description("Add a new user")
|
.description("Add a new user")
|
||||||
.action(function(name, password) {
|
.action(function(name, password) {
|
||||||
var path = Helper.HOME + "/users";
|
var path = Helper.HOME + "/users";
|
||||||
|
@ -38,16 +38,12 @@ program
|
||||||
console.log("");
|
console.log("");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (password) {
|
|
||||||
add(manager, name, password);
|
|
||||||
} else {
|
|
||||||
require("read")({
|
require("read")({
|
||||||
prompt: "Password: ",
|
prompt: "Password: ",
|
||||||
silent: true
|
silent: true
|
||||||
}, function(err, password) {
|
}, function(err, password) {
|
||||||
if (!err) add(manager, name, password);
|
if (!err) add(manager, name, password);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function add(manager, name, password) {
|
function add(manager, name, password) {
|
||||||
|
|
Loading…
Reference in New Issue