7
7
defmodule RabbitMQ.CLI.Ctl.Commands.EnableFeatureFlagCommand do
8
8
@ behaviour RabbitMQ.CLI.CommandBehaviour
9
9
10
- def switches ( ) , do: [ force : :boolean ]
11
- def aliases ( ) , do: [ f: :force ]
10
+ def switches ( ) , do: [ experimental : :boolean ]
11
+ def aliases ( ) , do: [ f: :experimental ]
12
12
13
- def merge_defaults ( args , opts ) , do: { args , Map . merge ( % { force : false } , opts ) }
13
+ def merge_defaults ( args , opts ) , do: { args , Map . merge ( % { experimental : false } , opts ) }
14
14
15
15
def validate ( [ ] , _opts ) , do: { :validation_failure , :not_enough_args }
16
16
def validate ( [ _ | _ ] = args , _opts ) when length ( args ) > 1 , do: { :validation_failure , :too_many_args }
@@ -32,14 +32,14 @@ defmodule RabbitMQ.CLI.Ctl.Commands.EnableFeatureFlagCommand do
32
32
end
33
33
end
34
34
35
- def run ( [ feature_flag ] , % { node: node_name , force: force } ) do
36
- case { force , :rabbit_misc . rpc_call ( node_name , :rabbit_feature_flags , :get_stability , [
35
+ def run ( [ feature_flag ] , % { node: node_name , experimental: experimental } ) do
36
+ case { experimental , :rabbit_misc . rpc_call ( node_name , :rabbit_feature_flags , :get_stability , [
37
37
String . to_atom ( feature_flag )
38
38
] ) } do
39
39
{ _ , { :badrpc , { :EXIT , { :undef , _ } } } } -> { :error , :unsupported }
40
40
{ _ , { :badrpc , _ } = err } -> err
41
41
{ false , :experimental } ->
42
- IO . puts ( "Feature flag #{ feature_flag } is experimental and requires --force to enable it." )
42
+ IO . puts ( "Feature flag #{ feature_flag } is experimental. If you understand the risk, use --experimental to enable it." )
43
43
_ ->
44
44
case :rabbit_misc . rpc_call ( node_name , :rabbit_feature_flags , :enable , [
45
45
String . to_atom ( feature_flag )
@@ -60,7 +60,7 @@ defmodule RabbitMQ.CLI.Ctl.Commands.EnableFeatureFlagCommand do
60
60
61
61
use RabbitMQ.CLI.DefaultOutput
62
62
63
- def usage , do: "enable_feature_flag [--force ] <all | feature_flag>"
63
+ def usage , do: "enable_feature_flag [--experimental ] <all | feature_flag>"
64
64
65
65
def usage_additional ( ) do
66
66
[
@@ -69,7 +69,7 @@ defmodule RabbitMQ.CLI.Ctl.Commands.EnableFeatureFlagCommand do
69
69
"name of the feature flag to enable, or \" all\" to enable all supported flags"
70
70
] ,
71
71
[
72
- "--force " ,
72
+ "--experimental " ,
73
73
"required to enable experimental feature flags (make sure you understand the risks!))"
74
74
]
75
75
]
0 commit comments