Show 'admin' in top level 'meteor help'

Addresses #3474.
This commit is contained in:
David Glasser
2015-01-27 18:41:49 -08:00
parent 5269adefb1
commit 2771483390
2 changed files with 7 additions and 9 deletions

View File

@@ -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 };
});

View File

@@ -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
};