Tweak to parse_options

This commit is contained in:
Nicholas Dudfield
2014-05-18 17:37:54 +07:00
parent 80bdce970a
commit a1989b3931

View File

@@ -2,7 +2,7 @@ var fs = require('fs');
var Ledger = require('../src/js/ripple/ledger').Ledger;
function parse_options(from, flags) {
var argv = from.slice(2), // remove `node` and `this.js`
var argv = from.slice(),
opts = {argv:argv};
flags.forEach(function(f) {
@@ -20,7 +20,8 @@ function parse_options(from, flags) {
return opts;
}
var opts = parse_options(process.argv, ['sanity-test']);
var opts = parse_options(process.argv.slice(2), // remove `node` and `this.js`
['sanity-test']);
if (opts.argv.length < 1) {
console.error("Usage: scripts/verify_ledger_json path/to/ledger.json");
@@ -34,7 +35,6 @@ var ledger = Ledger.from_json(JSON.parse(json));
// This will serialize each accountState object to binary and then back to json
// before finally serializing for hashing. This is mostly to expose any issues
// with ripple-libs binary <--> json codecs.
if (opts.sanity_test) {
console.log("All accountState nodes will be processed from " +
"json->binary->json->binary. This may take some time " +