diff --git a/src/providers/sh/commands/bin/alias.js b/src/providers/sh/commands/bin/alias.js index 90bec07..bab2c78 100644 --- a/src/providers/sh/commands/bin/alias.js +++ b/src/providers/sh/commands/bin/alias.js @@ -26,7 +26,6 @@ const promptBool = require('../lib/utils/input/prompt-bool') const grayWidth = 10 const underlineWidth = 11 -// Options const help = () => { console.log(` ${chalk.bold(`${logo} now alias`)} @@ -111,11 +110,10 @@ const help = () => { } // Options -const debug = false -const apiUrl = 'https://api.zeit.co' - let argv let subcommand +let debug +let apiUrl const main = async ctx => { argv = minimist(ctx.argv.slice(2), { @@ -133,6 +131,9 @@ const main = async ctx => { argv._ = argv._.slice(1) subcommand = argv._[0] + debug = argv.debug + apiUrl = argv.apiUrl || 'https://api.zeit.co' + if (argv.help) { help() process.exit(0) diff --git a/src/providers/sh/commands/bin/list.js b/src/providers/sh/commands/bin/list.js index 4931d7a..77a6d55 100644 --- a/src/providers/sh/commands/bin/list.js +++ b/src/providers/sh/commands/bin/list.js @@ -16,8 +16,6 @@ const { handleError, error } = require('../lib/error') const logo = require('../lib/utils/output/logo') const sort = require('../lib/sort-deployments') -let argv - const help = () => { console.log(` ${chalk.bold(`${logo} now list`)} [app] @@ -47,10 +45,11 @@ const help = () => { `) } -const debug = false -const apiUrl = 'https://api.zeit.co' - +// Options let app +let argv +let debug +let apiUrl const main = async ctx => { argv = minimist(ctx.argv.slice(2), { @@ -65,6 +64,8 @@ const main = async ctx => { }) app = argv._[1] + debug = argv.debug + apiUrl = argv.apiUrl || 'https://api.zeit.co' if (argv.help) { help() diff --git a/src/providers/sh/commands/bin/scale.js b/src/providers/sh/commands/bin/scale.js index 07f2542..57d173e 100644 --- a/src/providers/sh/commands/bin/scale.js +++ b/src/providers/sh/commands/bin/scale.js @@ -20,11 +20,6 @@ const info = require('../lib/scale-info') const sort = require('../lib/sort-deployments') const success = require('../lib/utils/output/success') -let id -let scaleArg -let optionalScaleArg - -// Options const help = () => { console.log(` ${chalk.bold(`${logo} now scale`)} ls @@ -70,10 +65,13 @@ const help = () => { } // Options -const debug = false -const apiUrl = 'https://api.zeit.co' - let argv +let debug +let apiUrl + +let id +let scaleArg +let optionalScaleArg const main = async ctx => { argv = minimist(ctx.argv.slice(2), { @@ -87,6 +85,8 @@ const main = async ctx => { id = argv._[0] scaleArg = argv._[1] optionalScaleArg = argv._[2] + apiUrl = argv.url || 'https://api.zeit.co' + debug = argv.debug if (argv.help) { help()