From 78ab2af8baefd7a5aa659b4b652876ead9ce71fb Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Tue, 12 Jan 2016 10:39:29 -0400 Subject: [PATCH] Print verbose help in resin help command --- build/actions/help.js | 8 ++++++-- build/utils/messages.js | 6 ++++++ lib/actions/help.coffee | 5 ++++- lib/utils/messages.coffee | 12 ++++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 build/utils/messages.js create mode 100644 lib/utils/messages.coffee diff --git a/build/actions/help.js b/build/actions/help.js index 7a05bb10..88b2b12f 100644 --- a/build/actions/help.js +++ b/build/actions/help.js @@ -16,7 +16,7 @@ limitations under the License. */ (function() { - var _, capitano, columnify, command, general, indent, parse, print; + var _, capitano, columnify, command, general, indent, messages, parse, print; _ = require('lodash'); @@ -26,6 +26,8 @@ limitations under the License. columnify = require('columnify'); + messages = require('../utils/messages'); + parse = function(object) { return _.object(_.map(object, function(item) { var signature; @@ -55,7 +57,9 @@ limitations under the License. general = function(params, options, done) { var commands, groupedCommands; console.log('Usage: resin [COMMAND] [OPTIONS]\n'); - console.log('Primary commands:\n'); + console.log(messages.gettingStarted + "\n"); + console.log(messages.reachingOut); + console.log('\nPrimary commands:\n'); commands = _.reject(capitano.state.commands, function(command) { return command.isWildcard(); }); diff --git a/build/utils/messages.js b/build/utils/messages.js new file mode 100644 index 00000000..bf6d5736 --- /dev/null +++ b/build/utils/messages.js @@ -0,0 +1,6 @@ +(function() { + exports.gettingStarted = 'Run the following command to get a device started with Resin.io\n\n $ resin quickstart'; + + exports.reachingOut = 'If you need help, or just want to say hi, don\'t hesitate in reaching out at:\n\n GitHub: https://github.com/resin-io/resin-cli/issues/new\n Gitter: https://gitter.im/resin-io/chat'; + +}).call(this); diff --git a/lib/actions/help.coffee b/lib/actions/help.coffee index 3e629a3f..0c3f7430 100644 --- a/lib/actions/help.coffee +++ b/lib/actions/help.coffee @@ -18,6 +18,7 @@ _ = require('lodash') _.str = require('underscore.string') capitano = require('capitano') columnify = require('columnify') +messages = require('../utils/messages') parse = (object) -> return _.object _.map object, (item) -> @@ -46,7 +47,9 @@ print = (data) -> general = (params, options, done) -> console.log('Usage: resin [COMMAND] [OPTIONS]\n') - console.log('Primary commands:\n') + console.log("#{messages.gettingStarted}\n") + console.log(messages.reachingOut) + console.log('\nPrimary commands:\n') # We do not want the wildcard command # to be printed in the help screen. diff --git a/lib/utils/messages.coffee b/lib/utils/messages.coffee new file mode 100644 index 00000000..04a8bf16 --- /dev/null +++ b/lib/utils/messages.coffee @@ -0,0 +1,12 @@ +exports.gettingStarted = ''' + Run the following command to get a device started with Resin.io + + $ resin quickstart +''' + +exports.reachingOut = ''' + If you need help, or just want to say hi, don't hesitate in reaching out at: + + GitHub: https://github.com/resin-io/resin-cli/issues/new + Gitter: https://gitter.im/resin-io/chat +'''