optional note + examples

This commit is contained in:
Ivan Socolsky 2015-02-19 23:44:41 -03:00
parent ea24403e6a
commit f439c5095f
1 changed files with 15 additions and 5 deletions

View File

@ -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] <address> <amount> <message>')
.parse(process.argv);
.usage('[options] <address> <amount> [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:',