#!/usr/bin/env node

/**
 * Module dependencies
 */
var linkshare = require('./')
  , nomnom = require('nomnom');

var opts = nomnom
  .script('linkshare-lookup')
  .nocolors()
  .option('id', {
    abbr: 'i',
    required: true,
    help: 'Linkshare api token'
  })
  .option('keywords', {
    abbr: 'k',
    required: true,
    help: 'Keywords to search'
  })
  .option('one', {
    abbr: '1',
    help: 'Limit to only one result',
    flag: true,
    default: false
  })
  .option('limit', {
    abbr: 'l',
    help: 'Limit number of results'
  })
  .option('page', {
    abbr: 'p',
    help: 'Result page',
  })
  .parse();

linkshare({keywords: opts.keywords})
  .id(opts.id)
  .limit(opts.limit)
  .one(opts.one)
  .page(opts.page)
  .done(function (err, res) {
    if (err) throw err;
    console.log(JSON.stringify(res));
  });

@@ -351,24 +351,112 @@
 earch'%0A  %7D)%0A
+  .option('advertiser', %7B%0A    abbr: 'a',%0A    help: 'Limit to a single advertiser',%0A  %7D)%0A
   .option('o
@@ -819,16 +819,47 @@
 s.page)%0A
+  .advertiser(opts.advertiser)%0A
   .done(

Add advertiser to bin