Skip to content

Commit be30abf

Browse files
Merge pull request #10870 from rabbitmq/rabbitmq-server-10865
rabbitmq-plugins list: respect --silent and --quiet
2 parents 6531bb4 + c0187ec commit be30abf

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

deps/rabbitmq_cli/lib/rabbitmq/cli/plugins/commands/list_command.ex

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
defmodule RabbitMQ.CLI.Plugins.Commands.ListCommand do
88
import RabbitCommon.Records
99

10-
alias RabbitMQ.CLI.Core.{DocGuide, Validators}
10+
alias RabbitMQ.CLI.Core.{Config, DocGuide, Validators}
1111
alias RabbitMQ.CLI.Plugins.Helpers, as: PluginHelpers
1212
import RabbitMQ.CLI.Core.{CodePath, Paths}
1313

@@ -61,8 +61,14 @@ defmodule RabbitMQ.CLI.Plugins.Commands.ListCommand do
6161
:ok
6262

6363
false ->
64-
names = Enum.join(Enum.to_list(missing), ", ")
65-
IO.puts("WARNING - plugins currently enabled but missing: #{names}\n")
64+
case Config.output_less?(opts) do
65+
false ->
66+
names = Enum.join(Enum.to_list(missing), ", ")
67+
IO.puts("WARNING - plugins currently enabled but missing: #{names}\n")
68+
69+
true ->
70+
:ok
71+
end
6672
end
6773

6874
implicit = :rabbit_plugins.dependencies(false, enabled, all)
@@ -172,8 +178,8 @@ defmodule RabbitMQ.CLI.Plugins.Commands.ListCommand do
172178

173179
%{
174180
name: name,
175-
version: version,
176-
running_version: running[name],
181+
version: to_string(version),
182+
running_version: to_string(running[name]),
177183
enabled: enabled_mode,
178184
running: Keyword.has_key?(running, name)
179185
}

deps/rabbitmq_cli/test/plugins/list_plugins_command_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ defmodule ListPluginsCommandTest do
3838
{:ok, [enabled_plugins]} = :file.consult(plugins_file)
3939

4040
IO.puts(
41-
"plugins list tests will assume tnat #{Enum.join(enabled_plugins, ",")} is the list of enabled plugins to revert to"
41+
"plugins list tests will assume that #{Enum.join(enabled_plugins, ",")} is the list of enabled plugins to revert to"
4242
)
4343

4444
opts = %{

0 commit comments

Comments
 (0)