CLI commands: provide more information to the new help command
This commit is contained in:
parent
0f800ca2c9
commit
87a04e21fc
|
@ -47,3 +47,5 @@
|
|||
ssl_key_exchange,
|
||||
ssl_cipher,
|
||||
ssl_hash]).
|
||||
|
||||
-define(STOMP_GUIDE_URL, <<"https://rabbitmq.com/stomp.html">>).
|
||||
|
|
|
@ -15,12 +15,23 @@
|
|||
|
||||
-module('Elixir.RabbitMQ.CLI.Ctl.Commands.ListStompConnectionsCommand').
|
||||
|
||||
-behaviour('Elixir.RabbitMQ.CLI.CommandBehaviour').
|
||||
-include("rabbit_stomp.hrl").
|
||||
|
||||
-export([formatter/0, scopes/0, switches/0, aliases/0,
|
||||
usage/0, usage_additional/0, banner/2,
|
||||
validate/2, merge_defaults/2, run/2, output/2, description/0,
|
||||
-behaviour('Elixir.RabbitMQ.CLI.CommandBehaviour').
|
||||
|
||||
-export([formatter/0,
|
||||
scopes/0,
|
||||
switches/0,
|
||||
aliases/0,
|
||||
usage/0,
|
||||
usage_additional/0,
|
||||
usage_doc_guides/0,
|
||||
banner/2,
|
||||
validate/2,
|
||||
merge_defaults/2,
|
||||
run/2,
|
||||
output/2,
|
||||
description/0,
|
||||
help_section/0]).
|
||||
|
||||
formatter() -> 'Elixir.RabbitMQ.CLI.Formatters.Table'.
|
||||
|
@ -48,16 +59,21 @@ merge_defaults(Args, Opts) ->
|
|||
{Args, maps:merge(#{verbose => false}, Opts)}.
|
||||
|
||||
usage() ->
|
||||
<<"list_stomp_connections [<stomp_connectioninfoitem> ...]">>.
|
||||
<<"list_stomp_connections [<column> ...]">>.
|
||||
|
||||
usage_additional() ->
|
||||
<<"<stomp_connectioninfoitem> must be a member of the list [",
|
||||
('Elixir.Enum':join(?INFO_ITEMS, <<", ">>))/binary,
|
||||
"].">>.
|
||||
Prefix = <<" must be one of ">>,
|
||||
InfoItems = 'Elixir.Enum':join(lists:usort(?INFO_ITEMS), <<", ">>),
|
||||
[
|
||||
{<<"<column>">>, <<Prefix/binary, InfoItems/binary>>}
|
||||
].
|
||||
|
||||
usage_doc_guides() ->
|
||||
[?STOMP_GUIDE_URL].
|
||||
|
||||
run(Args, #{node := NodeName,
|
||||
timeout := Timeout,
|
||||
verbose := Verbose}) ->
|
||||
timeout := Timeout,
|
||||
verbose := Verbose}) ->
|
||||
InfoKeys = case Verbose of
|
||||
true -> ?INFO_ITEMS;
|
||||
false -> 'Elixir.RabbitMQ.CLI.Ctl.InfoKeys':prepare_info_keys(Args)
|
||||
|
|
Loading…
Reference in New Issue