thelounge/src/command-line/list.js
Jérémie Astori caa46042bf Enforce strict mode across all JS files with ESLint
Several ES6 additions are only available in strict mode. Example:
> SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

Strict mode was also enabled in a few of our files already, and it is a good thing to have anyway.
2016-10-09 15:14:02 -04:00

20 lines
432 B
JavaScript

"use strict";
var ClientManager = new require("../clientManager");
var program = require("commander");
program
.command("list")
.description("List all users")
.action(function() {
var users = new ClientManager().getUsers();
if (!users.length) {
log.warn("No users found!");
} else {
console.log("Users:");
for (var i = 0; i < users.length; i++) {
console.log(" " + (i + 1) + ". " + users[i]);
}
}
});