1
0
Fork 0

made this shit usable

master
Henry Jameson vor 8 Jahren
Ursprung 10d53df3ca
Commit 9aaa2d706e
  1. 4
      package.json
  2. 25
      src/index.js
  3. 20
      src/makeWord.js
  4. 5
      weeapass

@ -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",

@ -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));

@ -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;

@ -0,0 +1,5 @@
#!/usr/bin/env sh
if [ ! -d "node_modules" ]; then
npm install
fi
node src/index.js $*
Laden…
Abbrechen
Speichern