summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-01-17 17:41:03 +0000
committerSimon MacMullen <simon@rabbitmq.com>2012-01-17 17:41:03 +0000
commit51e7b67879e04da503d101e87ab88bbfe567af77 (patch)
tree042e40f361d4682fe190cf873a7cb6f93283387b
parentaee2983d79bde3725ebdaf5e71e9f1dee4115d52 (diff)
downloadrabbitmq-server-git-51e7b67879e04da503d101e87ab88bbfe567af77.tar.gz
Same fix as c412171663cc for rabbitmq-plugins
-rw-r--r--src/rabbit_plugins.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl
index 62c004f74c..6a5f4d1b68 100644
--- a/src/rabbit_plugins.erl
+++ b/src/rabbit_plugins.erl
@@ -55,13 +55,20 @@ start() ->
CmdArgsAndOpts -> CmdArgsAndOpts
end,
Command = list_to_atom(Command0),
+ PrintInvalidCommandError =
+ fun () ->
+ print_error("invalid command '~s'",
+ [string:join([atom_to_list(Command) | Args], " ")])
+ end,
case catch action(Command, Args, Opts, PluginsFile, PluginsDir) of
ok ->
rabbit_misc:quit(0);
{'EXIT', {function_clause, [{?MODULE, action, _} | _]}} ->
- print_error("invalid command '~s'",
- [string:join([atom_to_list(Command) | Args], " ")]),
+ PrintInvalidCommandError(),
+ usage();
+ {'EXIT', {function_clause, [{?MODULE, action, _, _} | _]}} ->
+ PrintInvalidCommandError(),
usage();
{error, Reason} ->
print_error("~p", [Reason]),