#!/usr/bin/env node


var argv = require('yargs'),
    read = require('fs').readFileSync,
    yaml = require('js-yaml').safeLoad,
    fish = require('./api').csv,
    display = require('./display')


argv = argv
  .usage('Usage: $0 [options] file')
  .help('help')
  .alias('c', 'config')
  .boolean('json')
  .describe('json', 'output the summary as json')
  .describe('c', 'path to config file')
  .default('c', '.fish.yaml')
  .argv;


fish(read(argv._[0]), yaml(read(argv.config)), function(err, result) {
  if (err) return console.error(err)
  if (argv.json) return console.log(JSON.stringify(result))
  display(result)
})

@@ -156,16 +156,55 @@
 ').csv,%0A
+    resolve = require('path').resolve,%0A
     disp
@@ -445,16 +445,42 @@
 ult('c',
+ resolve(process.env.HOME,
  '.fish.
@@ -485,16 +485,17 @@
 h.yaml')
+)
 %0A  .argv

use $HOME/.fish.yaml as the default config