Settings can be overwritten on command line

make pidfile and persistant data dir confgurable
This commit is contained in:
badaix 2020-02-25 23:40:23 +01:00
parent 0c25a7a42d
commit 7376c7709c
8 changed files with 45 additions and 21 deletions

View file

@ -338,6 +338,9 @@ public:
/// @param argv command line arguments
void parse(int argc, const char* const argv[]);
/// Delete all parsed options
void reset();
/// Produce a help message
/// @param max_attribute show options up to this level (optional, advanced, expert)
/// @return the help message
@ -989,11 +992,6 @@ inline void OptionParser::parse(const std::string& ini_filename)
inline void OptionParser::parse(int argc, const char* const argv[])
{
unknown_options_.clear();
non_option_args_.clear();
for (auto& opt : options_)
opt->clear();
for (int n = 1; n < argc; ++n)
{
const std::string arg(argv[n]);
@ -1094,6 +1092,15 @@ inline void OptionParser::parse(int argc, const char* const argv[])
}
inline void OptionParser::reset()
{
unknown_options_.clear();
non_option_args_.clear();
for (auto& opt : options_)
opt->clear();
}
inline std::string OptionParser::help(const Attribute& max_attribute) const
{
ConsoleOptionPrinter option_printer(this);