303
328
%%-----------------------------------------------------------------------
330
get_plts(["--"|T], Acc) -> {lists:reverse(Acc), T};
331
get_plts(["-"++_Opt = H|T], Acc) -> {lists:reverse(Acc), [H|T]};
332
get_plts([H|T], Acc) -> get_plts(T, [H|Acc]);
333
get_plts([], Acc) -> {lists:reverse(Acc), []}.
335
%%-----------------------------------------------------------------------
337
-spec help_warnings() -> no_return().
305
339
help_warnings() ->
306
340
S = warning_options_msg(),
308
342
erlang:halt(?RET_NOTHING_SUSPICIOUS).
344
-spec help_message() -> no_return().
310
346
help_message() ->
311
347
S = "Usage: dialyzer [--help] [--version] [--shell] [--quiet] [--verbose]
312
[-pa dir]* [--plt plt] [-Ddefine]* [-I include_dir]*
313
[--output_plt file] [-Wwarn]* [--src] [--gui | --wx]
314
[-c applications] [-r applications] [-o outfile]
348
[-pa dir]* [--plt plt] [--plts plt*] [-Ddefine]*
349
[-I include_dir]* [--output_plt file] [-Wwarn]*
350
[--src] [--gui | --wx] [files_or_dirs] [-r dirs]
351
[--apps applications] [-o outfile]
315
352
[--build_plt] [--add_to_plt] [--remove_from_plt]
316
[--check_plt] [--no_check_plt] [--plt_info] [--get_warnings]
318
-c applications (or --command-line applications)
319
Use Dialyzer from the command line (no GUI) to detect defects in the
320
specified applications (directories or .erl or .beam files)
322
Same as -c only that directories are searched recursively for
323
subdirectories containing .erl or .beam files (depending on the
353
[--check_plt] [--no_check_plt] [--plt_info] [--get_warnings]
354
[--no_native] [--fullpath]
356
files_or_dirs (for backwards compatibility also as: -c files_or_dirs)
357
Use Dialyzer from the command line to detect defects in the
358
specified files or directories containing .erl or .beam files,
359
depending on the type of the analysis.
361
Same as the previous but the specified directories are searched
362
recursively for subdirectories containing .erl or .beam files in
363
them, depending on the type of analysis.
365
Option typically used when building or modifying a plt as in:
366
dialyzer --build_plt --apps erts kernel stdlib mnesia ...
367
to conveniently refer to library applications corresponding to the
368
Erlang/OTP installation. However, the option is general and can also
369
be used during analysis in order to refer to Erlang/OTP applications.
370
In addition, file or directory names can also be included, as in:
371
dialyzer --apps inets ssl ./ebin ../other_lib/ebin/my_module.beam
325
372
-o outfile (or --output outfile)
326
373
When using Dialyzer from the command line, send the analysis
327
results to the specified \"outfile\" rather than to stdout
374
results to the specified outfile rather than to stdout.
329
376
When using Dialyzer from the command line, output the raw analysis
330
377
results (Erlang terms) instead of the formatted result.
331
378
The raw format is easier to post-process (for instance, to filter
332
warnings or to output HTML pages)
379
warnings or to output HTML pages).
334
381
Override the default, which is to analyze BEAM files, and
335
analyze starting from Erlang source code instead
382
analyze starting from Erlang source code instead.
336
383
-Dname (or -Dname=value)
337
When analyzing from source, pass the define to Dialyzer (**)
384
When analyzing from source, pass the define to Dialyzer. (**)
339
When analyzing from source, pass the include_dir to Dialyzer (**)
386
When analyzing from source, pass the include_dir to Dialyzer. (**)
341
388
Include dir in the path for Erlang (useful when analyzing files
342
that have '-include_lib()' directives)
389
that have '-include_lib()' directives).
343
390
--output_plt file
344
Store the plt at the specified file after building it
391
Store the plt at the specified file after building it.
346
393
Use the specified plt as the initial plt (if the plt was built
347
during setup the files will be checked for consistency)
394
during setup the files will be checked for consistency).
396
Merge the specified plts to create the initial plt -- requires
397
that the plts are disjoint (i.e., do not have any module
398
appearing in more than one plt).
399
The plts are created in the usual way:
400
dialyzer --build_plt --output_plt plt_1 files_to_include
402
dialyzer --build_plt --output_plt plt_n files_to_include
403
and then can be used in either of the following ways:
404
dialyzer files_to_analyze --plts plt_1 ... plt_n
406
dialyzer --plts plt_1 ... plt_n -- files_to_analyze
407
(Note the -- delimiter in the second case)
349
409
A family of options which selectively turn on/off warnings
350
(for help on the names of warnings use dialyzer -Whelp)
410
(for help on the names of warnings use dialyzer -Whelp).
352
Do not disable the Erlang shell while running the GUI
412
Do not disable the Erlang shell while running the GUI.
353
413
--version (or -v)
354
Prints the Dialyzer version and some more information and exits
414
Print the Dialyzer version and some more information and exit.
356
Prints this message and exits
416
Print this message and exit.
358
Makes Dialyzer a bit more quiet
418
Make Dialyzer a bit more quiet.
360
Makes Dialyzer a bit more verbose
420
Make Dialyzer a bit more verbose.
362
422
The analysis starts from an empty plt and creates a new one from the
363
423
files specified with -c and -r. Only works for beam files.
364
Use --plt or --output_plt to override the default plt location.
424
Use --plt(s) or --output_plt to override the default plt location.
366
426
The plt is extended to also include the files specified with -c and -r.
367
Use --plt to specify wich plt to start from, and --output_plt to
368
specify where to put the plt. Note that the analysis might include
369
files from the plt if they depend on the new files.
427
Use --plt(s) to specify which plt to start from, and --output_plt to
428
specify where to put the plt. Note that the analysis might include
429
files from the plt if they depend on the new files.
370
430
This option only works with beam files.
371
431
--remove_from_plt
372
432
The information from the files specified with -c and -r is removed
373
433
from the plt. Note that this may cause a re-analysis of the remaining
376
Checks the plt for consistency and rebuilds it if it is not up-to-date.
436
Check the plt for consistency and rebuild it if it is not up-to-date.
377
437
Actually, this option is of rare use as it is on by default.
378
438
--no_check_plt (or -n)
379
439
Skip the plt check when running Dialyzer. Useful when working with
380
440
installed plts that never change.
382
Makes Dialyzer print information about the plt and then quit. The plt
383
can be specified with --plt.
442
Make Dialyzer print information about the plt and then quit. The plt
443
can be specified with --plt(s).
385
Makes Dialyzer emit warnings even when manipulating the plt. Only
386
emits warnings for files that are actually analyzed.
445
Make Dialyzer emit warnings even when manipulating the plt. Warnings
446
are only emitted for files that are actually analyzed.
387
447
--dump_callgraph file
388
448
Dump the call graph into the specified file whose format is determined
389
449
by the file name extension. Supported extensions are: raw, dot, and ps.
390
450
If something else is used as file name extension, default format '.raw'
453
Bypass the native code compilation of some key files that Dialyzer
454
heuristically performs when dialyzing many files; this avoids the
455
compilation time but it may result in (much) longer analysis time.
457
Display the full path names of files for which warnings are emitted.
393
459
Use the gs-based GUI.