Skip to content

Commit 79d52b9

Browse files
CLI: mix format
1 parent 48ce1b5 commit 79d52b9

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ defmodule RabbitMQ.CLI.Ctl.Commands.StatusCommand do
3939
:ok
4040

4141
false ->
42-
{:validation_failure, "unit '#{unit}' is not supported. Please use one of: bytes, mb, mib, gb, gib, tb, tib"}
42+
{:validation_failure,
43+
"unit '#{unit}' is not supported. Please use one of: bytes, mb, mib, gb, gib, tb, tib"}
4344
end
4445
end
4546

@@ -212,7 +213,10 @@ defmodule RabbitMQ.CLI.Ctl.Commands.StatusCommand do
212213

213214
def usage_additional() do
214215
[
215-
["--unit <bytes | mb | mib | gb | gib>", "byte multiple (bytes, megabytes, gigabytes) to use"],
216+
[
217+
"--unit <bytes | mb | mib | gb | gib>",
218+
"byte multiple (bytes, megabytes, gigabytes) to use"
219+
],
216220
["--formatter <json | erlang>", "alternative formatter (JSON, Erlang terms)"]
217221
]
218222
end

deps/rabbitmq_cli/lib/rabbitmq/cli/information_unit.ex

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,50 +73,65 @@ defmodule RabbitMQ.CLI.InformationUnit do
7373
defp do_convert(bytes, "kb") do
7474
Float.round(bytes / @kilobyte_bytes, 4)
7575
end
76+
7677
defp do_convert(bytes, "k"), do: do_convert(bytes, "kb")
78+
7779
defp do_convert(bytes, "ki") do
7880
Float.round(bytes / @kibibyte_bytes, 4)
7981
end
82+
8083
defp do_convert(bytes, "kib"), do: do_convert(bytes, "ki")
8184
defp do_convert(bytes, "kilobytes"), do: do_convert(bytes, "kb")
8285

8386
defp do_convert(bytes, "mb") do
8487
Float.round(bytes / @megabyte_bytes, 4)
8588
end
89+
8690
defp do_convert(bytes, "m"), do: do_convert(bytes, "mb")
91+
8792
defp do_convert(bytes, "mi") do
8893
Float.round(bytes / @mebibyte_bytes, 4)
8994
end
95+
9096
defp do_convert(bytes, "mib"), do: do_convert(bytes, "mi")
9197
defp do_convert(bytes, "megabytes"), do: do_convert(bytes, "mb")
9298

9399
defp do_convert(bytes, "gb") do
94100
Float.round(bytes / @gigabyte_bytes, 4)
95101
end
102+
96103
defp do_convert(bytes, "g"), do: do_convert(bytes, "gb")
104+
97105
defp do_convert(bytes, "gi") do
98106
Float.round(bytes / @gigabyte_bytes, 4)
99107
end
108+
100109
defp do_convert(bytes, "gib"), do: do_convert(bytes, "gi")
101110
defp do_convert(bytes, "gigabytes"), do: do_convert(bytes, "gb")
102111

103112
defp do_convert(bytes, "tb") do
104113
Float.round(bytes / @terabyte_bytes, 4)
105114
end
115+
106116
defp do_convert(bytes, "t"), do: do_convert(bytes, "tb")
117+
107118
defp do_convert(bytes, "ti") do
108119
Float.round(bytes / @tebibyte_bytes, 4)
109120
end
121+
110122
defp do_convert(bytes, "tib"), do: do_convert(bytes, "ti")
111123
defp do_convert(bytes, "terabytes"), do: do_convert(bytes, "tb")
112124

113125
defp do_convert(bytes, "pb") do
114126
Float.round(bytes / @petabyte_bytes, 4)
115127
end
128+
116129
defp do_convert(bytes, "p"), do: do_convert(bytes, "pb")
130+
117131
defp do_convert(bytes, "pi") do
118132
Float.round(bytes / @pebibyte_bytes, 4)
119133
end
134+
120135
defp do_convert(bytes, "pib"), do: do_convert(bytes, "pi")
121136
defp do_convert(bytes, "petabytes"), do: do_convert(bytes, "pb")
122137
end

0 commit comments

Comments
 (0)