aboutsummaryrefslogtreecommitdiff
path: root/src/cli.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-01-08 15:05:35 +0100
committer0neGal <mail@0negal.com>2022-01-08 15:13:07 +0100
commit1c12fb2e90d26e25be6206076ad6762fa92a5962 (patch)
tree89e0035a458948f58ccc9b4aa4cac7fccb523cd5 /src/cli.js
parent927def020baf544a23140ba8cfa53dcef9f23aa8 (diff)
downloadViper-1c12fb2e90d26e25be6206076ad6762fa92a5962.tar.gz
Viper-1c12fb2e90d26e25be6206076ad6762fa92a5962.zip
added cli arguments for mods
This adds both the arguments themselves, but also their entries in the man page and help page.
Diffstat (limited to 'src/cli.js')
-rw-r--r--src/cli.js27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/cli.js b/src/cli.js
index 55cee0e..d5ee3ad 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -16,7 +16,10 @@ function hasArgs() {
cli.hasSwitch("setpath") ||
cli.hasSwitch("version") ||
cli.hasSwitch("updatevp") ||
- cli.hasSwitch("gamepath")) {
+ cli.hasSwitch("gamepath") ||
+ cli.hasSwitch("togglemod") ||
+ cli.hasSwitch("removemod") ||
+ cli.hasSwitch("installmod")) {
return true;
} else {return false}
}
@@ -28,14 +31,18 @@ function exit(code) {
async function init() {
if (cli.hasSwitch("help")) {
console.log(`options:
- --help ${lang("cli.help.help")}
- --debug ${lang("cli.help.debug")}
- --version ${lang("cli.help.version")}
+ --help ${lang("cli.help.help")}
+ --debug ${lang("cli.help.debug")}
+ --version ${lang("cli.help.version")}
- --cli ${lang("cli.help.cli")}
- --update ${lang("cli.help.update")}
- --updatevp ${lang("cli.help.updatevp")}
- --setpath ${lang("cli.help.setpath")}`)
+ --cli ${lang("cli.help.cli")}
+ --update ${lang("cli.help.update")}
+ --updatevp ${lang("cli.help.updatevp")}
+ --setpath ${lang("cli.help.setpath")}
+
+ --installmod ${lang("cli.help.installmod")}
+ --removemod ${lang("cli.help.removemod")}
+ --togglemod ${lang("cli.help.togglemod")}`)
// In the future --setpath should be able to understand
// relative paths, instead of just absolute ones.
exit();
@@ -64,6 +71,10 @@ async function init() {
}
}
+ if (cli.hasSwitch("installmod")) {ipcMain.emit("installmod")}
+ if (cli.hasSwitch("removemod")) {ipcMain.emit("removemod", "", cli.getSwitchValue("removemod"))}
+ if (cli.hasSwitch("togglemod")) {ipcMain.emit("togglemod", "", cli.getSwitchValue("togglemod"))}
+
if (cli.hasSwitch("mods")) {ipcMain.emit("getmods")}
}