From f439c5095f71d455961608fbbaa9476f66504cd2 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Thu, 19 Feb 2015 23:44:41 -0300 Subject: [PATCH] optional note + examples --- bit-wallet/bit-send | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/bit-wallet/bit-send b/bit-wallet/bit-send index 8dc858b..794eea5 100755 --- a/bit-wallet/bit-send +++ b/bit-wallet/bit-send @@ -9,11 +9,21 @@ program .option('-c, --config [file]', 'Wallet config filename') .option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api') .option('-v, --verbose', 'be verbose') - .usage('[options]
') - .parse(process.argv); + .usage('[options]
[note]') + .description('Create a proposal for sending bitcoins to a destination address.\n The amount can be specified in bit, btc or sat (the default).'); + +program.on('--help', function(){ + console.log(' Examples:'); + console.log(''); + console.log(' $ bit-send n2HRFgtoihgAhx1qAEXcdBMjoMvAx7AcDc 500bit'); + console.log(' $ bit-send mgWeRvUC6d1LRPKtdDbvYEpaUEmApS4XrY 0.2btc "dinner with friends"'); + console.log(''); +}); + +program.parse(process.argv); var args = program.args; -if (!args[0] || !args[1] || !args[2]) +if (!args[0] || !args[1]) program.help(); var address = args[0]; @@ -23,14 +33,14 @@ try { } catch (ex) { utils.die(ex); } -var message = args[2]; +var note = args[2]; var client = utils.getClient(program); client.sendTxProposal({ toAddress: address, amount: amount, - message: message + message: note }, function(err, x) { utils.die(err); console.log(' * Tx created: ID %s [%s] RequiredSignatures:',