summaryrefslogtreecommitdiff
path: root/src/rebar_prv_new.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_prv_new.erl')
-rw-r--r--src/rebar_prv_new.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rebar_prv_new.erl b/src/rebar_prv_new.erl
index 6574aca..28572a9 100644
--- a/src/rebar_prv_new.erl
+++ b/src/rebar_prv_new.erl
@@ -32,7 +32,7 @@ init(State) ->
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
do(State) ->
- case rebar_state:command_args(State) of
+ case strip_flags(rebar_state:command_args(State)) of
["help"] ->
?CONSOLE("Call `rebar3 new help <template>` for a detailed description~n", []),
show_short_templates(rebar_templater:list_templates(State)),
@@ -72,6 +72,10 @@ info() ->
"Valid command line options:~n"
" <template> [var=foo,...]~n", []).
+strip_flags([]) -> [];
+strip_flags(["-"++_|Opts]) -> strip_flags(Opts);
+strip_flags([Opt | Opts]) -> [Opt | strip_flags(Opts)].
+
is_forced(State) ->
{Args, _} = rebar_state:command_parsed_args(State),
case proplists:get_value(force, Args) of