diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2021-08-21 14:06:49 -0400 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2021-10-25 10:44:17 -0400 |
commit | b8c069b7a952e326d2d974cc671889d1a3b38aa4 (patch) | |
tree | 130fa8cc58539646cb34685f97ff485f8a738083 /src/util/system.h | |
parent | 26a50ab322614bceb5bc62e2c282f83e5987bad8 (diff) | |
download | bitcoin-b8c069b7a952e326d2d974cc671889d1a3b38aa4.tar.xz |
refactor: Add explicit DISALLOW_NEGATION ArgsManager flag to clarify flag usage
Currently, ALLOW_{INT|BOOL|STRING} flags don't do any real validation,
so current uses of these flags are misleading and will also break
backwards compatibility whenever these flags are implemented in a future
PR (draft PR is #16545).
An additional complication is that while these flags don't do any real
settings validation, they do affect whether setting negation syntax is
allowed.
Fix this mess by disabling ALLOW_{INT|BOOL|STRING} flags until they are
implemented, and adding an unambiguous DISALLOW_NEGATION flag. This is
done in two commits, with this commit adding the DISALLOW_NEGATION flag,
and the next commit disabling the ALLOW_{INT|BOOL|STRING} flags.
Diffstat (limited to 'src/util/system.h')
-rw-r--r-- | src/util/system.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/util/system.h b/src/util/system.h index 2e217f6f90..a4323e0f9e 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -158,12 +158,18 @@ struct SectionInfo class ArgsManager { public: + /** + * Flags controlling how config and command line arguments are validated and + * interpreted. + */ enum Flags : uint32_t { - // Boolean options can accept negation syntax -noOPTION or -noOPTION=1 - ALLOW_BOOL = 0x01, - ALLOW_INT = 0x02, - ALLOW_STRING = 0x04, - ALLOW_ANY = ALLOW_BOOL | ALLOW_INT | ALLOW_STRING, + ALLOW_ANY = 0x01, //!< disable validation + ALLOW_BOOL = 0x02, //!< unimplemented, draft implementation in #16545 + ALLOW_INT = 0x04, //!< unimplemented, draft implementation in #16545 + ALLOW_STRING = 0x08, //!< unimplemented, draft implementation in #16545 + ALLOW_LIST = 0x10, //!< unimplemented, draft implementation in #16545 + DISALLOW_NEGATION = 0x20, //!< disallow -nofoo syntax + DEBUG_ONLY = 0x100, /* Some options would cause cross-contamination if values for * mainnet were used while running on regtest/testnet (or vice-versa). |