adding CLI, upped version to 0.1.6

This commit is contained in:
moos 2012-05-30 16:39:31 -07:00
parent 58d95ddcca
commit 0266552d91
3 changed files with 9 additions and 5 deletions

View File

@ -219,7 +219,8 @@ See blog article [Optimizing WordPos](http://blog.42at.com/optimizing-wordpos).
## CLI
Version 0.1.6 introduces the command-line interface (./bin/wordpos-cli.js), available as 'wordpos' when using npm install.
Version 0.1.6 introduces the command-line interface (./bin/wordpos-cli.js), available as 'wordpos' if installed globally
"npm install wordpos -g", otherwise as 'node_modules/.bin/wordpos' if installed without the -g.
```bash
$ wordpos get The angry bear chased the frightened little squirrel

View File

@ -15,11 +15,14 @@
var program = require('commander'),
_ = require('underscore')._,
fs = require('fs'),
POS = {noun:'Noun', adj:'Adjective', verb:'Verb', adv:'Adverb'},
nWords;
version = JSON.parse(fs.readFileSync('../package.json', 'utf8')).version
nWords,
;
program
.version('0.1.0')
.version(version)
.usage('[options] <command> [word ... | -i <file> | <stdin>]')
.option('-n, --noun', 'Get nouns')
@ -52,7 +55,6 @@ program.command('parse')
var
WordPos = require('../src/wordpos'),
fs = require('fs'),
util = require('util'),
results = {},
cmd = null;

View File

@ -12,7 +12,8 @@
"dependencies": {
"natural": "latest",
"underscore": ">=1.3.1",
"WNdb": "latest"
"WNdb": "latest",
"commander": "latest"
},
"devDependencies": {
"uubench": "git://github.com/moos/uubench.git"