Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rabbitmq-plugins list: respect --silent and --quiet #10870

Merged
merged 1 commit into from Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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