Add format output for test print (#2076)

* Add formatted output for the test print
This commit is contained in:
YoukiLin 2018-12-21 15:42:42 +08:00 committed by turtleDeng
parent 10e5210581
commit e949e8cbd8
1 changed files with 6 additions and 5 deletions

View File

@ -17,16 +17,17 @@
-export([print/1, print/2, usage/1, usage/2]).
print(Msg) ->
io:format(Msg).
io:format(Msg), lists:flatten(io_lib:format("~p", [Msg])).
print(Format, Args) ->
io:format(Format, Args).
io:format(Format, Args), lists:flatten(io_lib:format(Format, Args)).
usage(CmdList) ->
lists:foreach(
lists:map(
fun({Cmd, Descr}) ->
io:format("~-48s# ~s~n", [Cmd, Descr])
io:format("~-48s# ~s~n", [Cmd, Descr]),
lists:flatten(io_lib:format("~-48s# ~s~n", [Cmd, Descr]))
end, CmdList).
usage(Format, Args) ->
usage([{Format, Args}]).
usage([{Format, Args}]).