okunishinishi/node-pathtree

View on GitHub
bin/pathtree

Summary

Maintainability
Test Coverage
#!/usr/bin/env node

/**
 * Command line interface of pathtree.
 * This file is auto generated by ape-tmpl.
 */

'use strict'

const program = require('commander')
const pkg = require('../package')
const pathtree = require('../lib')

program
  .version(pkg[ 'version' ])
  .usage('[options] <dirname> ')
  .description(pkg[ 'description' ])
  .option('-I, --ignore <ignore>', 'Name to ignore.')
program.parse(process.argv)

// Run main command
pathtree.apply(pathtree, program.args.concat({
  ignore: program.ignore})
).catch(handleError)

// Handlers

/** Handle error */
function handleError (err) {
  console.error(err)
  process.exit(1)
}