Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nadako/hxnodejs-commander
Haxe/hxnodejs externs for the commander NPM module
https://github.com/nadako/hxnodejs-commander
haxe node
Last synced: 29 days ago
JSON representation
Haxe/hxnodejs externs for the commander NPM module
- Host: GitHub
- URL: https://github.com/nadako/hxnodejs-commander
- Owner: nadako
- License: mit
- Created: 2015-11-10T17:44:32.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-07T11:08:51.000Z (almost 9 years ago)
- Last Synced: 2024-10-25T09:49:58.283Z (3 months ago)
- Topics: haxe, node
- Language: Haxe
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Haxe/hxnodejs externs for the [commander](https://www.npmjs.com/package/commander) NPM module
For `commander` version: **2.9.0**
[![Build Status](https://travis-ci.org/nadako/hxnodejs-commander.svg)](https://travis-ci.org/nadako/hxnodejs-commander)
It is really simple and usage is quite similar to the original JavaScript API:
```haxe
import js.Node.process;
import js.Node.console;
import js.npm.Commander.root as program;class Intro {
static function main() {
program
.version('0.0.1')
.option('-p, --peppers', 'Add peppers')
.option('-P, --pineapple', 'Add pineapple')
.option('-b, --bbq-sauce', 'Add bbq sauce')
.option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
.parse(process.argv);console.log('you ordered a pizza with:');
if (program.peppers) console.log(' - peppers');
if (program.pineapple) console.log(' - pineapple');
if (program.bbqSauce) console.log(' - bbq');
console.log(' - %s cheese', program.cheese);
}
}
```See more examples in the `examples` directory.