From d954baeaac7ad596386a52cdaa02680f5632c6bb Mon Sep 17 00:00:00 2001 From: David Glasser Date: Fri, 31 Jan 2014 14:16:00 -0500 Subject: [PATCH] Support "meteor admin help". (I assume this was intended to work because it is explicitly suggested when you type "meteor admin"!) --- tools/main.js | 10 ++++++---- tools/tests/help.js | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/main.js b/tools/main.js index 0266d6e611..39e5756ed9 100644 --- a/tools/main.js +++ b/tools/main.js @@ -685,10 +685,12 @@ Fiber(function () { for (var i = 0; i < rawArgs.length; i++) { var word = rawArgs[i]; - if (word === "help" && i === 0) { - // "meteor help some command" (note that we can't support - // "meteor some command help", since "meteor deploy help" - // needs to actually deploy a site called 'help') + // Support "meteor help", "meteor help deploy", "meteor help admin", + // "meteor admin help", "meteor admin help grant", etc. (But not + // "meteor deploy help" or "meteor admin grant help": once we find an + // actual command, we assume "help" is an argument, eg a site called + // 'help'!) + if (word === "help") { showHelp = true; continue; } diff --git a/tools/tests/help.js b/tools/tests/help.js index 41eeac4cca..6ea392d7d6 100644 --- a/tools/tests/help.js +++ b/tools/tests/help.js @@ -38,6 +38,7 @@ selftest.define("help", function () { run.expectExit(0); }; checkSubcommandList(s.run("help", "admin")); + checkSubcommandList(s.run("admin", "help")); checkSubcommandList(s.run("admin", "--help")); checkSubcommandList(s.run("--help", "admin")); @@ -48,6 +49,7 @@ selftest.define("help", function () { }; checkSubcommandHelp(s.run("help", "admin", "grant")); + checkSubcommandHelp(s.run("admin", "help", "grant")); checkSubcommandHelp(s.run("admin", "grant", "--help")); checkSubcommandHelp(s.run("--help", "admin", "grant")); });