Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 48 lines (35 sloc) 1.155 kb
#!/usr/bin/env node
var fs = require('fs');
var optimist = require('optimist');
var colors = require('colors');
var Cakewalker = require('../lib/cakewalk.js').Cakewalker;
var basename = __filename.split('/').pop();
var argv = optimist
.wrap(76)
// Not using optimist's $0 for the commandname below because it gives
// us the entire path to this script (i.e. /usr/local/bin/cakewalk)
.usage('Usage ' + basename + ' [path]')
.describe('h', 'Show this help message and exit')
.alias('h', 'help')
.describe('v', 'Print version information and exit')
.alias('v', 'version')
.argv;
// Print help and exit
if(argv.h) {
console.log(optimist.help());
process.exit();
}
// Print version number and exit
if(argv.v) {
var packageJSON = fs.readFileSync(__dirname + '/../package.json', 'utf8');
console.log(JSON.parse(packageJSON).version);
process.exit();
}
directory = argv._[0] || '.';
console.log('*:._.:*:._.:* Cakewalk *:._.:*:._.:*'.rainbow);
new Cakewalker(directory);
process.on('SIGINT', function() {
console.log('\nExiting...');
return process.exit();
});
// vim: syntax=javascript
Jump to Line
Something went wrong with that request. Please try again.