aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_options.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dialyzer/src/dialyzer_options.erl')
-rw-r--r--lib/dialyzer/src/dialyzer_options.erl19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/dialyzer/src/dialyzer_options.erl b/lib/dialyzer/src/dialyzer_options.erl
index 010625b7bd..2c0afa6e2b 100644
--- a/lib/dialyzer/src/dialyzer_options.erl
+++ b/lib/dialyzer/src/dialyzer_options.erl
@@ -53,14 +53,21 @@ build(Opts) ->
InitPlt = dialyzer_plt:get_default_plt(),
DefaultOpts = #options{},
DefaultOpts1 = DefaultOpts#options{legal_warnings = DefaultWarns1,
- init_plt = InitPlt},
- try
- NewOpts = build_options(Opts, DefaultOpts1),
+ init_plts = [InitPlt]},
+ try
+ Opts1 = preprocess_opts(Opts),
+ NewOpts = build_options(Opts1, DefaultOpts1),
postprocess_opts(NewOpts)
catch
throw:{dialyzer_options_error, Msg} -> {error, Msg}
end.
+preprocess_opts([]) -> [];
+preprocess_opts([{init_plt, File}|Opts]) ->
+ [{plts, [File]}|preprocess_opts(Opts)];
+preprocess_opts([Opt|Opts]) ->
+ [Opt|preprocess_opts(Opts)].
+
postprocess_opts(Opts = #options{}) ->
Opts1 = check_output_plt(Opts),
adapt_get_warnings(Opts1).
@@ -144,9 +151,9 @@ build_options([{OptionName, Value} = Term|Rest], Options) ->
build_options(Rest, Options#options{from = Value});
get_warnings ->
build_options(Rest, Options#options{get_warnings = Value});
- init_plt ->
- assert_filenames([Term], [Value]),
- build_options(Rest, Options#options{init_plt = Value});
+ plts ->
+ assert_filenames(Term, Value),
+ build_options(Rest, Options#options{init_plts = Value});
include_dirs ->
assert_filenames(Term, Value),
OldVal = Options#options.include_dirs,