Give an error and exit if there are unknown parameters

If an unknown option is given via either the command line args or
the conf file, throw an error and exit

Update tests for ArgsManager knowing args

Ignore unknown options in the config file for bitcoin-cli

Fix tests and bitcoin-cli to match actual options used
This commit is contained in:
Andrew Chow
2018-04-28 19:40:51 -04:00
parent 174f7c8080
commit 4f8704d57f
12 changed files with 205 additions and 66 deletions

View File

@@ -48,11 +48,11 @@ namespace {
class NodeImpl : public Node
{
void parseParameters(int argc, const char* const argv[]) override
bool parseParameters(int argc, const char* const argv[], std::string& error) override
{
gArgs.ParseParameters(argc, argv);
return gArgs.ParseParameters(argc, argv, error);
}
void readConfigFiles() override { gArgs.ReadConfigFiles(); }
bool readConfigFiles(std::string& error) override { return gArgs.ReadConfigFiles(error); }
bool softSetArg(const std::string& arg, const std::string& value) override { return gArgs.SoftSetArg(arg, value); }
bool softSetBoolArg(const std::string& arg, bool value) override { return gArgs.SoftSetBoolArg(arg, value); }
void selectParams(const std::string& network) override { SelectParams(network); }