mirror-chatterino2/src/common/Args.hpp
Leon Richardt 1b75dc1e2c
fix: properly handle CLI arguments (#2368)
Fix CLI arguments not being respected. This happened due to the addition of category-based logging (--help, --version) and changes to the window loading ( --channels), respectively.

When handling --channels, I took the liberty to refactor the previous version of window description (which relied on generating JSON) to directly building the WindowLayout.
2021-01-23 16:26:42 +01:00

29 lines
581 B
C++

#pragma once
#include <QApplication>
#include <boost/optional.hpp>
#include "common/WindowDescriptors.hpp"
namespace chatterino {
/// Command line arguments passed to Chatterino.
class Args
{
public:
Args(const QApplication &app);
bool printVersion{};
bool crashRecovery{};
bool shouldRunBrowserExtensionHost{};
bool dontSaveSettings{};
boost::optional<WindowLayout> customChannelLayout;
private:
void applyCustomChannelLayout(const QString &argValue);
};
void initArgs(const QApplication &app);
const Args &getArgs();
} // namespace chatterino