Skip to content

Commit

Permalink
Added support for CoffeeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
summatix committed Nov 27, 2010
1 parent 56b2b1d commit 75a975e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/optimist.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
module.exports = Argv;
var path = require('path');

// Hack to work when loaded with CoffeeScript
if (process.argv.length < 2 || process.argv[0] != 'node') {
process.argv = ['coffee', ''].concat(process.argv);
}

/* Hack an instance of Argv with process.argv into Argv
so people an do
require('optimist')(['--beeble=1','-z','zizzle']).argv
Expand Down

0 comments on commit 75a975e

Please sign in to comment.