text: #!/usr/bin/env node
  
  
  'use strict';
  
  var options = {
    getCurrentRules: ['current', 'c'],
    getPluginRules: ['plugin', 'p'],
    getAllAvailableRules: ['all-available', 'a'],
    getUnusedRules: ['unused', 'u'],
    getDeprecatedRules: ['deprecated', 'd'],
    n: [],
    error: ['error'],
    core: ['core'],
    verbose: ['verbose', 'v']
  };
  var optionsThatError = ['getUnusedRules', 'getDeprecatedRules'];
  
  var argv = require('yargs').boolean(Object.keys(options)).alias(options).option('include', {
    alias: 'i',
    choices: ['deprecated'],
    type: 'string'
  }).default('error', true).default('core', true).argv;
  var getRuleURI = require('eslint-rule-documentation');
  var getRuleFinder = require('../lib/rule-finder');
  var cli = require('../lib/cli-util');
  
  var specifiedFile = argv._[0];
  var finderOptions = {
    omitCore: !argv.core,
    includeDeprecated: argv.include === 'deprecated'
  };
  var ruleFinder = getRuleFinder(specifiedFile, finderOptions);
  var errorOut = argv.error && !argv.n;
  var processExitCode = 0;
  
  if (!argv.c && !argv.p && !argv.a && !argv.u && !argv.d) {
    console.log('no option provided, please provide a valid option'); // eslint-disable-line no-console
    console.log('usage:'); // eslint-disable-line no-console
    console.log('eslint-find-rules [option] <file> [flag]'); // eslint-disable-line no-console
  } else {
    Object.keys(options).forEach(function (option) {
      var rules = void 0;
      var ruleFinderMethod = ruleFinder[option];
      if (argv[option] && ruleFinderMethod) {
        rules = ruleFinderMethod();
        if (argv.verbose) {
          cli.push('\n' + options[option][0] + ' rules\n' + rules.length + ' rules found\n');
        }
        if (rules.length > 0) {
          if (argv.verbose) {
            rules = rules.map(function (rule) {
              return [rule, getRuleURI(rule).url];
            }).reduce(function (all, single) {
              return all.concat(single);
            });
            cli.push(rules, 2, false);
          } else {
            cli.push('\n' + options[option][0] + ' rules\n');
            cli.push(rules);
          }
          if (errorOut && optionsThatError.indexOf(option) !== -1) {
            processExitCode = 1;
          }
        }
      }
    });
  
    cli.write();
  }
  process.exit(processExitCode);