#!/usr/bin/env node
var express = require('express')
var app = express()
var dafuq = require('./')

var argv = require('yargs')
	.usage('$0 Leverages command-based api')
    .describe('commands', 'the path to commands directory')
    .alias('commands', 'c')
    .alias('commands', 'path')
    .alias('commands', 'directory')
    .demand('commands')
    .describe('shebang', 'the interpreter to use when running the command files')
    .default('shebang', '')
    .describe('port', 'the port where to listen for api call')
    .alias('port', 'p')
    .default('port', 3000)
    .help('help')
    .alias('help', 'h')
    .argv;

app.use(dafuq({
	path: argv.commands,
	shebang: argv.shebang
}))
app.listen(argv.port)

@@ -13,16 +13,43 @@
 nv node%0A
+var path = require('path')%0A
 var expr
@@ -647,16 +647,153 @@
 .argv;%0A%0A
+// Resolve full path when executing via CLI%0Aif (require.main === module)%0A    argv.commands = path.resolve(process.pwd(), argv.commands)%0A%0A
 app.use(

Resolve path names relatives to cwd when using via CLI