0.1.1 • Published 8 years ago

commander-rc-adapter v0.1.1

Weekly downloads
20
License
Apache-2.0
Repository
github
Last release
8 years ago

Commander.js/rc Argv Adapter

Build Status NPM


rc is a super helpful way to load cli tool configurations, but it doesn't work out of the box with Commander.js's style of arguments and flags.

This is a parser to make it easier to just plugin the args into rc.

Usage

var program = require('commander');
var argParser = require('commander-rc-adapter');
var rc = require('rc');

program
  .version('0.0.1')
  .option('-f, --foo-doo', 'add some foo')
  .option('-b, --bar <string>', 'add some bar');
program.parse(args);

var options = rc('appname', {/* default values */}, argParser(program));