Have parseCommandLine use a new instance of optimist for each run

Reviewed By: mjmahone

Differential Revision: D3156730

fb-gh-sync-id: 0a55d0c231a93a6c590bd8c4a6eb793eda66f32f
fbshipit-source-id: 0a55d0c231a93a6c590bd8c4a6eb793eda66f32f
This commit is contained in:
Sam Swarr 2016-04-08 12:08:15 -07:00 коммит произвёл Facebook Github Bot 6
Родитель 648aaf440b
Коммит 66d5529ea4
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -18,9 +18,10 @@
*/ */
'use strict'; 'use strict';
var optimist = require('optimist'); var optimistModule = require('optimist');
function parseCommandLine(config, args) { function parseCommandLine(config, args) {
var optimist = new optimistModule();
args = args || process.argv; args = args || process.argv;
// optimist default API requires you to write the command name three time // optimist default API requires you to write the command name three time
// This is a small wrapper to accept an object instead // This is a small wrapper to accept an object instead