Maxim Sokhatsky 10 years ago
parent
commit
e67ffff913
4 changed files with 10 additions and 4 deletions
  1. BIN
      mad
  2. 8 3
      src/mad.erl
  3. 1 0
      src/mad_tool.erl
  4. 1 1
      src/mad_utils.erl

BIN
mad


+ 8 - 3
src/mad.erl

@@ -59,12 +59,17 @@ repl(Cwd,ConfigFileName,Config,Params) ->
 
 tool(Cwd,ConfigFileName,Config,Params) ->
     io:format("Tool Params: ~p~n",[Params]),
-    mad_tool:main(filename:basename(mad_utils:cwd())).
+    Name = case Params of [] -> filename:basename(mad_utils:cwd()); E -> E end,
+    mad_tool:main(Name).
 
 help(Reason, Data) -> help(io_lib:format("~s ~p", [Reason, Data])).
 help(Msg) -> io:format("Error: ~s~n~n", [Msg]), help().
 help() ->
-    io:format("SRC VXZ MAD Build Tool version 1.0~n"),
-    io:format("mad deps compile plan start stop repl attach release tool ~n"),
+    io:format("VXZ MAD Build Tool version 1.0~n"),
+    io:format("BNF: ~n"),
+    io:format("    invoke := mad params~n"),
+    io:format("    params := run params ~n"),
+    io:format("       run := command [ help | options ]~n"),
+    io:format("       cmd := deps | compile | run | stop | repl | attach | release | tool~n"),
     halt().
 

+ 1 - 0
src/mad_tool.erl

@@ -13,4 +13,5 @@ files() ->
     [{filename:basename(F), read_file(F)}
      || F <- filelib:wildcard(              filename:join("ebin", "*")) ++
              filelib:wildcard(filename:join(["apps", "*", "ebin", "*"])) ++
+             filelib:wildcard(filename:join(["apps", "*", "priv", "templates", "*" ])) ++
              filelib:wildcard(filename:join(["deps", "*", "ebin", "*"]))].

+ 1 - 1
src/mad_utils.erl

@@ -68,7 +68,7 @@ to_atom(X) -> X.
 
 atomize("com"++_) -> compile;
 atomize("rep"++_) -> repl;
-atomize("tol"++_) -> tool;
+atomize("too"++_) -> tool;
 atomize("dep"++_) -> deps;
 atomize("pla"++_) -> plan;
 atomize(Else) -> Else.