mirror of https://github.com/infosecn1nja/C3.git
Start cleanup
parent
0a1939a6cd
commit
5d237e0f9b
|
@ -25,12 +25,12 @@ namespace MWR::C3::Linter
|
|||
|
||||
AppConfig::AppConfig(int argc, char** argv) : m_ArgParser()
|
||||
{
|
||||
AddOptions();
|
||||
ConfigureParser();
|
||||
m_ArgParser.parse(argc, argv);
|
||||
m_Config = CreateConfig(m_ArgParser);
|
||||
}
|
||||
|
||||
void AppConfig::AddOptions()
|
||||
void AppConfig::ConfigureParser()
|
||||
{
|
||||
m_ArgParser.addArgument("-n", "--name", 1, false);
|
||||
m_ArgParser.addArgument("-a", "--args", '*', false);
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#pragma once
|
||||
#include "argparse.hpp"
|
||||
#include <optional>
|
||||
|
||||
namespace MWR::C3::Linter
|
||||
{
|
||||
|
@ -25,7 +23,7 @@ namespace MWR::C3::Linter
|
|||
Config const& GetConfig() const { return m_Config; }
|
||||
|
||||
private:
|
||||
void AddOptions();
|
||||
void ConfigureParser();
|
||||
argparse::ArgumentParser m_ArgParser;
|
||||
Config m_Config;
|
||||
};
|
||||
|
|
|
@ -3,13 +3,6 @@
|
|||
|
||||
namespace MWR::C3::Linter
|
||||
{
|
||||
void OutputDebug(std::string_view output)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
std::cout << output << std::endl;
|
||||
#endif // _DEBUG
|
||||
}
|
||||
|
||||
/// @throws std::runtime_error if channel with given name was not registered
|
||||
auto const& GetChannelInfo(std::string_view channelName)
|
||||
{
|
||||
|
@ -44,12 +37,6 @@ namespace MWR::C3::Linter
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define DebugDump(x) MWR::C3::Linter::OutputDebug(x)
|
||||
#else
|
||||
#define DebugDump(x)
|
||||
#endif // _DEBUG
|
||||
|
||||
/// Entry point of the application.
|
||||
/// @param argc number of program arguments.
|
||||
/// @param argv vector of program arguments.
|
||||
|
|
|
@ -17,6 +17,7 @@ using json = nlohmann::json;
|
|||
|
||||
#include "Common/CppCodec/base64_default_rfc4648.hpp"
|
||||
|
||||
#include "argparse.hpp"
|
||||
#include "AppConfig.h"
|
||||
#include "InputVector.h"
|
||||
#include "FormElement.hpp"
|
||||
|
|
Loading…
Reference in New Issue