🤔 w0xlt reviewed a pull request: "argsman, cli: GNU-style command-line option parsing (allows options after non-option arguments)"
(https://github.com/bitcoin/bitcoin/pull/33540#pullrequestreview-3490254189)
This command works on master but not in this PR:
`./build/bin/bitcoin-cli --datadir=/tmp/btc1 --signet getblockhash 1000`
Could it be related to GetCommandArgs()?
(https://github.com/bitcoin/bitcoin/pull/33540#pullrequestreview-3490254189)
This command works on master but not in this PR:
`./build/bin/bitcoin-cli --datadir=/tmp/btc1 --signet getblockhash 1000`
Could it be related to GetCommandArgs()?
🤔 w0xlt reviewed a pull request: "argsman, cli: GNU-style command-line option parsing (allows options after non-option arguments)"
(https://github.com/bitcoin/bitcoin/pull/33540#pullrequestreview-3490620415)
Restructuring `ProcessOptionKey` as below seems to solve the problem of `./build/bin/bitcoin-cli --datadir=/tmp/btc1 --signet getblockhash 1000`.
```cpp
bool ArgsManager::ProcessOptionKey(std::string& key, std::optional<std::string>& val, std::string& error, const bool found_after_non_option) {
bool double_dash{false};
const std::optional<std::string> original_val{val};
std::string original_input{key};
if (val) original_input += "=" + *val;
// Normalize leading das
...
(https://github.com/bitcoin/bitcoin/pull/33540#pullrequestreview-3490620415)
Restructuring `ProcessOptionKey` as below seems to solve the problem of `./build/bin/bitcoin-cli --datadir=/tmp/btc1 --signet getblockhash 1000`.
```cpp
bool ArgsManager::ProcessOptionKey(std::string& key, std::optional<std::string>& val, std::string& error, const bool found_after_non_option) {
bool double_dash{false};
const std::optional<std::string> original_val{val};
std::string original_input{key};
if (val) original_input += "=" + *val;
// Normalize leading das
...