aboutsummaryrefslogtreecommitdiffstats
path: root/bin/etatsbasen.js
diff options
context:
space:
mode:
Diffstat (limited to 'bin/etatsbasen.js')
-rwxr-xr-xbin/etatsbasen.js17
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();
}