From c0187ec15591b70d9916fda0d3a5b97530281427 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Wed, 27 Mar 2024 19:06:10 -0400 Subject: [PATCH] Reuse --silent and --quiet in #10865 --- .../cli/plugins/commands/list_command.ex | 16 +++++++++++----- .../test/plugins/list_plugins_command_test.exs | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/deps/rabbitmq_cli/lib/rabbitmq/cli/plugins/commands/list_command.ex b/deps/rabbitmq_cli/lib/rabbitmq/cli/plugins/commands/list_command.ex index a148bf94a73e..5b773e05c2e7 100644 --- a/deps/rabbitmq_cli/lib/rabbitmq/cli/plugins/commands/list_command.ex +++ b/deps/rabbitmq_cli/lib/rabbitmq/cli/plugins/commands/list_command.ex @@ -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} @@ -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) @@ -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) } diff --git a/deps/rabbitmq_cli/test/plugins/list_plugins_command_test.exs b/deps/rabbitmq_cli/test/plugins/list_plugins_command_test.exs index 6124b299848e..98f074c6c827 100644 --- a/deps/rabbitmq_cli/test/plugins/list_plugins_command_test.exs +++ b/deps/rabbitmq_cli/test/plugins/list_plugins_command_test.exs @@ -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 = %{