added class containing program arguments

This commit is contained in:
fourtf
2019-09-22 15:30:04 +02:00
parent 456065f508
commit 7e555843ca
5 changed files with 51 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#include "Args.hpp"
namespace chatterino {
Args::Args(const QStringList &args)
{
for (auto &&arg : args)
{
if (arg == "--crash-recovery")
{
this->crashRecovery = true;
}
}
}
static Args *instance = nullptr;
void initArgs(const QStringList &args)
{
instance = new Args(args);
}
const Args &getArgs()
{
assert(instance);
return *instance;
}
} // namespace chatterino