diff options
Diffstat (limited to 'src/rebar_prv_new.erl')
-rw-r--r-- | src/rebar_prv_new.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rebar_prv_new.erl b/src/rebar_prv_new.erl index 93adeb4..e432371 100644 --- a/src/rebar_prv_new.erl +++ b/src/rebar_prv_new.erl @@ -71,7 +71,15 @@ is_forced(State) -> end. parse_opts([]) -> []; -parse_opts([Opt|Opts]) -> [parse_opt(Opt, "") | parse_opts(Opts)]. +parse_opts([Opt|Opts]) -> [parse_first_opt(Opt, "") | parse_opts1(Opts)]. + +parse_opts1([]) -> []; +parse_opts1([Opt|Opts]) -> [parse_opt(Opt, "") | parse_opts1(Opts)]. + +%% If the first argument meets no '=', we got a default 'name' argument +parse_first_opt("", Acc) -> {name, lists:reverse(Acc)}; +parse_first_opt("="++Rest, Acc) -> parse_opt("="++Rest, Acc); +parse_first_opt([H|Str], Acc) -> parse_first_opt(Str, [H|Acc]). %% We convert to atoms dynamically. Horrible in general, but fine in a %% build system's templating tool. |