diff --git a/package.json b/package.json index d31e822..c98b2d7 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "weeapass", - "version": "1.0.0", + "version": "0.9.0", "description": "Weeaboo password generator", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "start": "node src/index.js" }, "repository": { "type": "git", diff --git a/src/index.js b/src/index.js index 1c1bca7..91147af 100644 --- a/src/index.js +++ b/src/index.js @@ -1,15 +1,22 @@ +#!/usr/bin/env node /** * Module dependencies. */ -var program = require('commander'); +var program = require('commander'), + makeWord = require('./makeWord'); program - .version('1.0.0') - .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') - -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); + .version('0.9.0') + .option('-r, --engrish', 'Removes "l" from alphabet, as it should be.') + .option('-w, --no-w', 'Removes "w" from alphabet.') + .option('-v, --no-v', 'Removes "v" from alphabet.') + .option('-n [number]', 'Sets amount of syllables to generate in a word, default = 6.', 6) + .parse(process.argv); + +console.log(makeWord({ + engrish: program.engrish, + noW: !program.w, + noV: !program.v +}, program.N)); + diff --git a/src/makeWord.js b/src/makeWord.js index 86f877c..da6353f 100644 --- a/src/makeWord.js +++ b/src/makeWord.js @@ -10,7 +10,6 @@ var _ = require('lodash'), ], consonants = { 'b': 100, - 'c': 75, 'd': 100, 'f': 50, 'g': 100, @@ -24,7 +23,7 @@ var _ = require('lodash'), 'q': 0, 'r': 50, 's': 100, - 't': 0, + 't': 75, 'v': 25, 'w': 'v', 'x': 0, @@ -34,6 +33,12 @@ var _ = require('lodash'), youonConsonants = ['k', 's', 'c'], generateFunctions = { 'syllable': function(vowel, consonant) { + if (vowel === 'i' && consonant === 's') { + consonant = 'sh'; + } + if (vowel === 'i' && consonant === 't') { + consonant = 'ch'; + } return consonant + vowel; }, 'youon': function(vowel) { @@ -59,17 +64,6 @@ var _ = require('lodash'), }; }); - // make c2sh and c2t cross-compatible? - if (options.s2sh) { - consonants.sh = consonants.s; - consonants.ch = consonants.c; - delete consonants.s; - delete consonants.c; - } - if (options.c2t) { - consonants.t = consonants.c; - delete consonants.c; - } options.engrish && delete consonants.l; options.noW && delete consonants.w; options.noV && delete consonants.v; diff --git a/weeapass b/weeapass new file mode 100755 index 0000000..88553c1 --- /dev/null +++ b/weeapass @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +if [ ! -d "node_modules" ]; then + npm install +fi +node src/index.js $* \ No newline at end of file