hardlounge/src/command-line/index.js

41 lines
1008 B
JavaScript
Raw Normal View History

"use strict";
global.log = require("../log.js");
2016-04-16 11:32:38 +00:00
const program = require("commander");
const colors = require("colors/safe");
const Helper = require("../helper");
const Utils = require("./utils");
2014-08-19 01:18:40 +00:00
program.version(Helper.getVersion(), "-v, --version")
.option("--home <path>", `${colors.bold("[DEPRECATED]")} Use the ${colors.green("LOUNGE_HOME")} environment variable instead.`)
.on("--help", Utils.extraHelp)
.parseOptions(process.argv);
2016-05-09 16:19:16 +00:00
if (program.home) {
log.warn(`${colors.green("--home")} is ${colors.bold("deprecated")} and will be removed in a future version.`);
log.warn(`Use the ${colors.green("LOUNGE_HOME")} environment variable instead.`);
}
let home = program.home || process.env.LOUNGE_HOME;
if (!home) {
home = Utils.defaultLoungeHome();
}
Helper.setHome(home);
2014-10-03 23:33:44 +00:00
require("./start");
require("./config");
require("./list");
require("./add");
require("./remove");
require("./reset");
require("./edit");
program.parse(process.argv);
2014-10-14 20:53:26 +00:00
2014-08-19 01:18:40 +00:00
if (!program.args.length) {
program.help();
2014-08-19 01:18:40 +00:00
}