hardlounge/src/command-line/list.js

18 lines
417 B
JavaScript
Raw Normal View History

2014-09-13 21:29:45 +00:00
var ClientManager = new require("../clientManager");
var program = require("commander");
program
.command("list")
2014-10-03 23:33:44 +00:00
.description("List all users")
2014-09-13 21:29:45 +00:00
.action(function() {
var users = new ClientManager().getUsers();
if (!users.length) {
2016-04-16 11:32:38 +00:00
log.warn("No users found!");
2014-09-13 21:29:45 +00:00
} else {
console.log("Users:");
for (var i = 0; i < users.length; i++) {
console.log(" " + (i + 1) + ". " + users[i]);
}
}
});