lib/cli/index.js
var commander = require('commander'); var disqus = new commander.Command('disqus'); var pkg = require('../../package.json'); disqus .version(pkg.version);
Applications

API | CLI

disqus .command('applications <cmd> [options]') .description('Execute command for the Applications resource.');
Blacklists

API | CLI

disqus .command('blacklists <cmd> [options]') .description('Execute command for the Blacklists resource.');
Category

API | CLI

disqus .command('category <cmd> [options]') .description('Execute command for the Category resource.');
Exports

API | CLI

disqus .command('exports <cmd> [options]') .description('Execute command for the Exports resource.');
Forums

API | CLI

disqus .command('forums <cmd> [options]') .description('Execute command for the Forums resource.');
Imports

API | CLI | Disqus

disqus .command('imports <cmd> [options]') .description('Execute command for the Imports resource.');

API | CLI

disqus .command('trends <cmd> [options]') .description('Execute command for the Trends resource.'); exports.parse = function (primaryArgs, secondaryArgs) { var primaryCommand = primaryArgs.length <= 2 ? '' : primaryArgs.pop(); switch (primaryCommand) { case 'applications': case 'blacklists': case 'category': case 'exports': case 'forums': case 'imports': case 'trends': if (!secondaryArgs.length) { primaryArgs.push('--help'); require('./' + primaryCommand).parse(primaryArgs); } else { secondaryArgs.splice(0, 0, primaryArgs[0], primaryArgs[1]); require('./' + primaryCommand).parse(secondaryArgs); } break; default: primaryArgs.push('--help'); disqus.parse(primaryArgs); } };