Skip to content

Commit

Permalink
Merge pull request #10870 from rabbitmq/rabbitmq-server-10865
Browse files Browse the repository at this point in the history
rabbitmq-plugins list: respect --silent and --quiet
  • Loading branch information
michaelklishin committed Mar 28, 2024
2 parents 6531bb4 + c0187ec commit be30abf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Expand Up @@ -7,7 +7,7 @@
defmodule RabbitMQ.CLI.Plugins.Commands.ListCommand do
import RabbitCommon.Records

alias RabbitMQ.CLI.Core.{DocGuide, Validators}
alias RabbitMQ.CLI.Core.{Config, DocGuide, Validators}
alias RabbitMQ.CLI.Plugins.Helpers, as: PluginHelpers
import RabbitMQ.CLI.Core.{CodePath, Paths}

Expand Down Expand Up @@ -61,8 +61,14 @@ defmodule RabbitMQ.CLI.Plugins.Commands.ListCommand do
:ok

false ->
names = Enum.join(Enum.to_list(missing), ", ")
IO.puts("WARNING - plugins currently enabled but missing: #{names}\n")
case Config.output_less?(opts) do
false ->
names = Enum.join(Enum.to_list(missing), ", ")
IO.puts("WARNING - plugins currently enabled but missing: #{names}\n")

true ->
:ok
end
end

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

%{
name: name,
version: version,
running_version: running[name],
version: to_string(version),
running_version: to_string(running[name]),
enabled: enabled_mode,
running: Keyword.has_key?(running, name)
}
Expand Down
Expand Up @@ -38,7 +38,7 @@ defmodule ListPluginsCommandTest do
{:ok, [enabled_plugins]} = :file.consult(plugins_file)

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

opts = %{
Expand Down

0 comments on commit be30abf

Please sign in to comment.