From 83b948f8d624d3000be6eb619f1215bc22a70dbf Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Fri, 27 May 2016 17:55:55 -0700 Subject: [PATCH] prevent minimist from parsing an argument as an option value otherwise: `now -d /path` would fail protip cc @rase- @nkzawa --- bin/now-alias | 5 ++++- bin/now-deploy | 6 +++++- bin/now-list | 6 +++++- bin/now-remove | 6 +++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/bin/now-alias b/bin/now-alias index fbc57e7..ebf3843 100755 --- a/bin/now-alias +++ b/bin/now-alias @@ -6,7 +6,10 @@ import login from '../lib/login'; import * as cfg from '../lib/cfg'; import { error } from '../lib/error'; -const argv = minimist(process.argv.slice(2)); +const argv = minimist(process.argv.slice(2), { + // all options are booleans + boolean: true +}); const subcommand = argv._[0]; // options diff --git a/bin/now-deploy b/bin/now-deploy index 2d83a7a..d2cae6b 100755 --- a/bin/now-deploy +++ b/bin/now-deploy @@ -13,7 +13,11 @@ import Now from '../lib'; import ms from 'ms'; import { handleError, error } from '../lib/error'; -const argv = minimist(process.argv.slice(2)); +const argv = minimist(process.argv.slice(2), { + // all options are booleans + boolean: true +}); + const help = () => { console.log(` ${chalk.bold('𝚫 now')} [options] diff --git a/bin/now-list b/bin/now-list index e8186ce..d51e786 100755 --- a/bin/now-list +++ b/bin/now-list @@ -10,7 +10,11 @@ import login from '../lib/login'; import * as cfg from '../lib/cfg'; import { handleError, error } from '../lib/error'; -const argv = minimist(process.argv.slice(2)); +const argv = minimist(process.argv.slice(2), { + // all options are booleans + boolean: true +}); + const help = () => { console.log(` ${chalk.bold('𝚫 now list')} [app] diff --git a/bin/now-remove b/bin/now-remove index 3448b29..0572203 100755 --- a/bin/now-remove +++ b/bin/now-remove @@ -9,7 +9,11 @@ import login from '../lib/login'; import * as cfg from '../lib/cfg'; import { handleError, error } from '../lib/error'; -const argv = minimist(process.argv.slice(2)); +const argv = minimist(process.argv.slice(2), { + // all options are booleans + boolean: true +}); + const deploymentId = argv._[0]; // options