From 7752b1aa544767b0a6238dac66442d38c84ee69c Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Mon, 23 Jul 2018 09:34:21 +0100 Subject: [PATCH] Adding Console Command --- lib/cmd.js | 27 +++++++++++++++++++++++++++ lib/index.js | 4 ++++ 2 files changed, 31 insertions(+) diff --git a/lib/cmd.js b/lib/cmd.js index a0c33099..52a59bc0 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -13,6 +13,7 @@ class Cmd { this.demo(); this.build(); this.run(); + this.console(); this.blockchain(); this.simulator(); this.test(); @@ -138,6 +139,32 @@ class Cmd { }); } + console() { + program + .command('console [environment]') + .option('-p, --port [port]', __('port to run the dev webserver (default: %s)', '8000')) + .option('-c, --client [client]', __('Use a specific ethereum client or simulator (supported: %s)', 'geth, testrpc')) + .option('--no-color', __('no colors in case it\'s needed for compatbility purposes')) + .option('--logfile [logfile]', __('filename to output logs (default: %s)', 'none')) + .option('--loglevel [loglevel]', __('level of logging to display') + ' ["error", "warn", "info", "debug", "trace"]', /^(error|warn|info|debug|trace)$/i, 'debug') + .option('--locale [locale]', __('language to use (default: en)')) + .description(__('deploy, build dapp at ') + 'dist/ (default: development)' + __(' and display the console')) + .action(function (env, options) { + i18n.setOrDetectLocale(options.locale); + embark.console({ + env: env || 'development', + serverPort: options.port, + serverHost: options.host, + client: options.client || 'geth', + locale: options.locale, + runWebserver: !options.noserver, + useDashboard: !options.nodashboard, + logFile: options.logfile, + logLevel: options.loglevel + }); + }); + } + blockchain() { program .command('blockchain [environment]') diff --git a/lib/index.js b/lib/index.js index 89ddc321..69f3ef47 100644 --- a/lib/index.js +++ b/lib/index.js @@ -234,6 +234,10 @@ class Embark { }); } + console(options) { + + } + graph(options) { this.context = options.context || [constants.contexts.graph]; options.onlyCompile = true;