doc: replace -? with -h and -help #31118

pull l0rinc wants to merge 2 commits into bitcoin:master from l0rinc:l0rinc/bench-help changing 3 files +4 −4
  1. l0rinc commented at 4:48 pm on October 19, 2024: contributor

    The question mark is interpreted as a wildcard for any single character in Zsh (see https://www.techrepublic.com/article/globbing-wildcard-characters-with-zsh), so bench_bitcoin -? will not show the help message on systems using Zsh, such as macOS.

    Since -h provides equivalent help functionality (as defined in https://github.com/bitcoin/bitcoin/blob/master/src/common/args.cpp#L684-L693), the benchmarking.md documentation has been updated to ensure compatibility with macOS.


    -?

    % cmake -B build -DBUILD_BENCH=ON && cmake –build build && build/src/bench/bench_bitcoin -? zsh: no matches found: -?

    -h

    % cmake -B build -DBUILD_BENCH=ON && cmake –build build && build/src/bench/bench_bitcoin -h Usage: bench_bitcoin [options] Options: …


    Based on the comments the args help default was also changed to -help, mentioning -h and -? (instead of -? being the default)

  2. doc: replace `-?` with `-h` for bench_bitcoin help
    The question mark (`?`) is interpreted as a wildcard for any single character in Zsh (see https://www.techrepublic.com/article/globbing-wildcard-characters-with-zsh), so `bench_bitcoin -?` will not work on systems using Zsh, such as macOS.
    
    Since `-h` provides equivalent help functionality (as defined in https://github.com/bitcoin/bitcoin/blob/master/src/common/args.cpp#L684-L693), the `benchmarking.md` documentation has been updated to ensure compatibility with macOS.
    \
    f0130ab1a1
  3. DrahtBot commented at 4:48 pm on October 19, 2024: contributor

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

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK rkrux, laanwj, edilmedeiros, maflcko, achow101
    Concept ACK hebasto
    Stale ACK BrandonOdiwuor

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Docs on Oct 19, 2024
  5. laanwj approved
  6. laanwj commented at 7:44 am on October 20, 2024: member
    ACK f0130ab1a1e65583637b6a362b879ea3253e7bb7 Easier to remember too, -? is a kind of mingling between Windows/DOS /? and UNIX -h conventions.
  7. rkrux approved
  8. rkrux commented at 7:54 am on October 21, 2024: none

    tACK https://github.com/bitcoin/bitcoin/commit/f0130ab1a1e65583637b6a362b879ea3253e7bb7

    I compiled bench_bitcoin, and ran the help command on Mac OS. -h works, -? doesn’t.

    Wondering why is -h a hidden argument. Do you think it’s worth making it non-hidden with its own message just like -?? https://github.com/bitcoin/bitcoin/blob/master/src/common/args.cpp#L692

  9. laanwj commented at 8:21 am on October 21, 2024: member

    Wondering why is -h a hidden argument. Do you think it’s worth making it non-hidden with its own message just like -??

    There’s no reason to list both seperately. That would clutter the list. -? is the weird duck out in that it lists the short-name option as primary instead of the long one (-help). Might add the alternatives to the help message say,

    0  -help
    1       Print this help message and exit (also -h or -?)
    
  10. BrandonOdiwuor approved
  11. BrandonOdiwuor commented at 8:38 am on October 21, 2024: contributor
    ACK f0130ab1a1e65583637b6a362b879ea3253e7bb7, great catch
  12. rkrux commented at 8:51 am on October 21, 2024: none

    Wondering why is -h a hidden argument. Do you think it’s worth making it non-hidden with its own message just like -??

    There’s no reason to list both seperately. That would clutter the list. -? is the weird duck out in that it lists the short-name option as primary instead of the long one (-help). Might add the alternatives to the help message say,

    0  -help
    1       Print this help message and exit (also -h or -?)
    

    @laanwj Yes, this^ seems better.

  13. l0rinc commented at 9:04 am on October 21, 2024: contributor

    I’ve pushed the default change in a separate commit, let me know if this is what you had in mind:

    0% build/src/bench/bench_bitcoin -h
    1[...]
    2  -help
    3       Print this help message and exit (also -h or -?)
    

    edit: changed the title of the PR after this change

  14. Change default help arg to `-help` and mention `-h` and `-?` as alternatives
    % build/src/bench/bench_bitcoin -h
    [...]
      -help
           Print this help message and exit (also -h or -?)
    33a28e252a
  15. l0rinc force-pushed on Oct 21, 2024
  16. DrahtBot added the label CI failed on Oct 21, 2024
  17. DrahtBot commented at 9:09 am on October 21, 2024: contributor

    🚧 At least one of the CI tasks failed. Debug: https://github.com/bitcoin/bitcoin/runs/31815057000

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  18. rkrux approved
  19. rkrux commented at 10:23 am on October 21, 2024: none

    tACK https://github.com/bitcoin/bitcoin/commit/33a28e252a7349c0aa284005aee97873b965fcfe

    Thanks @l0rinc for addressing the change quickly. Rebuilt and checked for bitcoin-cli as well, it’s updated there too.

     0➜  bitcoin git:(l0rinc/bench-help) ✗ bitcoincli -h
     1Bitcoin Core RPC client version v28.99.0-33a28e252a73
     2
     3Usage:  bitcoin-cli [options] <command> [params]  Send command to Bitcoin Core
     4or:     bitcoin-cli [options] -named <command> [name=value]...  Send command to Bitcoin Core (with named arguments)
     5or:     bitcoin-cli [options] help                List commands
     6or:     bitcoin-cli [options] help <command>      Get help for a command
     7
     8Options:
     9
    10  -color=<when>
    11       Color setting for CLI output (default: auto). Valid values: always, auto
    12       (add color codes when standard output is connected to a terminal
    13       and OS is not WIN32), never.
    14
    15  -conf=<file>
    16       Specify configuration file. Relative paths will be prefixed by datadir
    17       location. (default: bitcoin.conf)
    18
    19  -datadir=<dir>
    20       Specify data directory
    21
    22  -help
    23       Print this help message and exit (also -h or -?)
    
  20. DrahtBot requested review from BrandonOdiwuor on Oct 21, 2024
  21. DrahtBot requested review from laanwj on Oct 21, 2024
  22. DrahtBot removed the label CI failed on Oct 21, 2024
  23. laanwj approved
  24. laanwj commented at 11:20 am on October 21, 2024: member
    Code review ACK 33a28e252a7349c0aa284005aee97873b965fcfe
  25. l0rinc renamed this:
    doc: replace `-?` with `-h` for bench_bitcoin help
    doc: replace `-?` with `-h` and `-help`
    on Oct 21, 2024
  26. hebasto commented at 1:54 pm on October 21, 2024: member
    Concept ACK.
  27. edilmedeiros commented at 6:15 pm on October 23, 2024: contributor
    Concept ACK
  28. edilmedeiros commented at 6:40 pm on October 23, 2024: contributor

    tACK 33a28e252a7349c0aa284005aee97873b965fcfe

    I would prefer everything in a single commit, but it’s OK.

  29. DrahtBot requested review from hebasto on Oct 23, 2024
  30. in doc/benchmarking.md:43 in 33a28e252a
    39@@ -40,7 +40,7 @@ The output will look similar to:
    40 Help
    41 ---------------------
    42 
    43-    build/src/bench/bench_bitcoin -?
    44+    build/src/bench/bench_bitcoin -h
    


    fanquake commented at 8:33 am on October 24, 2024:
    Maybe this will be the last time we rewrite this. Introduced as -?: b21244e0be5727f8c4e8c5de0a9aa2c597ae8ed2 Changed to --help: 05fdb97df46d0a0675b93e9791bd5d498e5e5117 Changed back to -?: d8513fe41102dcbfc05235f3b95e33eb1878f880 Now we are going back to -h: f0130ab1a1e65583637b6a362b879ea3253e7bb7.

    l0rinc commented at 8:42 am on October 24, 2024:
    I’m fine with --help as well, but -? just isn’t working on a mac
  31. maflcko commented at 8:18 pm on October 24, 2024: member
    lgtm ACK 33a28e252a7349c0aa284005aee97873b965fcfe
  32. achow101 commented at 9:59 pm on October 24, 2024: member
    ACK 33a28e252a7349c0aa284005aee97873b965fcfe
  33. achow101 merged this on Oct 24, 2024
  34. achow101 closed this on Oct 24, 2024

  35. l0rinc deleted the branch on Oct 24, 2024
  36. hebasto commented at 7:31 am on October 25, 2024: member
    Post-merge ACK 33a28e252a7349c0aa284005aee97873b965fcfe.

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: 2024-12-22 21:12 UTC

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