#!/usr/bin/env node var _ = require('lodash'); var fs = require('fs'); var program = require('commander'); var utils = require('./cli-utils'); program = utils.configureCommander(program); program .option('-o, --output [filename]', 'output file') .parse(process.argv); var args = program.args; var client = utils.getClient(program); client.getTxProposals({}, function(err, txps) { utils.die(err); utils.renderTxProposals(txps); if (program.output) { fs.writeFileSync(program.output, JSON.stringify(txps)); console.log(' * Proposals Saved to: %s\n', program.output); } });