2016-10-09 19:14:02 +00:00
|
|
|
"use strict";
|
|
|
|
|
2014-09-13 21:29:45 +00:00
|
|
|
var ClientManager = new require("../clientManager");
|
|
|
|
var program = require("commander");
|
2016-12-15 06:13:43 +00:00
|
|
|
var colors = require("colors/safe");
|
2017-08-21 05:49:32 +00:00
|
|
|
const Utils = require("./utils");
|
2014-09-13 21:29:45 +00:00
|
|
|
|
|
|
|
program
|
|
|
|
.command("list")
|
2014-10-03 23:33:44 +00:00
|
|
|
.description("List all users")
|
2017-08-21 05:49:32 +00:00
|
|
|
.on("--help", Utils.extraHelp)
|
2014-09-13 21:29:45 +00:00
|
|
|
.action(function() {
|
|
|
|
var users = new ClientManager().getUsers();
|
|
|
|
if (!users.length) {
|
2017-08-23 05:11:28 +00:00
|
|
|
log.info(`There are currently no users. Create one with ${colors.bold("lounge add <name>")}.`);
|
2014-09-13 21:29:45 +00:00
|
|
|
} else {
|
2016-12-15 06:13:43 +00:00
|
|
|
log.info("Users:");
|
2014-09-13 21:29:45 +00:00
|
|
|
for (var i = 0; i < users.length; i++) {
|
2016-12-15 06:13:43 +00:00
|
|
|
log.info(`${i + 1}. ${colors.bold(users[i])}`);
|
2014-09-13 21:29:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|