Argument parsing rework (#1940)
* Experimental argument handling * Restored browser extension launch functionality Also moved check from BrowerExtension.cpp to Args.cpp as it is more relevant there and doesn't require passing arguments to a function in another file * Fixed formatting * Simplified Args.cpp code, added changelog entry * Hid crash-recovery from help * Dont save settings if launched with --channels * Changed parsing method to t:channel * Code cleanup * Changed plaform delimeter to :, platform defaults to Twitch Co-authored-by: fourtf <tf.four@gmail.com>
This commit is contained in:
+3
-6
@@ -1,4 +1,5 @@
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
#include <QStringList>
|
||||
@@ -25,14 +26,10 @@ int main(int argc, char **argv)
|
||||
QCoreApplication::setApplicationVersion(CHATTERINO_VERSION);
|
||||
QCoreApplication::setOrganizationDomain("https://www.chatterino.com");
|
||||
|
||||
// convert char** to QStringList
|
||||
auto args = QStringList();
|
||||
std::transform(argv + 1, argv + argc, std::back_inserter(args),
|
||||
[&](auto s) { return s; });
|
||||
initArgs(args);
|
||||
initArgs(a);
|
||||
|
||||
// run in gui mode or browser extension host mode
|
||||
if (shouldRunBrowserExtensionHost(args))
|
||||
if (getArgs().shouldRunBrowserExtensionHost)
|
||||
{
|
||||
runBrowserExtensionHost();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user