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
|
## 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
|
```bash
|
||||||
$ wordpos get The angry bear chased the frightened little squirrel
|
$ wordpos get The angry bear chased the frightened little squirrel
|
||||||
|
|
|
@ -15,11 +15,14 @@
|
||||||
|
|
||||||
var program = require('commander'),
|
var program = require('commander'),
|
||||||
_ = require('underscore')._,
|
_ = require('underscore')._,
|
||||||
|
fs = require('fs'),
|
||||||
POS = {noun:'Noun', adj:'Adjective', verb:'Verb', adv:'Adverb'},
|
POS = {noun:'Noun', adj:'Adjective', verb:'Verb', adv:'Adverb'},
|
||||||
nWords;
|
version = JSON.parse(fs.readFileSync('../package.json', 'utf8')).version
|
||||||
|
nWords,
|
||||||
|
;
|
||||||
|
|
||||||
program
|
program
|
||||||
.version('0.1.0')
|
.version(version)
|
||||||
.usage('[options] <command> [word ... | -i <file> | <stdin>]')
|
.usage('[options] <command> [word ... | -i <file> | <stdin>]')
|
||||||
|
|
||||||
.option('-n, --noun', 'Get nouns')
|
.option('-n, --noun', 'Get nouns')
|
||||||
|
@ -52,7 +55,6 @@ program.command('parse')
|
||||||
|
|
||||||
var
|
var
|
||||||
WordPos = require('../src/wordpos'),
|
WordPos = require('../src/wordpos'),
|
||||||
fs = require('fs'),
|
|
||||||
util = require('util'),
|
util = require('util'),
|
||||||
results = {},
|
results = {},
|
||||||
cmd = null;
|
cmd = null;
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"natural": "latest",
|
"natural": "latest",
|
||||||
"underscore": ">=1.3.1",
|
"underscore": ">=1.3.1",
|
||||||
"WNdb": "latest"
|
"WNdb": "latest",
|
||||||
|
"commander": "latest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"uubench": "git://github.com/moos/uubench.git"
|
"uubench": "git://github.com/moos/uubench.git"
|
||||||
|
|
Loading…
Reference in New Issue