adding CLI, upped version to 0.1.6
This commit is contained in:
parent
58d95ddcca
commit
0266552d91
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue