diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2012-01-17 17:41:03 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2012-01-17 17:41:03 +0000 |
| commit | 51e7b67879e04da503d101e87ab88bbfe567af77 (patch) | |
| tree | 042e40f361d4682fe190cf873a7cb6f93283387b | |
| parent | aee2983d79bde3725ebdaf5e71e9f1dee4115d52 (diff) | |
| download | rabbitmq-server-git-51e7b67879e04da503d101e87ab88bbfe567af77.tar.gz | |
Same fix as c412171663cc for rabbitmq-plugins
| -rw-r--r-- | src/rabbit_plugins.erl | 11 |
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]), |
