mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-03 08:39:49 +02:00
Settings can be overwritten on command line
make pidfile and persistant data dir confgurable
This commit is contained in:
parent
0c25a7a42d
commit
7376c7709c
8 changed files with 45 additions and 21 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue