summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <michael@novemberain.com>2015-10-23 16:43:23 +0300
committerMichael Klishin <michael@novemberain.com>2015-10-23 16:43:23 +0300
commit035347c4468d0b2d5f433a8e8dd6f41c25737b2c (patch)
treeafbef34e3df6fb7d7516e45d789ffbfeb38463bc /src
parent1474424ed873b756438bc6a1a3e0fcebb8e9c958 (diff)
parent7478205d9b3b9159cf2e9aac54c6552d659d9033 (diff)
downloadrabbitmq-server-git-035347c4468d0b2d5f433a8e8dd6f41c25737b2c.tar.gz
Merge pull request #383 from lemenkov/add_cmd_help
Recognize help as a valid sub-command for rabbitmqctl and rabbitmq-plugins
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_control_main.erl8
-rw-r--r--src/rabbit_plugins_main.erl8
2 files changed, 12 insertions, 4 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl
index 59223dc19b..c988ff1a49 100644
--- a/src/rabbit_control_main.erl
+++ b/src/rabbit_control_main.erl
@@ -86,7 +86,8 @@
close_connection,
{trace_on, [?VHOST_DEF]},
{trace_off, [?VHOST_DEF]},
- set_vm_memory_high_watermark
+ set_vm_memory_high_watermark,
+ help
]).
-define(GLOBAL_QUERIES,
@@ -108,7 +109,7 @@
[stop, stop_app, start_app, wait, reset, force_reset, rotate_logs,
join_cluster, change_cluster_node_type, update_cluster_nodes,
forget_cluster_node, rename_cluster_node, cluster_status, status,
- environment, eval, force_boot]).
+ environment, eval, force_boot, help]).
-define(COMMANDS_WITH_TIMEOUT,
[list_user_permissions, list_policies, list_queues, list_exchanges,
@@ -489,6 +490,9 @@ action(eval, Node, [Expr], _Opts, _Inform) ->
{error_string, format_parse_error(E)}
end;
+action(help, _Node, _Args, _Opts, _Inform) ->
+ io:format("~s", [rabbit_ctl_usage:usage()]);
+
action(Command, Node, Args, Opts, Inform) ->
%% For backward compatibility, run commands accepting a timeout with
%% the default timeout.
diff --git a/src/rabbit_plugins_main.erl b/src/rabbit_plugins_main.erl
index a4d5490c09..4aeed4826c 100644
--- a/src/rabbit_plugins_main.erl
+++ b/src/rabbit_plugins_main.erl
@@ -27,7 +27,8 @@
{enable, [?OFFLINE_DEF, ?ONLINE_DEF]},
{disable, [?OFFLINE_DEF, ?ONLINE_DEF]},
{set, [?OFFLINE_DEF, ?ONLINE_DEF]},
- {sync, []}]).
+ {sync, []},
+ {help, []}]).
%%----------------------------------------------------------------------------
@@ -147,7 +148,10 @@ action(disable, Node, ToDisable0, Opts, State = #cli{all = All,
action_change(Opts, Node, Implicit, NewImplicit, State);
action(sync, Node, [], _Opts, State) ->
- sync(Node, true, State).
+ sync(Node, true, State);
+
+action(help, _Node, _Args, _Opts, _State) ->
+ io:format("~s", [rabbit_plugins_usage:usage()]).
%%----------------------------------------------------------------------------