bitcoin-cli help detail to show full help for all RPCs #29163

pull LarryRuane wants to merge 1 commits into bitcoin:master from LarryRuane:2024-01-help-detailed changing 5 files +95 −4
  1. LarryRuane commented at 11:58 PM on January 1, 2024: contributor

    Prints to stdout a concatenation of full help text as if you had run bitcoin-cli help on every RPC. This allows you to search help text when you can't remember the name of an RPC.

    For example, suppose you remember there is an RPC that shows you orphaned chain branches but can't remember its name. This PR allows you to run:

    bitcoin-cli helpdetail | less
    

    and then search for "orphan", you'd immediately find getchaintips. It shows the category before each RPC's help text, which also helps visually separate the individual RPC helps.

  2. DrahtBot commented at 11:58 PM on January 1, 2024: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept NACK luke-jr, mccrudd3n
    Approach NACK glozow
    Stale ACK epiccurious

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

  3. LarryRuane force-pushed on Jan 2, 2024
  4. LarryRuane commented at 4:49 PM on January 2, 2024: contributor

    Force pushed to add release note (not sure if this is important enough to have a release note for, but just in case), and also updated the help help text to document the detail argument:

    $ bitcoin-cli help help
    help ( "command" )
    
    List all commands, or get help for a specified command.
    
    Arguments:
    1. command    (string, optional, default=all commands) The command to get help on, or "detail" for full help on all commands
    
    Result:
    "str"    (string) The help text
    
  5. luke-jr commented at 8:25 PM on January 4, 2024: member

    Concept NACK on the top commit: having each one in a separate file is nice.

  6. LarryRuane commented at 8:58 PM on January 4, 2024: contributor

    Concept NACK on the top commit: having each one in a separate file is nice.

    I can remove it, but may I ask why, I assume that the purpose of the test writing to the files is in case something goes wrong in the formatting of the strings (and the test fails), the files might help the developer identify the problem. (Otherwise why not just write to /dev/null, which would still test the string formatting?) When the test completes successfully, all these files are deleted anyway.

    If this PR makes the test write to one large file, isn't that going to still test all the string formatting?

  7. DrahtBot added the label CI failed on Jan 15, 2024
  8. mccrudd3n commented at 10:25 AM on January 28, 2024: none

    Concept NACK - I dont think this is needed due to the ./bitcoin-cli help to view all cmds, and ./bitcoin-cli help [cmd] to get additional information about that command

  9. LarryRuane commented at 5:15 PM on January 29, 2024: contributor

    I dont think this is needed

    I agree this is not needed, but does every change have to be "needed"? Can't it just be an improvement? This would be helpful to me personally, and by extension, I would expect to others as well.

  10. epiccurious commented at 2:45 AM on February 11, 2024: contributor

    utACK c6b68c29707770a17617d7d6af572d7460170eab.

    This would be helpful to me

    Being able to search through the descriptions of all commands would be helpful.

    This PR allows you to run: bitcoin-cli help detail

    This approach seems awkward. Is there a better UX option here? What about bitcoin-cli helpdetail?

  11. LarryRuane commented at 4:18 PM on February 12, 2024: contributor

    Is there a better UX option here? What about bitcoin-cli helpdetail?

    I agree your suggestion would be better, or maybe even bitcoin-cli -helpdetail (with a dash) because as it is now, "detail" seems like the name of an RPC. I'll look into what it would take to do either of those, thanks for the suggestion.

  12. LarryRuane force-pushed on Feb 23, 2024
  13. LarryRuane force-pushed on Feb 23, 2024
  14. luke-jr commented at 10:50 PM on February 23, 2024: member

    Concept NACK on the top commit: having each one in a separate file is nice.

    I can remove it, but may I ask why,

    It's nicer to diff the entire directories IMO.

  15. LarryRuane force-pushed on Feb 23, 2024
  16. LarryRuane commented at 11:15 PM on February 23, 2024: contributor

    @luke-jr I don't understand who would be doing a diff or why, but that's okay, I force-push-removed that commit. Probably better to minimize the patch anyway. Thanks!

  17. LarryRuane commented at 11:22 PM on February 23, 2024: contributor

    @epiccurious

    What about bitcoin-cli helpdetail?

    Force-pushed your suggestion, thanks again, I like that much better.

    Aside: I had mentioned as a possibility: bitcoin-cli -helpdetail (with the dash), but that's not as good, because bitcoin-cli help doesn't have a dash, and this should look similar. Also, dash arguments are processed by bitcoin-cli, and that's not the case here.

  18. LarryRuane force-pushed on Feb 24, 2024
  19. LarryRuane force-pushed on Feb 26, 2024
  20. LarryRuane force-pushed on Feb 26, 2024
  21. LarryRuane force-pushed on Feb 26, 2024
  22. DrahtBot removed the label CI failed on Feb 27, 2024
  23. LarryRuane commented at 3:09 PM on February 27, 2024: contributor

    Force-pushed to fix CI failures. @luke-jr can you please remove your NACK now that I've deleted the test commit you disapproved of? Thanks.

  24. bitcoin-cli helpdetail to show full help for all RPCs
    Prints to stdout a concatenation of full help text as if you had run
    help on every RPC. This allows you to search help text when you
    can't remember the name of an RPC or just want to browse.
    742ce6bda5
  25. LarryRuane force-pushed on Mar 25, 2024
  26. LarryRuane commented at 1:18 AM on March 26, 2024: contributor

    Force pushed to rebase to latest master. @luke-jr, @epiccurious, can you review? Thanks.

  27. glozow commented at 4:17 PM on March 27, 2024: member

    Prints to stdout a concatenation of full help text as if you had run bitcoin-cli help on every RPC.

    Approach NACK to adding a bunch of code to Bitcoin Core to do this. Could you consider instead running:

    bitcoin-cli help | grep -o '^\S*' | xargs -I {} bitcoin-cli help {} > rpc_help_list.txt
    
  28. LarryRuane commented at 5:33 PM on March 27, 2024: contributor

    That doesn't quite work for me, but this does (using Ubuntu, maybe it depends on the OS):

    bitcoin-cli help | grep -o '^[a-z]*' | xargs -I {} bitcoin-cli help {}
    

    This doesn't print the == category == before the help for each command, which also makes it a little difficult to see where each command begins and ends, but I guess it's not worth making this many changes, as you say.

  29. LarryRuane closed this on Mar 27, 2024

  30. bitcoin locked this on Mar 27, 2025

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-27 15:14 UTC

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