Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garthdb/commander-rc-adapter
commander-rc-adapter
https://github.com/garthdb/commander-rc-adapter
Last synced: about 1 month ago
JSON representation
commander-rc-adapter
- Host: GitHub
- URL: https://github.com/garthdb/commander-rc-adapter
- Owner: GarthDB
- License: apache-2.0
- Created: 2016-10-28T07:20:44.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-29T22:14:10.000Z (about 8 years ago)
- Last Synced: 2024-11-22T23:54:42.071Z (about 1 month ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Commander.js/rc Argv Adapter
[![Build Status](https://travis-ci.org/GarthDB/commander-rc-adapter.svg)](https://travis-ci.org/GarthDB/commander-rc-adapter) [![NPM](https://nodei.co/npm/commander-rc-adapter.svg)](https://nodei.co/npm/commander-rc-adapter)
---
[rc](https://github.com/dominictarr/rc) is a super helpful way to load cli tool configurations, but it doesn't work out of the box with [Commander.js](https://github.com/tj/commander.js)'s style of arguments and flags.
This is a parser to make it easier to just plugin the args into rc.
## Usage
```js
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 ', 'add some bar');
program.parse(args);var options = rc('appname', {/* default values */}, argParser(program));
```