Sfoglia il codice sorgente

style: make elvis happy

Zaiming (Stone) Shi 3 anni fa
parent
commit
a0a1a2b972
1 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  1. 4 3
      apps/emqx/src/emqx_ctl.erl

+ 4 - 3
apps/emqx/src/emqx_ctl.erl

@@ -111,8 +111,9 @@ run_command(help, []) ->
 run_command(Cmd, Args) when is_atom(Cmd) ->
     case lookup_command(Cmd) of
         [{Mod, Fun}] ->
-            try Mod:Fun(Args) of
-                _ -> ok
+            try
+                _ = apply(Mod, Fun, [Args]),
+                ok
             catch
                 _:Reason:Stacktrace ->
                     ?SLOG(error, #{
@@ -147,7 +148,7 @@ help() ->
             lists:foreach(
                 fun({_, {Mod, Cmd}, _}) ->
                     print("~110..-s~n", [""]),
-                    Mod:Cmd(usage)
+                    apply(Mod, Cmd, [usage])
                 end,
                 Cmds
             )