Skip to content

Commit 8d9c117

Browse files
michaelklishinacogoluegnes
authored andcommitted
rabbitmq-stream reset_offset: respect --quiet and --silent
1 parent c50fc90 commit 8d9c117

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

deps/rabbitmq_stream/src/Elixir.RabbitMQ.CLI.Ctl.Commands.ResetOffsetCommand.erl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,14 @@ run(_,
9090
banner(_, _) ->
9191
<<"Resetting stored offset ...">>.
9292

93-
output(ok, _Opts) ->
94-
'Elixir.RabbitMQ.CLI.DefaultOutput':output({ok, <<"OK">>});
93+
output(ok, Opts) ->
94+
Silent = maps:get(quiet, Opts, maps:get(silent, Opts, false)),
95+
case Silent of
96+
true ->
97+
'Elixir.RabbitMQ.CLI.DefaultOutput':output(ok);
98+
false ->
99+
'Elixir.RabbitMQ.CLI.DefaultOutput':output({ok, <<"Done">>})
100+
end;
95101
output({validation_failure, reference_too_long}, _Opts) ->
96102
'Elixir.RabbitMQ.CLI.DefaultOutput':output({error,
97103
<<"The reference is too long">>});

0 commit comments

Comments
 (0)