浏览代码

List substitution variable names in 'list-templates' command.

pull/3/head
hirschen 13 年前
父节点
当前提交
4414f6548a
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. +5
    -1
      src/rebar_templater.erl

+ 5
- 1
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.

正在加载...
取消
保存