fix(ctl): fix formatting when printing messages without arguments

Without passing an empty argument list to `emqx_ctl:print`, formatting
instructions like `~n` are being printed literally.

```
Ignore.~nJoin the cluster successfully.~nCluster status: #{running_nodes =>
                      ['emqx@emqx-0.int.thalesmg','emqx@emqx-1.int.thalesmg',
                       'emqx@emqx-2.int.thalesmg','emqx@emqx-3.int.thalesmg',
                       'emqx@emqx-4.int.thalesmg'],
                  stopped_nodes => []}
```
This commit is contained in:
Thales Macedo Garitezi 2022-02-08 17:48:19 -03:00
parent 2605eac4b1
commit 01794c2d2c
No known key found for this signature in database
GPG Key ID: DD279F8152A9B6DD
1 changed files with 1 additions and 2 deletions

View File

@ -139,7 +139,7 @@ help() ->
-spec(print(io:format()) -> ok).
print(Msg) ->
io:format("~ts", [format(Msg)]).
io:format("~ts", [format(Msg, [])]).
-spec(print(io:format(), [term()]) -> ok).
print(Format, Args) ->
@ -243,4 +243,3 @@ zip_cmd([X | Xs], [Y | Ys]) -> [{X, Y} | zip_cmd(Xs, Ys)];
zip_cmd([X | Xs], []) -> [{X, ""} | zip_cmd(Xs, [])];
zip_cmd([], [Y | Ys]) -> [{"", Y} | zip_cmd([], Ys)];
zip_cmd([], []) -> [].