From 10091dde44d6df9a83030ee356f3e00acfdcf8b4 Mon Sep 17 00:00:00 2001 From: Matthew Zipkin Date: Thu, 21 Feb 2019 13:14:51 -0800 Subject: [PATCH] force help if no method --- bin/bcoin-cli | 7 +++++-- bin/bwallet-cli | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/bcoin-cli b/bin/bcoin-cli index de8e23a..51adc04 100755 --- a/bin/bcoin-cli +++ b/bin/bcoin-cli @@ -141,9 +141,12 @@ class CLI { } async rpc() { - const method = this.argv.shift(); + let method = this.argv.shift(); const params = []; + if (!method) + method = 'help'; + for (const arg of this.argv) { let param; try { @@ -204,7 +207,7 @@ class CLI { this.log(' $ coin [hash+index/address]: View coins.'); this.log(' $ block [hash/height]: View block.'); this.log(' $ reset [height/hash]: Reset chain to desired block.'); - this.log(' $ rpc [command] [args]: Execute RPC command.' + + this.log(' $ rpc [command] [args]: Execute RPC command.' + ' (`bcoin-cli rpc help` for more)'); break; } diff --git a/bin/bwallet-cli b/bin/bwallet-cli index 6bd5f67..47bebd5 100755 --- a/bin/bwallet-cli +++ b/bin/bwallet-cli @@ -452,9 +452,12 @@ class CLI { } async rpc() { - const method = this.argv.shift(); + let method = this.argv.shift(); const params = []; + if (!method) + method = 'help'; + for (const arg of this.argv) { let param; try {