diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2019-11-11 19:05:12 -0500 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2019-11-13 04:20:30 -0500 |
commit | dc0f1480746b34aa3ca2d9c0f1ec764083026b40 (patch) | |
tree | 71bf0642facbb3f60abab127e03b7d7be2b4ff44 /src/util/system.h | |
parent | 57e8b7a7273567aa4a4aee87cce18e9bff8f3196 (diff) |
refactor: Replace FlagsOfKnownArg with GetArgFlags
Rename suggested by João Barbosa <joao.paulo.barbosa@gmail.com>
https://github.com/bitcoin/bitcoin/pull/16545#issuecomment-519048000
This also gets rid of ArgsManager::NONE constant, which was an implementation
detail not meant to be used by ArgsManager callers.
Finally this reverts a change from 7f40528cd50fc43ac0bd3e785de24d661adddb7a
https://github.com/bitcoin/bitcoin/pull/15934 adding "-" characters to argument
names. Better for GetArgFlags to require "-" prefixes for consistency with
other ArgsManager methods, and to be more efficient later when GetArg functions
need to call GetArgFlags (https://github.com/bitcoin/bitcoin/pull/16545)
This commit does not change behavior.
Diffstat (limited to 'src/util/system.h')
-rw-r--r-- | src/util/system.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/system.h b/src/util/system.h index e0b6371dc9..d02d3f274a 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -19,6 +19,7 @@ #include <compat/assumptions.h> #include <fs.h> #include <logging.h> +#include <optional.h> #include <sync.h> #include <tinyformat.h> #include <util/memory.h> @@ -132,7 +133,6 @@ class ArgsManager { public: enum Flags { - NONE = 0x00, // Boolean options can accept negation syntax -noOPTION or -noOPTION=1 ALLOW_BOOL = 0x01, ALLOW_INT = 0x02, @@ -296,9 +296,9 @@ public: /** * Return Flags for known arg. - * Return ArgsManager::NONE for unknown arg. + * Return nullopt for unknown arg. */ - unsigned int FlagsOfKnownArg(const std::string& key) const; + Optional<unsigned int> GetArgFlags(const std::string& name) const; }; extern ArgsManager gArgs; |