From 79fe28d62e5a7ccaf529a30d854d5c7319c2d19e Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 14 Dec 2018 08:53:49 -0500 Subject: [PATCH] more review comments - remove useless comment - change use to usage - better log --- src/lib/core/plugin.js | 4 ++-- src/lib/modules/console/index.ts | 9 ++++----- src/lib/modules/ens/index.js | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/lib/core/plugin.js b/src/lib/core/plugin.js index b05e0becc..f1c034218 100644 --- a/src/lib/core/plugin.js +++ b/src/lib/core/plugin.js @@ -162,8 +162,8 @@ Plugin.prototype.addContractFile = function(file) { Plugin.prototype.registerConsoleCommand = function(optionsOrCb) { if (typeof optionsOrCb === 'function') { - this.logger.warn(__('Registering console commands with a function is deprecated')); - // TODO add docs on how to register + this.logger.warn(__('Registering console commands with function syntax is deprecated and will likely be removed in future versions of Embark.')); + // TODO add docs on how to register when they are written } this.console.push(optionsOrCb); this.addPluginType('console'); diff --git a/src/lib/modules/console/index.ts b/src/lib/modules/console/index.ts index 0569fd6a5..f944eae01 100644 --- a/src/lib/modules/console/index.ts +++ b/src/lib/modules/console/index.ts @@ -13,7 +13,7 @@ type MatchFunction = (cmd: string) => boolean; interface HelpDescription { matches: string[] | MatchFunction; description: string; - use?: string; + usage?: string; } class Console { @@ -107,7 +107,7 @@ class Console { if (typeof helpDescription.matches === "object") { matches = helpDescription.matches as string[]; } - helpText.push(`${(helpDescription.use || matches.join("/")).cyan} - ${helpDescription.description}`); + helpText.push(`${(helpDescription.usage || matches.join("/")).cyan} - ${helpDescription.description}`); }); // Add end commands helpText.push("quit".cyan + " - " + __("to immediatly exit (alias: exit)"), @@ -128,12 +128,11 @@ class Console { const plugins = this.plugins.getPluginsProperty("console", "console"); const helpDescriptions = []; for (const plugin of plugins) { - // New API if (plugin.description) { helpDescriptions.push({ description: plugin.description, matches: plugin.matches, - use: plugin.use, + usage: plugin.usage, }); } if (plugin.matches) { @@ -225,7 +224,7 @@ class Console { const [_cmdName, length] = cmd.split(" "); this.getHistory(length, callback); }, - use: "history ", + usage: "history ", }); } diff --git a/src/lib/modules/ens/index.js b/src/lib/modules/ens/index.js index 354039bc8..7b1f123da 100644 --- a/src/lib/modules/ens/index.js +++ b/src/lib/modules/ens/index.js @@ -90,7 +90,7 @@ class ENS { registerConsoleCommands() { this.embark.registerConsoleCommand({ - use: 'resolve ', + usage: 'resolve ', description: __('Resolves an ENS name'), matches: (cmd) => { let [cmdName] = cmd.split(' '); @@ -103,7 +103,7 @@ class ENS { }); this.embark.registerConsoleCommand({ - use: 'lookup
', + usage: 'lookup
', description: __('Lookup an ENS address'), matches: (cmd) => { let [cmdName] = cmd.split(' '); @@ -117,7 +117,7 @@ class ENS { this.embark.registerConsoleCommand({ - use: 'registerSubDomain ', + usage: 'registerSubDomain ', description: __('Register an ENS sub-domain'), matches: (cmd) => { let [cmdName] = cmd.split(' ');