#!/usr/bin/env node var cli = require('../lib/get-cli'); /** * Command line implementation for JSCS. * * Common usage case is: * * ./node_modules/.bin/jscs file1 dir1 file2 dir2 */ var program = require('commander'); program .version(require('../package.json').version) .usage('[options] ') .description('A code style linter for programmatically enforcing your style guide.') .option('-c, --config [path]', 'configuration file path') .option('--auto-configure [paths]', 'auto-generate a JSCS configuration file') .option('-x, --fix', 'fix code style violations (applies to fixable violations)') .option('--extract ', 'set file masks from which to extract JavaScript', function(value, memo) { return memo ? memo.concat(value) : [value]; }) .option('-e, --esnext', 'attempts to parse esnext code (currently es6)') .option('--es3', 'validates code as es3') .option('-s, --esprima ', 'attempts to use a custom version of Esprima') .option('-n, --no-colors', 'clean output without colors') .option('-p, --preset ', 'preset config') .option('-v, --verbose', 'adds rule names to the error output') .option('-m, --max-errors ', 'maximum number of errors to report') .option('-f, --error-filter ', 'a module to filter errors') .option('-r, --reporter ', 'error reporter, console - default, text, checkstyle, junit, inline, unix, summary, json') .option('', 'Also accepts relative or absolute path to custom reporter') .option('', 'For instance:') .option('', '\t ../some-dir/my-reporter.js\t(relative path with extension)') .option('', '\t ../some-dir/my-reporter\t(relative path without extension)') .option('', '\t /path/to/my-reporter.js\t(absolute path with extension)') .option('', '\t /path/to/my-reporter\t\t(absolute path without extension)') .parse(process.argv); cli(program);