summaryrefslogtreecommitdiffstats
path: root/application/MultiMC.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-09-30 00:11:00 +0200
committerPetr Mrázek <peterix@gmail.com>2015-09-30 00:11:00 +0200
commite2fd299fc588962b19b91d3e11f7bf274080de84 (patch)
treeec3ac3be97edfc42976847ceb50fd8adf4cf1fd2 /application/MultiMC.cpp
parente993b1152df6ba7ca343e66263f2860e4c4ecee6 (diff)
downloadMultiMC-e2fd299fc588962b19b91d3e11f7bf274080de84.tar
MultiMC-e2fd299fc588962b19b91d3e11f7bf274080de84.tar.gz
MultiMC-e2fd299fc588962b19b91d3e11f7bf274080de84.tar.lz
MultiMC-e2fd299fc588962b19b91d3e11f7bf274080de84.tar.xz
MultiMC-e2fd299fc588962b19b91d3e11f7bf274080de84.zip
GH-253 implement launching instances from command line
Diffstat (limited to 'application/MultiMC.cpp')
-rw-r--r--application/MultiMC.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp
index 86356cd1..3b2003e4 100644
--- a/application/MultiMC.cpp
+++ b/application/MultiMC.cpp
@@ -84,6 +84,10 @@ MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, ar
parser.addShortOpt("dir", 'd');
parser.addDocumentation("dir", "use the supplied directory as MultiMC root instead of "
"the binary location (use '.' for current)");
+ // --launch
+ parser.addOption("launch");
+ parser.addShortOpt("launch", 'l');
+ parser.addDocumentation("launch", "launch the specified instance (by instance ID)");
// parse the arguments
try
@@ -135,6 +139,8 @@ MultiMC::MultiMC(int &argc, char **argv, bool test_mode) : QApplication(argc, ar
adjustedBy += "Fallback to binary path " + dataPath;
}
+ launchId = args["launch"].toString();
+
if (!ensureFolderPathExists(dataPath) || !QDir::setCurrent(dataPath))
{
// BAD STUFF. WHAT DO?