Skip to content

Commit 535a0be

Browse files
Merge pull request #7149 from rabbitmq/rin/rabbitmq_cli-dialyzer
Forward-port dialyzer related rabbitmq_cli fixes from #7122
2 parents a864cfe + 0ac62a4 commit 535a0be

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

deps/rabbitmq_cli/lib/rabbitmqctl.ex

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ defmodule RabbitMQCtl do
2424
@type options() :: map()
2525
@type command_result() :: {:error, ExitCodes.exit_code(), term()} | term()
2626

27-
@spec main(list(string())) :: no_return()
27+
@spec main(list()) :: no_return()
2828
def main(["--auto-complete" | []]) do
2929
handle_shutdown(:ok)
3030
end
@@ -50,14 +50,14 @@ defmodule RabbitMQCtl do
5050
{:ok, ExitCodes.exit_ok(), Enum.join(HelpCommand.all_usage(parsed_options), "")}
5151
end
5252

53-
def exec_command(["--version"] = _unparsed_command, opts) do
53+
def exec_command(["--version"] = _unparsed_command, output_fun) do
5454
# rewrite `--version` as `version`
55-
exec_command(["version"], opts)
55+
exec_command(["version"], output_fun)
5656
end
5757

58-
def exec_command(["--auto-complete" | args], opts) do
58+
def exec_command(["--auto-complete" | args], output_fun) do
5959
# rewrite `--auto-complete` as `autocomplete`
60-
exec_command(["autocomplete" | args], opts)
60+
exec_command(["autocomplete" | args], output_fun)
6161
end
6262

6363
def exec_command(unparsed_command, output_fun) do
@@ -237,12 +237,7 @@ defmodule RabbitMQCtl do
237237
end
238238
end
239239

240-
@spec handle_shutdown(:ok) :: no_return()
241-
defp handle_shutdown(:ok) do
242-
exit_program(0)
243-
end
244-
245-
@spec handle_shutdown({:error, integer(), nil}) :: no_return()
240+
@spec handle_shutdown({:error, integer(), nil} | atom()) :: no_return()
246241
defp handle_shutdown({:error, exit_code, nil}) do
247242
exit_program(exit_code)
248243
end

0 commit comments

Comments
 (0)