26
26
%%-----------------------------------------------------------------------
28
-type(dial_cl_parse_ret() :: {'check_init',#options{}}
28
-type dial_cl_parse_ret() :: {'check_init',#options{}}
29
29
| {'plt_info', #options{}}
30
30
| {'cl',#options{}}
31
31
| {'gui',#options{}}
32
| {'error',string()}).
34
34
%%-----------------------------------------------------------------------
36
-spec(start/0 :: () -> dial_cl_parse_ret()).
36
-spec start() -> dial_cl_parse_ret().
59
59
put(dialyzer_options_mode, cl),
60
60
put(dialyzer_options_analysis_type, plt_check),
62
cl(["--no_check_plt"|T]) ->
63
put(dialyzer_options_check_plt, false),
62
65
cl(["--plt_info"|T]) ->
63
66
put(dialyzer_options_mode, cl),
64
67
put(dialyzer_options_analysis_type, plt_info),
191
194
OptsRecord -> {RetTag, OptsRecord}
197
%%-----------------------------------------------------------------------
195
199
command_line(T0) ->
196
200
{Args,T} = collect_args(T0),
217
221
put(dialyzer_options_defines, DefaultOpts#options.defines),
218
222
put(dialyzer_options_files, DefaultOpts#options.files),
219
223
put(dialyzer_output_format, formatted),
224
put(dialyzer_options_check_plt, DefaultOpts#options.check_plt),
222
227
append_defines([Def, Val]) ->
236
241
%%-----------------------------------------------------------------------
238
-spec(collect_args/1 :: ([string()]) -> {[string()],[string()]}).
243
-spec collect_args([string()]) -> {[string()], [string()]}.
240
245
collect_args(List) ->
241
246
collect_args_1(List, []).
243
248
collect_args_1(["-"++_|_]=L, Acc) ->
244
{lists:reverse(Acc),L};
249
{lists:reverse(Acc), L};
245
250
collect_args_1([Arg|T], Acc) ->
246
251
collect_args_1(T, [Arg|Acc]);
247
252
collect_args_1([], Acc) ->
248
{lists:reverse(Acc),[]}.
253
{lists:reverse(Acc), []}.
250
255
%%-----------------------------------------------------------------------
253
[{files,get(dialyzer_options_files)},
254
{files_rec,get(dialyzer_options_files_rec)},
255
{output_file,get(dialyzer_output)},
256
{output_format,get(dialyzer_output_format)},
258
[{files, get(dialyzer_options_files)},
259
{files_rec, get(dialyzer_options_files_rec)},
260
{output_file, get(dialyzer_output)},
261
{output_format, get(dialyzer_output_format)},
257
262
{analysis_type, get(dialyzer_options_analysis_type)},
258
263
{get_warnings, get(dialyzer_options_get_warnings)}
259
264
|common_options()].
266
271
{output_plt, get(dialyzer_output_plt)},
267
272
{report_mode, get(dialyzer_options_report_mode)},
268
273
{use_spec, get(dialyzer_options_use_contracts)},
269
{warnings, get(dialyzer_warnings)}].
274
{warnings, get(dialyzer_warnings)},
275
{check_plt, get(dialyzer_options_check_plt)}].
271
277
%%-----------------------------------------------------------------------
299
305
[-pa dir]* [--plt plt] [-Ddefine]* [-I include_dir]*
300
306
[--output_plt file] [-Wwarn]* [--src]
301
307
[-c applications] [-r applications] [-o outfile]
302
[--build_plt] [--add_to_plt] [--remove_from_plt] [--check_plt]
303
[--plt_info] [--get_warnings]
308
[--build_plt] [--add_to_plt] [--remove_from_plt]
309
[--check_plt] [--no_check_plt] [--plt_info] [--get_warnings]
305
311
-c applications (or --command-line applications)
306
312
Use Dialyzer from the command line (no GUI) to detect defects in the
363
369
Checks the plt for consistency and rebuilds it if it is not up-to-date.
371
Skip the plt check when running Dialyzer. Useful when working with
372
installed plts that never change.
365
374
Makes Dialyzer print information about the plt and then quit. The plt
366
375
can be specified with --plt.