diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-03-19 16:04:07 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-03-19 16:04:07 +0000 |
commit | ba7a814c8e7a2d2e4df1d3a46d593ef331a585ec (patch) | |
tree | 6c3886393633657070c0cc3bfd47a2103eb73391 | |
parent | a75d518ae4b914a4bd9ef8f23d2cec8cf3ec6477 (diff) | |
download | rabbitmq-server-ba7a814c8e7a2d2e4df1d3a46d593ef331a585ec.tar.gz |
Remove -A and -I options, they are a bit too minority-interest.
-rw-r--r-- | docs/rabbitmq-plugins.1.xml | 12 | ||||
-rw-r--r-- | src/rabbit_plugins_main.erl | 27 |
2 files changed, 5 insertions, 34 deletions
diff --git a/docs/rabbitmq-plugins.1.xml b/docs/rabbitmq-plugins.1.xml index f860e9c3..faa0bf41 100644 --- a/docs/rabbitmq-plugins.1.xml +++ b/docs/rabbitmq-plugins.1.xml @@ -69,7 +69,7 @@ <variablelist> <varlistentry> - <term><cmdsynopsis><command>list</command> <arg choice="opt">-v</arg> <arg choice="opt">-m</arg> <arg choice="opt">-E</arg> <arg choice="opt">-e</arg> <arg choice="opt">-A</arg> <arg choice="opt">-I</arg> <arg choice="opt"><replaceable>pattern</replaceable></arg></cmdsynopsis></term> + <term><cmdsynopsis><command>list</command> <arg choice="opt">-v</arg> <arg choice="opt">-m</arg> <arg choice="opt">-E</arg> <arg choice="opt">-e</arg> <arg choice="opt"><replaceable>pattern</replaceable></arg></cmdsynopsis></term> <listitem> <variablelist> <varlistentry> @@ -91,16 +91,6 @@ enabled plugins.</para></listitem> </varlistentry> <varlistentry> - <term>-A</term> - <listitem><para>Show active plugins (running on the broker) that - are not explicitly or implicitly enabled.</para></listitem> - </varlistentry> - <varlistentry> - <term>-I</term> - <listitem><para>Show in-active plugins (not running on the broker) that - are explicitly or implicitly enabled.</para></listitem> - </varlistentry> - <varlistentry> <term>pattern</term> <listitem><para>Pattern to filter the plugin names by.</para></listitem> </varlistentry> diff --git a/src/rabbit_plugins_main.erl b/src/rabbit_plugins_main.erl index 96fd83da..e7475a68 100644 --- a/src/rabbit_plugins_main.erl +++ b/src/rabbit_plugins_main.erl @@ -24,24 +24,19 @@ -define(MINIMAL_OPT, "-m"). -define(ENABLED_OPT, "-E"). -define(ENABLED_ALL_OPT, "-e"). --define(ACTIVE_ONLY_OPT, "-A"). --define(INACTIVE_ONLY_OPT, "-I"). -define(NODE_DEF(Node), {?NODE_OPT, {option, Node}}). -define(VERBOSE_DEF, {?VERBOSE_OPT, flag}). -define(MINIMAL_DEF, {?MINIMAL_OPT, flag}). -define(ENABLED_DEF, {?ENABLED_OPT, flag}). -define(ENABLED_ALL_DEF, {?ENABLED_ALL_OPT, flag}). --define(ACTIVE_ONLY_DEF, {?ACTIVE_ONLY_OPT, flag}). --define(INACTIVE_ONLY_DEF, {?INACTIVE_ONLY_OPT, flag}). -define(RPC_TIMEOUT, infinity). -define(GLOBAL_DEFS(Node), [?NODE_DEF(Node)]). -define(COMMANDS, - [{list, [?VERBOSE_DEF, ?MINIMAL_DEF, ?ENABLED_DEF, - ?ENABLED_ALL_DEF, ?ACTIVE_ONLY_DEF, ?INACTIVE_ONLY_DEF]}, + [{list, [?VERBOSE_DEF, ?MINIMAL_DEF, ?ENABLED_DEF, ?ENABLED_ALL_DEF]}, enable, disable]). @@ -217,8 +212,6 @@ format_plugins(Node, Pattern, Opts, PluginsFile, PluginsDir) -> end, OnlyEnabled = proplists:get_bool(?ENABLED_OPT, Opts), OnlyEnabledAll = proplists:get_bool(?ENABLED_ALL_OPT, Opts), - OnlyActive = proplists:get_bool(?ACTIVE_ONLY_OPT, Opts), - OnlyInactive = proplists:get_bool(?INACTIVE_ONLY_OPT, Opts), AvailablePlugins = rabbit_plugins:list(PluginsDir), EnabledExplicitly = rabbit_plugins:read_enabled(PluginsFile), @@ -237,17 +230,9 @@ format_plugins(Node, Pattern, Opts, PluginsFile, PluginsDir) -> Plugins = [ Plugin || Plugin = #plugin{name = Name} <- AvailablePlugins ++ Missing, re:run(atom_to_list(Name), RE, [{capture, none}]) =:= match, - if OnlyEnabled -> lists:member(Name, EnabledExplicitly); - OnlyEnabledAll -> is_enabled(Name, EnabledExplicitly, - EnabledImplicitly); - OnlyActive -> (lists:member(Name, ActivePlugins) - andalso not - (is_enabled(Name, EnabledExplicitly, - EnabledImplicitly))); - OnlyInactive -> (is_enabled(Name, EnabledExplicitly, - EnabledImplicitly) - andalso not - lists:member(Name, ActivePlugins)); + if OnlyEnabled -> lists:member(Name, EnabledExplicitly); + OnlyEnabledAll -> lists:member(Name, EnabledExplicitly) or + lists:member(Name,EnabledImplicitly); true -> true end], Plugins1 = usort_plugins(Plugins), @@ -257,10 +242,6 @@ format_plugins(Node, Pattern, Opts, PluginsFile, PluginsDir) -> plugin_names(Missing), Format, MaxWidth) || P <- Plugins1], ok. -is_enabled(Name, EnabledExplicitly, EnabledImplicitly) -> - lists:member(Name,EnabledExplicitly) or - lists:member(Name, EnabledImplicitly). - format_plugin(#plugin{name = Name, version = Version, description = Description, dependencies = Deps}, EnabledExplicitly, EnabledImplicitly, Active, |