Command line options after any non-hyphen arguments are silently ignored #741

issue john-moffett openend this issue on June 29, 2023
  1. john-moffett commented at 4:37 pm on June 29, 2023: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    For example, invoking bitcoin-qt -server=1 foo -regtest on a fresh install will run mainnet instead of the expected regtest.

    Expected behaviour

    I would expect it to do one of the following:

    1. Run regtest
    2. Warn me that my arguments contained a “command” and any subsequent options were ignored
    3. Exit with an error message

    The problem is that ArgsManager::ParseParameters interprets any non-hypen (’-’ or ‘–’) arguments as “commands”, with later arguments being assigned to that command.

    This is not an issue with bitcoind since it has additional logic to detect “loose” commands and refuses to start:

    https://github.com/bitcoin/bitcoin/blob/c6287faae4c0e705a9258a340dfcf548906f12af/src/bitcoind.cpp#L127-L132

    Steps to reproduce

    Invoke bitcoin-qt foo -regtest on a fresh install

    Relevant log output

    No response

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    master@d6ee03507f39

    Operating system and version

    MacOS Ventura 13.5

    Machine specifications

    No response

  2. john-moffett renamed this:
    Command line options after any non-dash arguments are silently ignored
    Command line options after any non-hyphen arguments are silently ignored
    on Jun 29, 2023
  3. hebasto closed this on Oct 25, 2023

  4. Julio-Rats referenced this in commit afa081a39b on Jan 26, 2024
  5. bitcoin-core locked this on Oct 24, 2024


john-moffett


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-11 12:20 UTC

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