From a0e6fd733707b09ec87091910119a51cf3035832 Mon Sep 17 00:00:00 2001 From: Breezewish Date: Thu, 31 Oct 2013 22:44:01 +0800 Subject: [PATCH] add --portals option --- README.md | 12 +++--------- build/app.js | 8 ++++++-- src/app.coffee | 4 ++-- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 1a3f8aa..c48df7e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Export all portals, links, fields and system broadcasts in a specific geo-region ```bash npm install -node build/app.js +node build/app.js --portals ``` # Requirement @@ -16,16 +16,10 @@ MongoDB > 2.2 # Usage -### Continue the last task (default): - -```bash -node build/app.js ``` +--portals Request portals information -### Start a new task: - -```bash -node build/app.js --new +--new -n Start a new request ``` # Warning diff --git a/build/app.js b/build/app.js index 98d3970..7bde543 100644 --- a/build/app.js +++ b/build/app.js @@ -42,9 +42,13 @@ argv = require('optimist').argv; if (argv["new"] || argv.n) { - Tile.prepareNew(Tile.start); + if (argv.portals) { + Tile.prepareNew(Tile.start); + } } else { - Tile.prepareFromDatabase(Tile.start); + if (argv.portals) { + Tile.prepareFromDatabase(Tile.start); + } } }).call(this); diff --git a/src/app.coffee b/src/app.coffee index ee9a34f..2457991 100644 --- a/src/app.coffee +++ b/src/app.coffee @@ -34,6 +34,6 @@ require './lib/entity.js' argv = require('optimist').argv if argv.new or argv.n - Tile.prepareNew Tile.start + Tile.prepareNew Tile.start if argv.portals else - Tile.prepareFromDatabase Tile.start \ No newline at end of file + Tile.prepareFromDatabase Tile.start if argv.portals \ No newline at end of file