aboutsummaryrefslogtreecommitdiff
path: root/src/cli.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-01-08 16:49:57 +0100
committerGitHub <noreply@github.com>2022-01-08 16:49:57 +0100
commit61384d15d1fb34511cdb78690b5ec4e2f7d7a7c4 (patch)
treeba786f87cdefd22cd54413517fcfb2359f7f3bae /src/cli.js
parent5206e9e4051b5c90e11b3aa331b0f6ee5546d25e (diff)
parent8ad3b0522aee4afc0d7494aaf3927c388752b24c (diff)
downloadViper-61384d15d1fb34511cdb78690b5ec4e2f7d7a7c4.tar.gz
Viper-61384d15d1fb34511cdb78690b5ec4e2f7d7a7c4.zip
Merge pull request #19 from 0neGal/mod-support
Adds mod support, removing, installing and toggling mods, both CLI and GUI
Diffstat (limited to 'src/cli.js')
-rw-r--r--src/cli.js30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/cli.js b/src/cli.js
index b6594a5..d5ee3ad 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -10,12 +10,16 @@ const lang = require("./lang");
function hasArgs() {
if (cli.hasSwitch("cli") ||
cli.hasSwitch("help") ||
+ cli.hasSwitch("mods") ||
cli.hasSwitch("update") ||
cli.hasSwitch("launch") ||
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}
}
@@ -27,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();
@@ -62,6 +70,12 @@ async function init() {
break;
}
}
+
+ 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")}
}
module.exports = {