How to use the args.Options function in args

To help you get started, we’ve selected a few args 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 cwramsey / twitter-contest-winner / app.js View on Github external
var colors = require('colors'),
    twitter = require('twitter'),
    print = require('pretty-print'),
    tweet_helpers = require('./helpers/tweets'),
    keywords = require('./configs/keywords'),
    args = require('args');

var options = args.Options.parse([
  {
    name: 'percent',
    shortName: 'p',
    type: 'int',
    help: 'Percentage of tweets you want to retweet & follow. Lower number will keep your app from going over the API limits.'
  }
]);

var parsed_options = args.parser(process.argv).parse(options);

if (!parsed_options.percent) {
  console.log(options.getHelp());
  process.exit();
}

if (parsed_options.percent > 100) {
github garden20 / gardener / lib / options.js View on Github external
var args = require('args'),
    cached = {},
    options = args.Options.parse([
    {
        name: 'include',
        shortName: 'i',
        help: 'Comma seperated db and design docs to include'
    },
    {
        name: 'exclude',
        shortName: 'e',
        help: 'Comma seperated db and design docs to exclude'
    },
    {
        name: 'dashboard',
        shortName: 'd',
        help: 'optional dashboard db name to follow changes.'
    },
    {