Problems with command-line options silently ignored #1044

issue laanwj opened 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:

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

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

    -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 12: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 cross-referenced this on Jan 10, 2014 from issue Bitcoin-Qt: problem in ParseParameters() when supplying Qt style by Diapolo
  7. laanwj cross-referenced this on Jan 10, 2014 from issue bitcoind should fail or at least warn when encountering an option it doesn't understand by reverie
  8. laanwj cross-referenced this on May 29, 2014 from issue Sanity-check command line parameters format by kostaz
  9. laanwj commented at 7:54 AM on June 3, 2014: member

    See the extensive discussion in #4194 on possible solutions for this.

  10. laanwj renamed this:
    Command-line options sometimes silently ignored
    Problems with command-line options silently ignored
    on Jun 3, 2014
  11. 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.
  12. MarcoFalke commented at 6:13 PM on November 24, 2015: member

    Also unknown (=deprecated) params should be detected.

    Links to #4194 (comment)

  13. MarcoFalke cross-referenced this on Jan 18, 2016 from issue Make max tip age an option instead of chainparam by laanwj
  14. 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 ).

  15. laanwj cross-referenced this on Feb 9, 2016 from issue Rename -rescan because it confuses people by gmaxwell
  16. laanwj cross-referenced this on Jun 9, 2016 from issue Improvement: Show active command line options / parameters values in GUI by ghost
  17. laanwj cross-referenced this on Mar 27, 2017 from issue Validation of Configuration Parameters by jlopp
  18. laanwj removed the label Priority Medium on Apr 25, 2017
  19. suprnurd referenced this in commit ac9ed3545b on Dec 5, 2017
  20. promag commented at 11:49 PM on December 6, 2017: member

    Similar #11819.

  21. meshcollider cross-referenced this on Dec 13, 2017 from issue Add configuration file/argument testing by meshcollider
  22. laanwj referenced this in commit cfd99ddc3c on Dec 20, 2017
  23. Sjors cross-referenced this on Mar 16, 2018 from issue Stricter validation for CLI options and syntax by unsystemizer
  24. 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

  25. virtload referenced this in commit 6ad76a91f9 on Apr 4, 2018
  26. ptschip referenced this in commit 4484895e09 on Apr 21, 2018
  27. achow101 cross-referenced this on Apr 29, 2018 from issue Throw an error for unknown args by achow101
  28. ptschip referenced this in commit 7781087aff on Apr 30, 2018
  29. MarcoFalke referenced this in commit 61fcef0f89 on May 30, 2018
  30. MarcoFalke closed this on May 30, 2018

  31. laanwj cross-referenced this on Jul 30, 2018 from issue Ignore unknown config file options; warn instead of error by sipa
  32. PastaPastaPasta referenced this in commit bdf1e71125 on Feb 13, 2020
  33. PastaPastaPasta referenced this in commit d7dec0fbfb on Feb 27, 2020
  34. PastaPastaPasta referenced this in commit 262bac5213 on Feb 27, 2020
  35. PastaPastaPasta referenced this in commit df30971371 on Feb 27, 2020
  36. lateminer referenced this in commit 9d259c93c7 on May 6, 2020
  37. akshaynexus referenced this in commit 3180832e3f on May 6, 2020
  38. ckti referenced this in commit 36fc29566d on Mar 28, 2021
  39. gades referenced this in commit 98834cbae2 on Jun 30, 2021
  40. bitcoin 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: 2026-05-20 06:56 UTC