diff options
author | utvk <utvk@users.noreply.github.com> | 2014-06-29 17:36:05 +0200 |
---|---|---|
committer | utvk <utvk@users.noreply.github.com> | 2014-06-29 17:36:05 +0200 |
commit | 392b08157dbbbf44723111d288e1ce636a8d34c0 (patch) | |
tree | 1141b0c66ad666dd0ae505ebfa44302be24c4e0b | |
parent | c5823a6596c2cf64b4c12d88eb84e2bca8a8dabe (diff) |
Only return some selected categories by default
Just to make it easier to run the export with default settings
-rwxr-xr-x | bin/etatsbasen.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/bin/etatsbasen.js b/bin/etatsbasen.js index 9241e10..9be60c6 100755 --- a/bin/etatsbasen.js +++ b/bin/etatsbasen.js @@ -7,6 +7,8 @@ var pkg = require(path.join(__dirname, '..', 'package.json')); var argv = require('minimist')(process.argv.slice(2)); var etatsbasen = require('etatsbasen'); +var defaultCategories = [12,14,17,18,27,33,38,66,68,76]; + process.bin = process.title = 'etatsbasen'; if (argv.v) { @@ -18,9 +20,11 @@ var options = {}; options.filename = argv.f || 'etatsbasen.csv'; if (argv.c && 'string' === typeof argv.c) { - options.categories = argv.c.split(','); + if ('all' !== argv.c) { + options.categories = argv.c.split(','); + } } else { - options.categories = []; + options.categories = defaultCategories; } function fileNotFound() { @@ -35,11 +39,12 @@ if (argv.h || fileNotFound()) { console.log([ 'usage: etatsbasen [options]', '', - ' -c [c1,c2,..] Categories to include', - ' -f [file] File to read from (defaults: `etatsbasen.csv`)', - ' -v Print version.', - ' -h Write this help.' + ' -c [all|[c1,c2,..]] Categories to include (defaults: `' + defaultCategories.join(',') + '`)', + ' -f [file] File to read from (defaults: `etatsbasen.csv`)', + ' -v Print version.', + ' -h Write this help.' ].join('\n')); + process.exit(); } |