Last active
August 29, 2015 14:20
-
-
Save ensonic/60b8fc278da53b2dde45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated by CoffeeScript 1.9.1 | |
(function() { | |
var program; | |
program = require('commander') | |
.option('--flag1 [true/false]', 'Flag1 (default = false)', false) | |
.option('--flag2 [true/false]', 'Flag2 (default = false)', (function(val) { | |
return val === "true"; | |
}), false) | |
.parse(process.argv); | |
if (program.flag1) { | |
console.log("flag1(" + (typeof program.flag1) + ") is true"); | |
} else { | |
console.log("flag1(" + (typeof program.flag1) + ") is false"); | |
} | |
if (program.flag2) { | |
console.log("flag2(" + (typeof program.flag2) + ") is true"); | |
} else { | |
console.log("flag2(" + (typeof program.flag2) + ") is false"); | |
} | |
}).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment