summaryrefslogtreecommitdiff
path: root/src/rebar_prv_new.erl
diff options
context:
space:
mode:
authorStuart Thackray <stuart.thackray@gmail.com>2018-12-11 08:53:29 +0200
committerStuart Thackray <stuart.thackray@gmail.com>2018-12-11 08:53:29 +0200
commitebfa797c1f5d038b99beaf658757d974412a15c7 (patch)
tree9765880a7f0119c265d85f8bac7afea8d9542080 /src/rebar_prv_new.erl
parent71187514dabdd94aa333495d92df84a2e750099f (diff)
parent8e28561d4e14ea85d42d17ab5a0f17f5f1c696d2 (diff)
Update from Upstream
Diffstat (limited to 'src/rebar_prv_new.erl')
-rw-r--r--src/rebar_prv_new.erl27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/rebar_prv_new.erl b/src/rebar_prv_new.erl
index 064315e..c6a1e9b 100644
--- a/src/rebar_prv_new.erl
+++ b/src/rebar_prv_new.erl
@@ -60,7 +60,7 @@ do(State) ->
-spec format_error(any()) -> iolist().
format_error({consult, File, Reason}) ->
- io_lib:format("Error consulting file at ~s for reason ~p", [File, Reason]);
+ io_lib:format("Error consulting file at ~ts for reason ~p", [File, Reason]);
format_error(Reason) ->
io_lib:format("~p", [Reason]).
@@ -70,7 +70,7 @@ format_error(Reason) ->
list_templates(State) ->
lists:foldl(fun({error, {consult, File, Reason}}, Acc) ->
- ?WARN("Error consulting template file ~s for reason ~p",
+ ?WARN("Error consulting template file ~ts for reason ~p",
[File, Reason]),
Acc
; (Tpl, Acc) ->
@@ -82,7 +82,9 @@ info() ->
"Create rebar3 project based on template and vars.~n"
"~n"
"Valid command line options:~n"
- " <template> [var=foo,...]~n", []).
+ " <template> [var=foo,...]~n"
+ "~n"
+ "See available templates with: `rebar3 new help`~n", []).
strip_flags([]) -> [];
strip_flags(["-"++_|Opts]) -> strip_flags(Opts);
@@ -116,31 +118,34 @@ show_short_templates(List) ->
lists:map(fun show_short_template/1, lists:sort(List)).
show_short_template({Name, Type, _Location, Description, _Vars}) ->
- io:format("~s (~s): ~s~n",
+ io:format("~ts (~ts): ~ts~n",
[Name,
format_type(Type),
format_description(Description)]).
show_template({Name, Type, Location, Description, Vars}) ->
- io:format("~s:~n"
- "\t~s~n"
- "\tDescription: ~s~n"
- "\tVariables:~n~s~n",
+ io:format("~ts:~n"
+ "\t~ts~n"
+ "\tDescription: ~ts~n"
+ "\tVariables:~n~ts~n",
[Name,
format_type(Type, Location),
format_description(Description),
format_vars(Vars)]).
format_type(escript) -> "built-in";
+format_type(builtin) -> "built-in";
format_type(plugin) -> "plugin";
format_type(file) -> "custom".
format_type(escript, _) ->
"built-in template";
+format_type(builtin, _) ->
+ "built-in template";
format_type(plugin, Loc) ->
- io_lib:format("plugin template (~s)", [Loc]);
+ io_lib:format("plugin template (~ts)", [Loc]);
format_type(file, Loc) ->
- io_lib:format("custom template (~s)", [Loc]).
+ io_lib:format("custom template (~ts)", [Loc]).
format_description(Description) ->
case Description of
@@ -153,4 +158,4 @@ format_vars(Vars) -> [format_var(Var) || Var <- Vars].
format_var({Var, Default}) ->
io_lib:format("\t\t~p=~p~n",[Var, Default]);
format_var({Var, Default, Doc}) ->
- io_lib:format("\t\t~p=~p (~s)~n", [Var, Default, Doc]).
+ io_lib:format("\t\t~p=~p (~ts)~n", [Var, Default, Doc]).