aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_options.erl
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2011-02-27 17:48:54 +0200
committerStavros Aronis <[email protected]>2011-02-28 17:08:49 +0200
commit8bbf860b2f21571a4675a1a031cb95f25a10f391 (patch)
tree7a09ac62bec8cdf0c90a6e0cf499b93b82ff02c1 /lib/dialyzer/src/dialyzer_options.erl
parent8b7546d447c1ba866906d6926d82b58fa88d5791 (diff)
downloadotp-8bbf860b2f21571a4675a1a031cb95f25a10f391.tar.gz
otp-8bbf860b2f21571a4675a1a031cb95f25a10f391.tar.bz2
otp-8bbf860b2f21571a4675a1a031cb95f25a10f391.zip
Add 'apps' option to the erlang interface
Diffstat (limited to 'lib/dialyzer/src/dialyzer_options.erl')
-rw-r--r--lib/dialyzer/src/dialyzer_options.erl13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/dialyzer/src/dialyzer_options.erl b/lib/dialyzer/src/dialyzer_options.erl
index 2c0afa6e2b..d64e44a814 100644
--- a/lib/dialyzer/src/dialyzer_options.erl
+++ b/lib/dialyzer/src/dialyzer_options.erl
@@ -120,12 +120,18 @@ build_options([{OptName, undefined}|Rest], Options) when is_atom(OptName) ->
build_options(Rest, Options);
build_options([{OptionName, Value} = Term|Rest], Options) ->
case OptionName of
+ apps ->
+ OldValues = Options#options.files_rec,
+ AppDirs = get_app_dirs(Value),
+ assert_filenames(Term, AppDirs),
+ build_options(Rest, Options#options{files_rec = AppDirs ++ OldValues});
files ->
assert_filenames(Term, Value),
build_options(Rest, Options#options{files = Value});
files_rec ->
+ OldValues = Options#options.files_rec,
assert_filenames(Term, Value),
- build_options(Rest, Options#options{files_rec = Value});
+ build_options(Rest, Options#options{files_rec = Value ++ OldValues});
analysis_type ->
NewOptions =
case Value of
@@ -188,6 +194,11 @@ build_options([{OptionName, Value} = Term|Rest], Options) ->
build_options([], Options) ->
Options.
+get_app_dirs(Apps) when is_list(Apps) ->
+ dialyzer_cl_parse:get_lib_dir([atom_to_list(A) || A <- Apps]);
+get_app_dirs(Apps) ->
+ bad_option("Use a list of otp applications", Apps).
+
assert_filenames(Term, [FileName|Left]) when length(FileName) >= 0 ->
case filelib:is_file(FileName) orelse filelib:is_dir(FileName) of
true -> ok;