Page MenuHomePhabricator

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

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

Details

Reviewers
jasonbcox
deadalnix
Fabien
markblundeberg
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC9dae9ed797de: Merge #11710: cli: Reject arguments to -getinfo
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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

nakihito created this revision.Wed, Jun 5, 23:38
Owners added a reviewer: Restricted Owners Package.Wed, Jun 5, 23:38
Herald added a reviewer: Restricted Project. · View Herald TranscriptWed, Jun 5, 23:38
markblundeberg accepted this revision.Thu, Jun 6, 04:55
markblundeberg added a subscriber: markblundeberg.

works as promised

This revision is now accepted and ready to land.Thu, Jun 6, 04:55
Fabien added inline comments.Thu, Jun 6, 06:33
src/bitcoin-cli.cpp
261 ↗(On Diff #9183)

Nit: arguments => argument ?

test/functional/interface_bitcoin_cli.py
51 ↗(On Diff #9183)

Dito

markblundeberg added inline comments.Thu, Jun 6, 13:45
src/bitcoin-cli.cpp
261 ↗(On Diff #9183)

"no arguments" sounds fine to me...

test/functional/interface_bitcoin_cli.py
51 ↗(On Diff #9183)

yeah in this case it's just one argument

nakihito added inline comments.Thu, Jun 6, 17:49
src/bitcoin-cli.cpp
261 ↗(On Diff #9183)

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

test/functional/interface_bitcoin_cli.py
51 ↗(On Diff #9183)

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