util: Add SetupHelpOptions() #15358

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1902-Help changing 10 files +23 −28
  1. MarcoFalke commented at 7:02 PM on February 6, 2019: member

    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.

  2. MarcoFalke added the label Refactoring on Feb 6, 2019
  3. MarcoFalke added the label Docs on Feb 6, 2019
  4. util: Add SetupHelpOptions() a99999cc04
  5. MarcoFalke force-pushed on Feb 6, 2019
  6. in src/util/system.cpp:640 in a99999cc04
     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);
    


    promag commented at 7:32 PM on February 6, 2019:

    Have you considered doing this on ArgsManager constructor?


    MarcoFalke commented at 7:38 PM on February 6, 2019:

    I'd prefer not to bloat the constructor with stuff, since we've had countless initialization and memory issues due to that.


    promag commented at 3:26 PM on February 7, 2019:

    Fair, you can resolve this.

  7. promag commented at 7:32 PM on February 6, 2019: member

    Concept ACK.

  8. DrahtBot commented at 8:45 PM on February 6, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #15307 ([WIP] [tool] Add salvage and zaptxs commands to bitcoin-wallet by jnewbery)
    • #13716 (bitcoin-cli: -stdinwalletpassphrase and non-echo stdin passwords by kallewoof)

    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.

  9. in src/util/system.h:299 in a99999cc04
     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);
    


    promag commented at 3:31 PM on February 7, 2019:

    nit, how about this as a member, like ArgsManager::SetupHelpOptions?


    MarcoFalke commented at 3:45 PM on February 7, 2019:

    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.


    laanwj commented at 2:08 PM on February 12, 2019:

    Agree with @MarcoFalke here. It is not the responsibility of ArgsManager to know about or hardcode specific options.

  10. practicalswift commented at 9:48 PM on February 7, 2019: contributor

    Concept ACK

  11. laanwj commented at 2:25 PM on February 12, 2019: member

    utACK a99999cc04c2e7d79bb841fd954c84e985ed3b88

  12. laanwj merged this on Feb 12, 2019
  13. laanwj closed this on Feb 12, 2019

  14. laanwj referenced this in commit 65435701ef on Feb 12, 2019
  15. MarcoFalke deleted the branch on Feb 12, 2019
  16. jasonbcox referenced this in commit 99b8f5ba2c on Oct 21, 2020
  17. Munkybooty referenced this in commit 21b7d913f3 on Aug 27, 2021
  18. Munkybooty referenced this in commit d66863e155 on Aug 28, 2021
  19. Munkybooty referenced this in commit 23d974a7ca on Aug 29, 2021
  20. Munkybooty referenced this in commit d347269e1f on Sep 1, 2021
  21. vijaydasmp referenced this in commit 9aa34c2cb5 on Sep 12, 2021
  22. vijaydasmp referenced this in commit 2a54c52a61 on Sep 12, 2021
  23. vijaydasmp referenced this in commit d571a13d74 on Sep 13, 2021
  24. vijaydasmp referenced this in commit dfd0b00e9c on Sep 13, 2021
  25. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me