mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-26 06:42:08 +00:00
Small changes to falco engine/config wrt new cmdline option parsing
For the most part, replacing getopt() with cxxopts + falco application had no effect on falco engine/config interfaces. However, there were a few places where it was wasier to change the interface than add middleware code that transformed from, for example, vectors to lists. This commit has those changes. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
parent
216f56b73b
commit
83b036bc0e
@ -51,7 +51,7 @@ falco_configuration::~falco_configuration()
|
||||
}
|
||||
}
|
||||
|
||||
void falco_configuration::init(string conf_filename, list<string> &cmdline_options)
|
||||
void falco_configuration::init(string conf_filename, const vector<string> &cmdline_options)
|
||||
{
|
||||
string m_config_file = conf_filename;
|
||||
m_config = new yaml_configuration();
|
||||
@ -390,7 +390,7 @@ static bool split(const string &str, char delim, pair<string, string> &parts)
|
||||
return true;
|
||||
}
|
||||
|
||||
void falco_configuration::init_cmdline_options(list<string> &cmdline_options)
|
||||
void falco_configuration::init_cmdline_options(const vector<string> &cmdline_options)
|
||||
{
|
||||
for(const string &option : cmdline_options)
|
||||
{
|
||||
|
@ -216,8 +216,8 @@ public:
|
||||
falco_configuration();
|
||||
virtual ~falco_configuration();
|
||||
|
||||
void init(std::string conf_filename, std::list<std::string>& cmdline_options);
|
||||
void init(std::list<std::string>& cmdline_options);
|
||||
void init(std::string conf_filename, const std::vector<std::string>& cmdline_options);
|
||||
void init(const std::vector<std::string>& cmdline_options);
|
||||
|
||||
static void read_rules_file_directory(const string& path, list<string>& rules_filenames);
|
||||
|
||||
@ -266,7 +266,7 @@ public:
|
||||
std::vector<plugin_config> m_plugins;
|
||||
|
||||
private:
|
||||
void init_cmdline_options(std::list<std::string>& cmdline_options);
|
||||
void init_cmdline_options(const std::vector<std::string>& cmdline_options);
|
||||
|
||||
/**
|
||||
* Given a <key>=<value> specifier, set the appropriate option
|
||||
|
Loading…
Reference in New Issue
Block a user