mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
List substitution variable names in 'list-templates' command.
This commit is contained in:
parent
b1d06a4d14
commit
4414f6548a
1 changed files with 5 additions and 1 deletions
|
@ -64,7 +64,11 @@
|
||||||
?CONSOLE("Available templates:\n", []),
|
?CONSOLE("Available templates:\n", []),
|
||||||
_ = [begin
|
_ = [begin
|
||||||
BaseName = filename:basename(F, ".template"),
|
BaseName = filename:basename(F, ".template"),
|
||||||
?CONSOLE("\t* ~s: ~s (~p)\n", [BaseName, F, Type])
|
{ok, Template} = file:consult(F),
|
||||||
|
{_, VarList} = lists:keyfind(variables, 1, Template),
|
||||||
|
Vars = lists:foldl(fun({V,_}, Acc) -> [atom_to_list(V)|Acc] end, [], VarList),
|
||||||
|
?CONSOLE("\t* ~s: ~s (~p) (variables: ~p)\n", [BaseName, F, Type,
|
||||||
|
string:join(Vars, ", ")])
|
||||||
end || {Type, F} <- AvailTemplates],
|
end || {Type, F} <- AvailTemplates],
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue