# HG changeset patch # User HackBot # Date 1385135794 0 # Node ID a7145daf0cdf3c5ae7120aa7ea98e9614f1fdcbf # Parent 1edabb1df911d78cbfb6c780dd005bc1bf6ca527 echo "#!/usr/bin/env node" > bin/ello diff -r 1edabb1df911 -r a7145daf0cdf bin/ello --- a/bin/ello Fri Nov 22 15:51:29 2013 +0000 +++ b/bin/ello Fri Nov 22 15:56:34 2013 +0000 @@ -1,25 +1,1 @@ #!/usr/bin/env node - -(function() { - var consonant_then_o, ends_with_consonant, ends_with_e, name; - - name = process.argv[2]; - - if (!(name != null ? name.length : void 0)) { - console.log('Usage: ello '); - process.exit(); - } - - ends_with_e = /(.*)(e)$/i; - - consonant_then_o = /(.*)([bcdfghjklmnpqrstvwxz])([o0].*)/i; - - ends_with_consonant = /[bcdfghjklmnpqrstvwxz]/i; - - console.log(consonant_then_o.test(name) ? name.replace(consonant_then_o, function(match, before, consonant, rest) { - return before + consonant + 'ell' + rest; - }) : ends_with_e.test(name) ? name.replace(ends_with_e, function(match, before) { - return before + 'ello'; - }) : ends_with_consonant.test(name) ? name + 'ello' : "Hello, " + name + "!"); - -}).call(this); \ No newline at end of file