Problems with command-line options silently ignored #1044

issue laanwj openend this issue on April 5, 2012
  1. laanwj commented at 6:14 pm on April 5, 2012: member

    In this case, the rpcport argument is silently ignored:

    0-testnet -nolisten -server -connect 192.168.1.11 -rpcport=12345
    

    However, when adding a = after connect, it works, i.e.

    0-testnet -nolisten -server -connect=192.168.1.11 -rpcport=12345
    

    It could be that the first is simply wrong; in that case, it should probably show an error message.

  2. Diapolo commented at 0:43 am on April 6, 2012: none
    I didn’t look in the code, but if a case does not match the detection routine, why should there be an error? If the function searches for -connect= to do sth. it’s not said it should throw an error if it only gets -connect.
  3. laanwj commented at 5:41 am on April 6, 2012: member

    Because it frustrates the shit out of users if they pass arguments and they somehow, without any clue, don’t work.

    Edit: and yes, it is a low-priority issue, but I do want to put it here just in case.

  4. Diapolo commented at 12:48 pm on April 6, 2012: none

    I understand the intention, so you propose a standard for all parameters / switches an not only certain ones, right?

    i.e.:

    supplied “-connect IP” -> parameter incomplete supplied “-conne=” -> parameter not recognized

  5. laanwj commented at 12:53 pm on April 6, 2012: member

    Yep, something like that. I don’t think the verification has to go very deep, just some sanity check.

    my biggest gripe with the above really was that the rpcport argument is ignored, because the connect part is wrong, without any indication of either.

  6. laanwj commented at 7:54 am on June 3, 2014: member
    See the extensive discussion in #4194 on possible solutions for this.
  7. laanwj renamed this:
    Command-line options sometimes silently ignored
    Problems with command-line options silently ignored
    on Jun 3, 2014
  8. laanwj commented at 1:04 pm on November 24, 2015: member

    Other long-term improvements to option parsing would be:

    • Type-safe argument parsing. Prevent issues where arguments are assigned to signed integer types in one place and unsigned in other place. Same issue with different sizes (32 versus 64).
    • Parse arguments once, in initialization. There is no need to parse arguments from string every time they are used, which tends to happen now.
  9. MarcoFalke commented at 6:13 pm on November 24, 2015: member

    Also unknown (=deprecated) params should be detected.

    Links to #4194 (comment)

  10. jtimon commented at 11:02 am on January 19, 2016: contributor
    It would be also nice if all the glohal initializations were in init.o (obviously not for bitcoin-tx) and getArg () [which internally uses the global argsMap] wasn’t call from all over the place (and new places when we introduce new functionality but are too lazy to properly implement the new command line options or is not a priority to o things right(tm) (ie like in the case of the mempool limit ).
  11. laanwj removed the label Priority Medium on Apr 25, 2017
  12. suprnurd referenced this in commit ac9ed3545b on Dec 5, 2017
  13. promag commented at 11:49 pm on December 6, 2017: member
    Similar #11819.
  14. laanwj referenced this in commit cfd99ddc3c on Dec 20, 2017
  15. meshcollider commented at 5:46 am on March 17, 2018: contributor
    FYI I’ve been working on this for a while, hope to have a PR up soon
  16. virtload referenced this in commit 6ad76a91f9 on Apr 4, 2018
  17. ptschip referenced this in commit 4484895e09 on Apr 21, 2018
  18. ptschip referenced this in commit 7781087aff on Apr 30, 2018
  19. MarcoFalke referenced this in commit 61fcef0f89 on May 30, 2018
  20. MarcoFalke closed this on May 30, 2018

  21. PastaPastaPasta referenced this in commit bdf1e71125 on Feb 13, 2020
  22. PastaPastaPasta referenced this in commit d7dec0fbfb on Feb 27, 2020
  23. PastaPastaPasta referenced this in commit 262bac5213 on Feb 27, 2020
  24. PastaPastaPasta referenced this in commit df30971371 on Feb 27, 2020
  25. lateminer referenced this in commit 9d259c93c7 on May 6, 2020
  26. akshaynexus referenced this in commit 3180832e3f on May 6, 2020
  27. ckti referenced this in commit 36fc29566d on Mar 28, 2021
  28. gades referenced this in commit 98834cbae2 on Jun 30, 2021
  29. MarcoFalke locked this on Sep 8, 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: 2024-12-18 21:12 UTC

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