diff options
| author | Akio Nakamura <[email protected]> | 2018-11-12 11:06:36 +0900 |
|---|---|---|
| committer | Akio Nakamura <[email protected]> | 2018-11-20 18:28:16 +0900 |
| commit | 3fb09b9889665a24b34f25e9d1385a05058a28b7 (patch) | |
| tree | 22584858721f4dfbeb637fdc3238858a92d2f9db /src/util/system.h | |
| parent | Merge #14768: revert removal of fstream.hpp header in fs.h (diff) | |
| download | discoin-3fb09b9889665a24b34f25e9d1385a05058a28b7.tar.xz discoin-3fb09b9889665a24b34f25e9d1385a05058a28b7.zip | |
Warn unrecognized sections in the config file
In the config file, sections are specified by square bracket pair "[]"$,
or included in the option name itself which separated by a period"(.)".
Typicaly, [testnet] is not a correct section name and specified options
in that section are ignored but user cannot recognize what is happen.
So, add some log/stderr-warning messages if unrecognized section names
are present in the config file after checking section only args.
Diffstat (limited to 'src/util/system.h')
| -rw-r--r-- | src/util/system.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/util/system.h b/src/util/system.h index bebb089a2..66049dfb3 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -149,6 +149,7 @@ protected: std::string m_network GUARDED_BY(cs_args); std::set<std::string> m_network_only_args GUARDED_BY(cs_args); std::map<OptionsCategory, std::map<std::string, Arg>> m_available_args GUARDED_BY(cs_args); + std::set<std::string> m_config_sections GUARDED_BY(cs_args); bool ReadConfigStream(std::istream& stream, std::string& error, bool ignore_invalid_keys = false); @@ -169,7 +170,12 @@ public: * on the command line or in a network-specific section in the * config file. */ - void WarnForSectionOnlyArgs(); + const std::set<std::string> GetUnsuitableSectionOnlyArgs() const; + + /** + * Log warnings for unrecognized section names in the config file. + */ + const std::set<std::string> GetUnrecognizedSections() const; /** * Return a vector of strings of the given argument |