# HG changeset patch # User HackBot # Date 1385135464 0 # Node ID 51fdb6e5b9a82efef9bf693bf1e52dbd41ad310e # Parent 790c27eac14ff8683cb15e5565627e4e3e0430c9 fetch http://pastebin.com/raw.php?i=H7Hi3TR2 diff -r 790c27eac14f -r 51fdb6e5b9a8 raw.php?i=H7Hi3TR2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/raw.php?i=H7Hi3TR2 Fri Nov 22 15:51:04 2013 +0000 @@ -0,0 +1,25 @@ +#!/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