#!/usr/bin/env node

var program = require('commander'),
    hashFactory = require('./../index'),
    pkg = require('./../package.json');

program
    .version(pkg.version)
    .usage("<hash-function> <data>");

program
    .command('bitwise <data>')
    .description('Hash data to 32bit integer via bitwise')
    .action(function (data) {
        console.log(hashFactory.create('bitwise', data).hash());
    });

program
    .command('short <data>')
    .description('Convert data to short hash string')
    .action(function (data) {
        console.log(hashFactory.create('short', data).hash());
    });

program.parse(process.argv);

@@ -54,27 +54,20 @@
 '),%0A    
-h
+H
 ash
-Factory
  = requi
@@ -199,414 +199,89 @@
 a%3E%22)
-;%0A%0Aprogram%0A    .command('bitwise %3Cdata%3E')%0A    .description('Hash data to 32bit integer via bitwise')%0A    .action(function (data) %7B%0A        console.log(hashFactory.create('bitwise', data).hash());%0A    %7D);%0A%0Aprogram%0A    .command('short %3Cdata%3E')%0A    .description('Convert data to short hash string')%0A    .action(function (data) %7B%0A        console.log(hashFactory.create('short', data).hash());%0A    %7D);%0A%0A
+%0A    .parse(process.argv);%0A%0Aconsole.log(new Hash(program.args%5B0%5D).update(
 program.
 pars
@@ -276,29 +276,28 @@
 program.
-p
 ar
-se(process.argv
+gs%5B1%5D).digest()
 );%0A

Rewrite CLI