Skip to content

Commit dc611dd

Browse files
committed
Non-zero exit code for failing to enable an experimental feature flag
With the prior behavior it can be unclear whether the text was a warning and the feature flag was enabled anyways. We can use a non-zero exit code and the `{:error, code, text}` return value to make it clear that the flag wasn't enabled.
1 parent f0c0cf8 commit dc611dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deps/rabbitmq_cli/lib/rabbitmq/cli/ctl/commands/enable_feature_flag_command.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ defmodule RabbitMQ.CLI.Ctl.Commands.EnableFeatureFlagCommand do
4040
])} do
4141
{_, {:badrpc, _} = err} -> err
4242
{false, :experimental} ->
43-
IO.puts("Feature flag #{feature_flag} is experimental. If you understand the risk, use --experimental to enable it.")
43+
{:error, RabbitMQ.CLI.Core.ExitCodes.exit_usage(), "Feature flag #{feature_flag} is experimental. If you understand the risk, use --experimental to enable it."}
4444
_ ->
4545
case :rabbit_misc.rpc_call(node_name, :rabbit_feature_flags, :enable, [
4646
String.to_atom(feature_flag)

0 commit comments

Comments
 (0)