var _ = require("lodash"); var ClientManager = new require("../clientManager"); var program = require("commander"); var shout = require("../server"); var Helper = require("../helper"); program .option("-H, --host " , "host") .option("-P, --port " , "port") .option("-B, --bind " , "bind") .option(" --public" , "mode") .option(" --private" , "mode") .command("start") .description("Start the server") .action(function() { var users = new ClientManager().getUsers(); var config = Helper.getConfig(); var mode = config.public; if (program.public) { mode = true; } else if (program.private) { mode = false; } if (!mode && !users.length) { console.log(""); console.log("No users found!"); console.log("Create a new user with 'shout add '."); console.log(""); } else { shout({ host: program.host || config.host, port: program.port || config.port, bind: program.bind || config.bind, public: mode }); } });