diff options
| author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-09-26 18:08:15 +0100 |
|---|---|---|
| committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-09-26 18:08:15 +0100 |
| commit | dc28dac13550b9ffc6a183d4499b57d4094f44fe (patch) | |
| tree | 9febfc378277261bfb66ba27451d1d19ac155841 /src | |
| parent | aa2bb652f239b32db15a5a8ff30f458d38bd4ccc (diff) | |
| download | rabbitmq-server-git-dc28dac13550b9ffc6a183d4499b57d4094f44fe.tar.gz | |
make enable/disable with no arguments an error
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_plugins.erl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl index 809c4e01f9..0bd055d8d7 100644 --- a/src/rabbit_plugins.erl +++ b/src/rabbit_plugins.erl @@ -83,6 +83,10 @@ action(list, [Pat], Opts) -> format_plugins(Pat, Opts); action(enable, ToEnable0, _Opts) -> + case ToEnable0 of + [] -> throw("Not enough arguments for 'enable'"); + _ -> ok + end, AllPlugins = find_plugins(), Enabled = read_enabled_plugins(), EnabledPlugins = lookup_plugins(Enabled, AllPlugins), @@ -108,6 +112,10 @@ action(enable, ToEnable0, _Opts) -> end; action(disable, ToDisable0, _Opts) -> + case ToDisable0 of + [] -> throw("Not enough arguments for 'disable'"); + _ -> ok + end, ToDisable = [list_to_atom(Name) || Name <- ToDisable0], Enabled = read_enabled_plugins(), AllPlugins = find_plugins(), |
