aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_options.erl
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2011-01-20 19:12:01 +0200
committerKostis Sagonas <[email protected]>2011-01-20 19:12:01 +0200
commitb4c3711c6daa2f171f56b984235969e223ce8f9c (patch)
tree181f6ada7126a8e66ae0876578eb5af0c5346cce /lib/dialyzer/src/dialyzer_options.erl
parentfaef041a446314bb228e0e8c88a09241df2798f1 (diff)
downloadotp-b4c3711c6daa2f171f56b984235969e223ce8f9c.tar.gz
otp-b4c3711c6daa2f171f56b984235969e223ce8f9c.tar.bz2
otp-b4c3711c6daa2f171f56b984235969e223ce8f9c.zip
Add a --fullpath option to Dialyzer
This change adds a --fullpath option to Dialyzer, which makes the warning messages contain the full path of the corresponding file. Original patch submitted by Magnus Henoch (legoscia) on 15/9/2010 and cooked to death in the 'pu' branch all this time. The patch was essentially correct and most of it has been used as is, but there have been some changes to make the code slightly prettier, avoid some code duplication, and add documentation to dialyzer's doc files and to its help message.
Diffstat (limited to 'lib/dialyzer/src/dialyzer_options.erl')
-rw-r--r--lib/dialyzer/src/dialyzer_options.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/dialyzer/src/dialyzer_options.erl b/lib/dialyzer/src/dialyzer_options.erl
index 2c0afa6e2b..b5cefd16ca 100644
--- a/lib/dialyzer/src/dialyzer_options.erl
+++ b/lib/dialyzer/src/dialyzer_options.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -169,6 +169,9 @@ build_options([{OptionName, Value} = Term|Rest], Options) ->
output_format ->
assert_output_format(Value),
build_options(Rest, Options#options{output_format = Value});
+ filename_opt ->
+ assert_filename_opt(Value),
+ build_options(Rest, Options#options{filename_opt = Value});
output_plt ->
assert_filename(Value),
build_options(Rest, Options#options{output_plt = Value});
@@ -218,6 +221,13 @@ assert_output_format(formatted) ->
assert_output_format(Term) ->
bad_option("Illegal value for output_format", Term).
+assert_filename_opt(basename) ->
+ ok;
+assert_filename_opt(fullpath) ->
+ ok;
+assert_filename_opt(Term) ->
+ bad_option("Illegal value for filename_opt", Term).
+
assert_plt_op(#options{analysis_type = OldVal},
#options{analysis_type = NewVal}) ->
case is_plt_mode(OldVal) andalso is_plt_mode(NewVal) of