Maxim Sokhatsky 10 years ago
parent
commit
b75d7221aa
4 changed files with 7 additions and 5 deletions
  1. BIN
      mad
  2. 4 1
      src/mad.erl
  3. 1 1
      src/mad_repl.erl
  4. 2 3
      src/mad_utils.erl

BIN
mad


+ 4 - 1
src/mad.erl

@@ -7,8 +7,11 @@ main([]) -> help();
 main(Params) ->
 main(Params) ->
 %    io:format("Bundle: ~p~n\r",[escript:script_name()]),
 %    io:format("Bundle: ~p~n\r",[escript:script_name()]),
 
 
-    FP = mad_utils:fold_params(Params),
+    {Other,FP} = mad_utils:fold_params(Params),
 %    io:format("Params: ~p~n\r",[FP]),
 %    io:format("Params: ~p~n\r",[FP]),
+    case Other == [] of
+         true -> skip;
+         false -> io:format("Unknown Command or Parameter ~p~n\r",[Other]), help() end,
 
 
     Cwd = mad_utils:cwd(),
     Cwd = mad_utils:cwd(),
     ConfigFile = "rebar.config",
     ConfigFile = "rebar.config",

+ 1 - 1
src/mad_repl.erl

@@ -87,7 +87,7 @@ load() ->
 unfold_zips(Bin) ->
 unfold_zips(Bin) ->
     {ok,Unzip} = zip:unzip(Bin,[memory]),
     {ok,Unzip} = zip:unzip(Bin,[memory]),
     [ begin
     [ begin
-        io:format("Unzip: ~p~n\r",[U]),
+%        io:format("Unzip: ~p~n\r",[U]),
         ets:insert(filesystem,{U,FileBin}),
         ets:insert(filesystem,{U,FileBin}),
         case U of
         case U of
             "static.gz" -> unfold_zips(FileBin);
             "static.gz" -> unfold_zips(FileBin);

+ 2 - 3
src/mad_utils.erl

@@ -83,12 +83,11 @@ atomize_params_commands([H|T], New) -> atomize_params_commands(T,[atomize(H)|New
 
 
 fold_params(Params) -> 
 fold_params(Params) -> 
    Atomized = atomize_params_commands(Params),
    Atomized = atomize_params_commands(Params),
-   {[],Fold} = lists:foldl(fun(X,{Current,Result}) -> 
+   lists:foldl(fun(X,{Current,Result}) -> 
       case atomize(X) of
       case atomize(X) of
            X when is_atom(X) -> {[],[{X,Current}|Result]};
            X when is_atom(X) -> {[],[{X,Current}|Result]};
            E -> {[E|Current],Result} end
            E -> {[E|Current],Result} end
-      end, {[],[]}, Atomized),
-   Fold.
+      end, {[],[]}, Atomized).
 
 
 compile(_,_,_,_) -> ok.
 compile(_,_,_,_) -> ok.