[ReactNative] Cleanup _build_bundle script

This commit is contained in:
Alex Kotliarskyi 2015-05-20 10:29:56 -07:00
parent 05b6cdf97a
commit 74e7e70e76
1 changed files with 11 additions and 2 deletions

View File

@ -24,12 +24,21 @@ function parseCommandLine(config) {
// optimist default API requires you to write the command name three time
// This is a small wrapper to accept an object instead
for (var i = 0; i < config.length; ++i) {
if (config[i].type === 'string') {
optimist.string(config[i].command);
} else {
optimist.boolean(config[i].command);
}
optimist
.boolean(config[i].command)
.default(config[i].command, config[i].default)
.describe(config[i].command, config[i].description);
if (config[i].required) {
optimist.demand(config[i].command);
}
}
var argv = optimist.argv;
var argv = optimist.parse(process.argv);
// optimist doesn't have support for --dev=false, instead it returns 'false'
for (var i = 0; i < config.length; ++i) {