From 27714833906864bedd32dcf15eb7bdea3302d2fb Mon Sep 17 00:00:00 2001 From: David Glasser Date: Tue, 27 Jan 2015 18:41:49 -0800 Subject: [PATCH] Show 'admin' in top level 'meteor help' Addresses #3474. --- tools/main.js | 13 +++++-------- tools/tests/help.js | 3 ++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/main.js b/tools/main.js index 786cce5f83..653ab9726f 100644 --- a/tools/main.js +++ b/tools/main.js @@ -322,15 +322,12 @@ var longHelp = exports.longHelp = function (commandName) { _.each(node, function (n, shortName) { var fullName = commandName + (commandName.length > 0 ? " " : "") + shortName; - // For now, we don't include commands with subcommands in the - // list -- if you have a command 'admin grant' then 'admin' does - // not appear in the top-level help. If we one day want to make - // these kinds of commands visible to casual users, we'll need a - // way to mark them as visible or hidden. - // Also, use helpDict to only include commands that have help text, - // otherwise there is nothing to display - if (n instanceof Command && ! n.hidden && helpDict[fullName]) + // Use helpDict to only include commands that have help text, otherwise + // there is nothing to display. + // For now, there's no way to mark commands with subcommands (eg 'admin') + // as hidden. + if (! n.hidden && helpDict[fullName]) commandsWanted[fullName] = { name: shortName }; }); diff --git a/tools/tests/help.js b/tools/tests/help.js index 7047f34b0f..a1ee2fc36f 100644 --- a/tools/tests/help.js +++ b/tools/tests/help.js @@ -9,8 +9,9 @@ selftest.define("help", function () { run.read("Usage: meteor"); run.match("Commands:"); run.match(/create\s*Create a new project/); + run.match(/\s*admin\s/); run.expectExit(0); - run.forbidAll(/^\s*admin\s/); // no subcommands + run.forbidAll(/^\s*maintainers\s/); // no subcommands run.forbidAll(/^\s*dummy\s/); // no hidden commands };