summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhirschen <falco.hirschenberger@itwm.fraunhofer.de>2012-06-11 14:49:42 +0200
committerhirschen <falco.hirschenberger@itwm.fraunhofer.de>2012-06-11 15:01:12 +0200
commit4414f6548ac60b8083f00e5da267198e9d842558 (patch)
tree914146840013dcd93e66fa5abed5ca3948563f4d /src
parentb1d06a4d1470cfe57aab58bfad7c41aa09e86f05 (diff)
List substitution variable names in 'list-templates' command.
Diffstat (limited to 'src')
-rw-r--r--src/rebar_templater.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl
index f608512..98fa245 100644
--- a/src/rebar_templater.erl
+++ b/src/rebar_templater.erl
@@ -64,7 +64,11 @@
?CONSOLE("Available templates:\n", []),
_ = [begin
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],
ok.