bitcoin-cli help does not display help #29555

issue BebeSparkelSparkel openend this issue on March 4, 2024
  1. BebeSparkelSparkel commented at 4:22 pm on March 4, 2024: none

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    The general help command is not helpful.

    0$ bitcoin-cli help 
    1error: timeout on transient error: Could not connect to the server 127.0.0.1:8332
    2
    3Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
    

    Specific command help is not helpful.

    0$ bitcoin-cli help -addrinfo
    1error: timeout on transient error: Could not connect to the server 127.0.0.1:8332
    2
    3Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
    

    Expected behaviour

    I expect the general help to display something useful.

    I expect the help for a specific command to display helpful information about that command.

    The man page states that the help has these command input options.

    0     bitcoin-cli [options] help                List commands
    1     bitcoin-cli [options] help <command>      Get help for a command
    

    I do not expect to have to connect to the remote node to receive help. In fact, the help command should not be doing any networking.

    Steps to reproduce

    Ensure that bitcoin-cli cannot connect to a bitcoind node.

    Run bitcoin-cli help

    Relevant log output

    No response

    How did you obtain Bitcoin Core

    Package manager

    What version of Bitcoin Core are you using?

    v25.0.0

    Operating system and version

    OpenBSD 7.4

    Machine specifications

    No response

  2. araujo88 commented at 4:40 pm on March 4, 2024: contributor
    @maflcko possible good first issue?
  3. sipa commented at 4:43 pm on March 4, 2024: member
    If you want help about bitcoin-cli, use bitcoin-cli -help. Any non-- argument to bitcoin-cli is interpreted as a command to send. bitcoin-cli help sends the help command to the server.
  4. araujo88 commented at 4:49 pm on March 4, 2024: contributor

    If you want help about bitcoin-cli, use bitcoin-cli -help. Any non-- argument to bitcoin-cli is interpreted as a command to send. bitcoin-cli help sends the help command to the server.

    Shouldn’t help be handled as an exception to this rule? Some cli tools are very flexible in that regard.

  5. sipa commented at 4:51 pm on March 4, 2024: member

    Shouldn’t help be handled as an exception to this rule? Some cli tools are very flexible in that regard.

    I think that would be more confusing, actually, by muddying the distinction between local and remote operation. It’s also not clear to me how to actually do that as help is a valid server command (it gets information about the supported commands).

  6. kristapsk commented at 4:57 pm on March 4, 2024: contributor

    Shouldn’t help be handled as an exception to this rule? Some cli tools are very flexible in that regard.

    I think that would be more confusing, actually, by muddying the distinction between local and remote operation. It’s also not clear to me how to actually do that as help is a valid server command (it gets information about the supported commands).

    Also bitcoin-cli and bitcoind/bitcoin-qt could be running different versions, then bitcoin-cli help something handled by client could output wrong information regarding RPC server you are trying to connect.

  7. Sjors commented at 11:03 am on March 5, 2024: member

    Perhaps the Could not connect error could be expanded with “Use bitcoin-cli -help for more info.”

    Either always, or only if “help” was passed.

  8. maflcko commented at 8:28 am on March 12, 2024: member
    Seems fine to update the error message.
  9. maflcko added the label Docs on Mar 12, 2024
  10. fanquake closed this on Apr 2, 2024

  11. fanquake referenced this in commit c407caa297 on Apr 2, 2024

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-09-29 01:12 UTC

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