Every binary we have sets up the help option in their own way and wording.
Solve that by having one function take care of it for all of them.
Every binary we have sets up the help option in their own way and wording.
Solve that by having one function take care of it for all of them.
634 | @@ -635,6 +635,12 @@ bool HelpRequested(const ArgsManager& args) 635 | return args.IsArgSet("-?") || args.IsArgSet("-h") || args.IsArgSet("-help") || args.IsArgSet("-help-debug"); 636 | } 637 | 638 | +void SetupHelpOptions(ArgsManager& args) 639 | +{ 640 | + args.AddArg("-?", "Print this help message and exit", false, OptionsCategory::OPTIONS);
Have you considered doing this on ArgsManager constructor?
I'd prefer not to bloat the constructor with stuff, since we've had countless initialization and memory issues due to that.
Fair, you can resolve this.
Concept ACK.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
294 | @@ -295,6 +295,9 @@ extern ArgsManager gArgs; 295 | */ 296 | bool HelpRequested(const ArgsManager& args); 297 | 298 | +/** Add help options to the args manager */ 299 | +void SetupHelpOptions(ArgsManager& args);
nit, how about this as a member, like ArgsManager::SetupHelpOptions?
In general the args are module specific (wallet, node, gui, chain, mempool, ...) so the args manager should not know about them. This is also in line with how we Setup*Options() for all other modules.
Agree with @MarcoFalke here. It is not the responsibility of ArgsManager to know about or hardcode specific options.
Concept ACK
utACK a99999cc04c2e7d79bb841fd954c84e985ed3b88