diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2018-06-05 20:57:02 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2018-06-05 20:57:02 -0400 |
commit | 3762e085e9a9de86552edb95384d08abd54697b6 (patch) | |
tree | 63a37496adfcede54f80a1fbe635ee1840c054ff /src | |
parent | b1b45ff926d1380dd71e402ae2ea22fa84356493 (diff) |
Add --start-clean flag to rebar3 shell
Allows override of apps specified in other on-disk options. Equivalent
to `--apps=""`
Fixes #1785
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_shell.erl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/rebar_prv_shell.erl b/src/rebar_prv_shell.erl index 52b50a0..af8d99f 100644 --- a/src/rebar_prv_shell.erl +++ b/src/rebar_prv_shell.erl @@ -76,6 +76,9 @@ init(State) -> "shell. (E.g. --apps app1,app2,app3) Defaults " "to rebar.config {shell, [{apps, Apps}]} or " "relx apps if not specified."}, + {start_clean, undefined, "start-clean", boolean, + "Cancel any applications in the 'apps' list " + "or release."}, {user_drv_args, undefined, "user_drv_args", string, "Arguments passed to user_drv start function for " "creating custom shells."}]} @@ -236,7 +239,7 @@ maybe_run_script(State) -> ?DEBUG("No script_file specified.", []), ok; "none" -> - ?DEBUG("Shell script execution skipped (--script_file none).", []), + ?DEBUG("Shell script execution skipped (--script none).", []), ok; RelFile -> File = filename:absname(RelFile), @@ -311,7 +314,12 @@ find_apps_option(State) -> {Opts, _} = rebar_state:command_parsed_args(State), case debug_get_value(apps, Opts, no_value, "Found shell apps from command line option.") of - no_value -> no_value; + no_value -> + case debug_get_value(start_clean, Opts, false, + "Found start-clean argument to disable apps") of + false -> no_value; + true -> [] + end; AppsStr -> [ list_to_atom(AppStr) || AppStr <- rebar_string:lexemes(AppsStr, " ,:") ] |