mirror of
https://github.com/thelounge/thelounge
synced 2024-12-11 21:22:35 +00:00
22 lines
530 B
JavaScript
22 lines
530 B
JavaScript
|
var ClientManager = new require("../clientManager");
|
||
|
var program = require("commander");
|
||
|
|
||
|
program
|
||
|
.command("list")
|
||
|
.description("List all existing users")
|
||
|
.action(function() {
|
||
|
var users = new ClientManager().getUsers();
|
||
|
if (!users.length) {
|
||
|
console.log("");
|
||
|
console.log("No users found!");
|
||
|
console.log("");
|
||
|
} else {
|
||
|
console.log("");
|
||
|
console.log("Users:");
|
||
|
for (var i = 0; i < users.length; i++) {
|
||
|
console.log(" " + (i + 1) + ". " + users[i]);
|
||
|
}
|
||
|
console.log("");
|
||
|
}
|
||
|
});
|