How to use the cli.setApp function in cli

To help you get started, we’ve selected a few cli examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Leeft / Star-Citizen-WebGL-Map / node_modules / grunt-contrib-jshint / node_modules / jshint / src / cli.js View on Github external
interpret: function (args) {
    cli.setArgv(args);
    cli.options = {};

    cli.enable("version", "glob", "help");
    cli.setApp(path.resolve(__dirname + "/../package.json"));

    var options = cli.parse(OPTIONS);
    // Use config file if specified
    var config;
    if (options.config) {
      config = exports.loadConfig(options.config);
    }

    switch (true) {
    // JSLint reporter
    case options.reporter === "jslint":
    case options["jslint-reporter"]:
      options.reporter = "./reporters/jslint_xml.js";
      break;

    // CheckStyle (XML) reporter
github perflint / perflint / lib / cli.js View on Github external
interpret(args) {
    cli.setArgv(args)
    cli.options = {}

    cli.enable('version', 'glob', 'help')
    cli.setApp(path.resolve(`${__dirname}/../package.json`))

    const opts = cli.parse(options)

    // Set env variables as option
    if (process.env.PERFLINT_KEY) opts.key = process.env.PERFLINT_KEY
    if (process.env.PERFLINT_SERVER) opts.server = process.env.PERFLINT_SERVER

    let config
    if (opts.config) {
      config = command.getConfig(opts.config)
    } else {
      config = command.getConfig()
    }

    if (!config || config === 1) return 1
    const defaults = _.merge(defaultConf, opts)
github jamesshore / object_playground / node_modules / jshint / src / cli / cli.js View on Github external
interpret: function (args) {
		cli.setArgv(args);
		cli.options = {};

		cli.enable("version", "glob", "help");
		cli.setApp(path.resolve(__dirname + "/../../package.json"));

		var options = cli.parse(OPTIONS);
		// Use config file if specified
		var config;
		if (options.config) {
			config = loadConfig(options.config);
		}

		switch (true) {
		// JSLint reporter
		case options.reporter === "jslint":
		case options["jslint-reporter"]:
			options.reporter = "../reporters/jslint_xml.js";
			break;

		// CheckStyle (XML) reporter
github andrewshawcare / thoughtworks-email-signature-generator / node_modules / grunt-contrib-jshint / node_modules / jshint / src / cli.js View on Github external
interpret: function (args) {
    cli.setArgv(args);
    cli.options = {};

    cli.enable("version", "glob", "help");
    cli.setApp(path.resolve(__dirname + "/../package.json"));

    var options = cli.parse(OPTIONS);
    // Use config file if specified
    var config;
    if (options.config) {
      config = exports.loadConfig(options.config);
    }

    switch (true) {
    // JSLint reporter
    case options.reporter === "jslint":
    case options["jslint-reporter"]:
      options.reporter = "./reporters/jslint_xml.js";
      break;

    // CheckStyle (XML) reporter
github mozilla / apk-factory-service / node_modules / grunt-contrib-jshint / node_modules / jshint / src / cli / cli.js View on Github external
interpret: function (args) {
		cli.setArgv(args);
		cli.options = {};

		cli.enable("version", "glob", "help");
		cli.setApp(path.resolve(__dirname + "/../../package.json"));

		var options = cli.parse(OPTIONS);
		// Use config file if specified
		var config;
		if (options.config) {
			config = loadConfig(options.config);
		}

		switch (true) {
		// JSLint reporter
		case options.reporter === "jslint":
		case options["jslint-reporter"]:
			options.reporter = "../reporters/jslint_xml.js";
			break;

		// CheckStyle (XML) reporter
github nfriedly / Coin-Allocator / node_modules / grunt-contrib-jshint / node_modules / jshint / src / cli.js View on Github external
interpret: function (args) {
    cli.setArgv(args);
    cli.options = {};

    cli.enable("version", "glob", "help");
    cli.setApp(path.resolve(__dirname + "/../package.json"));

    var options = cli.parse(OPTIONS);
    // Use config file if specified
    var config;
    if (options.config) {
      config = exports.loadConfig(options.config);
    }

    switch (true) {
    // JSLint reporter
    case options.reporter === "jslint":
    case options["jslint-reporter"]:
      options.reporter = "./reporters/jslint_xml.js";
      break;

    // CheckStyle (XML) reporter
github ElevenGiants / eleven-server / node_modules / jshint / src / cli.js View on Github external
interpret: function (args) {
    cli.setArgv(args);
    cli.options = {};

    cli.enable("version", "glob", "help");
    cli.setApp(path.resolve(__dirname + "/../package.json"));

    var options = cli.parse(OPTIONS);
    // Use config file if specified
    var config;
    if (options.config) {
      config = exports.loadConfig(options.config);
    }

    switch (true) {
    // JSLint reporter
    case options.reporter === "jslint":
    case options["jslint-reporter"]:
      options.reporter = "./reporters/jslint_xml.js";
      break;

    // CheckStyle (XML) reporter
github atg / choc-support / building / javascript / node [default] / node_modules / jshint / src / cli.js View on Github external
interpret: function (args) {
    cli.setArgv(args);
    cli.options = {};

    cli.enable("version", "glob", "help");
    cli.setApp(path.resolve(__dirname + "/../package.json"));

    var options = cli.parse(OPTIONS);
    // Use config file if specified
    var config;
    if (options.config) {
      config = exports.loadConfig(options.config);
    }

    switch (true) {
    // JSLint reporter
    case options.reporter === "jslint":
    case options["jslint-reporter"]:
      options.reporter = "./reporters/jslint_xml.js";
      break;

    // CheckStyle (XML) reporter
github perflint / budgie / lib / cli.js View on Github external
interpret: function(args) {
        debug('Beep bop beep .. starting up..')
        cli.setArgv(args)
        cli.options = {}

        cli.enable('version', 'glob', 'help')
        cli.setApp(path.resolve(__dirname + '/../package.json'))

        var opts = cli.parse(options)

        command.run(opts)
      },
github MM56 / mm-packer / bin / mm-packer.js View on Github external
#!/usr/bin/env node

const cli = require('cli');
const pkg = require('../package.json');
const packer = require("../index.js");

cli.setApp(pkg.name, pkg.version);
cli.enable("version", "status");
cli.setUsage("mm-packer -s files/original -o files/packed");

cli.parse({
	source:	["s", "Source directory", "file"],
	output:	["o", "Output directory", "file"],
	name:	["n", "Pack files name", "string", "pack"],
});

cli.main((args, options) => {
	if(options.source && options.output && options.name) {
		options.debug = process.argv.indexOf("--debug") > -1;
		packer(options);
	} else {
		cli.getUsage();
	}