Skip to content

Commit

Permalink
-f -> -e; drop unneeded cases; typos
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuratczyk committed Aug 19, 2024
1 parent 86446c1 commit 89b0144
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule RabbitMQ.CLI.Ctl.Commands.EnableFeatureFlagCommand do
@behaviour RabbitMQ.CLI.CommandBehaviour

def switches(), do: [experimental: :boolean]
def aliases(), do: [f: :experimental]
def aliases(), do: [e: :experimental]

def merge_defaults(args, opts), do: { args, Map.merge(%{experimental: false}, opts) }

Expand All @@ -24,9 +24,6 @@ defmodule RabbitMQ.CLI.Ctl.Commands.EnableFeatureFlagCommand do

def run(["all"], %{node: node_name}) do
case :rabbit_misc.rpc_call(node_name, :rabbit_feature_flags, :enable_all, []) do
# Server does not support feature flags, consider none are available.
# See rabbitmq/rabbitmq-cli#344 for context. MK.
{:badrpc, {:EXIT, {:undef, _}}} -> {:error, :unsupported}
{:badrpc, _} = err -> err
other -> other
end
Expand All @@ -36,17 +33,13 @@ defmodule RabbitMQ.CLI.Ctl.Commands.EnableFeatureFlagCommand do
case {experimental, :rabbit_misc.rpc_call(node_name, :rabbit_feature_flags, :get_stability, [
String.to_atom(feature_flag)
])} do
{_, {:badrpc, {:EXIT, {:undef, _}}}} -> {:error, :unsupported}
{_, {:badrpc, _} = err} -> err
{false, :experimental} ->
IO.puts("Feature flag #{feature_flag} is experimental. If you understand the risk, use --experimental to enable it.")
_ ->
case :rabbit_misc.rpc_call(node_name, :rabbit_feature_flags, :enable, [
String.to_atom(feature_flag)
]) do
# Server does not support feature flags, consider none are available.
# See rabbitmq/rabbitmq-cli#344 for context. MK.
{:badrpc, {:EXIT, {:undef, _}}} -> {:error, :unsupported}
{:badrpc, _} = err -> err
other -> other
end
Expand All @@ -70,7 +63,7 @@ defmodule RabbitMQ.CLI.Ctl.Commands.EnableFeatureFlagCommand do
],
[
"--experimental",
"required to enable experimental feature flags (make sure you understand the risks!))"
"required to enable experimental feature flags (make sure you understand the risks!)"
]
]
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<div class="hider">
<% if (feature_flags.length > 0) { %>
<p class="warning">
Feature flags listed below are experimental. They should not be enabled in a produciton deployment.
Feature flags listed below are experimental. They should not be enabled in a production deployment.
</p>
<table class="list">
<thead>
Expand Down

0 comments on commit 89b0144

Please sign in to comment.