Page MenuHomePhabricator

Merge #11710: cli: Reject arguments to -getinfo
ClosedPublic

Authored by nakihito on Jun 5 2019, 23:38.

Details

Summary

dcfef27 cli: Reject arguments to -getinfo (Wladimir J. van der Laan)

Pull request description:

Currently it's possible to accidentally type e.g.

    bitcoin-cli -getinfo getbalance

and get an answer which can be confusing; the trailing arguments are just ignored.

To avoid this, throw an error if the user provides arguments to
`-getinfo`.

Tree-SHA512: 3603e8fa852b884d1dd3b7462db40b092fe8b3390fd4384b4ee330315d797aff711e9f62990012fd4b5a55c8678734ba8497a5488a09ee6b65cf8a99017d6eb4

Backport of Core PR11710
https://github.com/bitcoin/bitcoin/pull/11710/

Please note, this is ./bitcoin-cli -getinfo, NOT the deprecated/removed RPC call.

Test Plan
make check
test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR11170
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6177
Build 10402: Bitcoin ABC Buildbot (legacy)
Build 10401: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Jun 5 2019, 23:38
This revision is now accepted and ready to land.Jun 6 2019, 04:55
src/bitcoin-cli.cpp
261

Nit: arguments => argument ?

test/functional/interface_bitcoin_cli.py
51

Dito

src/bitcoin-cli.cpp
261

"no arguments" sounds fine to me...

test/functional/interface_bitcoin_cli.py
51

yeah in this case it's just one argument

src/bitcoin-cli.cpp
261

No, the wording in this case is actually grammatically correct.

test/functional/interface_bitcoin_cli.py
51

This has to be exactly the same wording as the error code that it is catching.