Introduce react native CLI

Reviewed By: @frantic

Differential Revision: D2430522
This commit is contained in:
Martín Bigio 2015-09-22 09:00:04 -07:00 committed by facebook-github-bot-4
parent 9daabfa30c
commit d5d0a0cfba
1 changed files with 3 additions and 2 deletions

View File

@ -20,7 +20,8 @@
var optimist = require('optimist');
function parseCommandLine(config) {
function parseCommandLine(config, args) {
args = args || process.argv;
// 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) {
@ -38,7 +39,7 @@ function parseCommandLine(config) {
optimist.demand(config[i].command);
}
}
var argv = optimist.parse(process.argv);
var argv = optimist.parse(args);
// optimist doesn't have support for --dev=false, instead it returns 'false'
for (var i = 0; i < config.length; ++i) {