Skip to content
This repository was archived by the owner on Nov 18, 2020. It is now read-only.

Commit 515841d

Browse files
CLI commands: provide more information to the new help command
1 parent 42e45d4 commit 515841d

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

include/rabbit_stomp.hrl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@
4747
ssl_key_exchange,
4848
ssl_cipher,
4949
ssl_hash]).
50+
51+
-define(STOMP_GUIDE_URL, <<"https://rabbitmq.com/stomp.html">>).

src/Elixir.RabbitMQ.CLI.Ctl.Commands.ListStompConnectionsCommand.erl

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,23 @@
1515

1616
-module('Elixir.RabbitMQ.CLI.Ctl.Commands.ListStompConnectionsCommand').
1717

18-
-behaviour('Elixir.RabbitMQ.CLI.CommandBehaviour').
1918
-include("rabbit_stomp.hrl").
2019

21-
-export([formatter/0, scopes/0, switches/0, aliases/0,
22-
usage/0, usage_additional/0, banner/2,
23-
validate/2, merge_defaults/2, run/2, output/2, description/0,
20+
-behaviour('Elixir.RabbitMQ.CLI.CommandBehaviour').
21+
22+
-export([formatter/0,
23+
scopes/0,
24+
switches/0,
25+
aliases/0,
26+
usage/0,
27+
usage_additional/0,
28+
usage_doc_guides/0,
29+
banner/2,
30+
validate/2,
31+
merge_defaults/2,
32+
run/2,
33+
output/2,
34+
description/0,
2435
help_section/0]).
2536

2637
formatter() -> 'Elixir.RabbitMQ.CLI.Formatters.Table'.
@@ -48,16 +59,21 @@ merge_defaults(Args, Opts) ->
4859
{Args, maps:merge(#{verbose => false}, Opts)}.
4960

5061
usage() ->
51-
<<"list_stomp_connections [<stomp_connectioninfoitem> ...]">>.
62+
<<"list_stomp_connections [<column> ...]">>.
5263

5364
usage_additional() ->
54-
<<"<stomp_connectioninfoitem> must be a member of the list [",
55-
('Elixir.Enum':join(?INFO_ITEMS, <<", ">>))/binary,
56-
"].">>.
65+
Prefix = <<" must be one of ">>,
66+
InfoItems = 'Elixir.Enum':join(lists:usort(?INFO_ITEMS), <<", ">>),
67+
[
68+
{<<"<column>">>, <<Prefix/binary, InfoItems/binary>>}
69+
].
70+
71+
usage_doc_guides() ->
72+
[?STOMP_GUIDE_URL].
5773

5874
run(Args, #{node := NodeName,
59-
timeout := Timeout,
60-
verbose := Verbose}) ->
75+
timeout := Timeout,
76+
verbose := Verbose}) ->
6177
InfoKeys = case Verbose of
6278
true -> ?INFO_ITEMS;
6379
false -> 'Elixir.RabbitMQ.CLI.Ctl.InfoKeys':prepare_info_keys(Args)

0 commit comments

Comments
 (0)