aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/doc/src/typer.xml
blob: 1cfbe94807693dcfd89e23b504058cddd9fc318c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>2006</year><year>2017</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.

    </legalnotice>

    <title>typer</title>
    <prepared></prepared>
    <docno></docno>
    <date>2017-04-13</date>
    <rev></rev>
    <file>type.xml</file>
  </header>
  <module>typer</module>
  <modulesummary>Typer, a Type annotator for ERlang programs.
  </modulesummary>
  <description>
    <p>TypEr shows type information for Erlang modules to the user.
    Additionally, it can annotate the code of files with such type
    information.</p>
  </description>

  <section>
    <marker id="command_line"></marker>
    <title>Using TypEr from the Command Line</title>
    <p>TypEr is used from the command-line. This section provides a
    brief description of the options. The same information can be
    obtained by writing the following in a shell:</p>

    <code type="none">
typer --help</code>

    <p><em>Usage:</em></p>

    <code type="none">
typer [--help] [--version] [--plt PLT] [--edoc]
      [--show | --show-exported | --annotate | --annotate-inc-files]
      [-Ddefine]* [-I include_dir]* [-pa dir]* [-pz dir]*
      [-T application]* [-r] file*</code>

    <note>
      <p>* denotes that multiple occurrences of the option are possible.</p>
    </note>

    <p><em>Options:</em></p>

    <taglist>

      <tag><c>--r</c></tag>
      <item>
        <p>Search directories recursively for .erl files below them.</p>
      </item>
      <tag><c>--show</c></tag>
      <item>
        <p>Print type specifications for all functions on stdout.
        (This is the default behaviour; this option is not really
        needed.)</p>
      </item>

      <tag><c>--show-exported</c> (or <c>show_exported</c>)</tag>
      <item>
        <p>Same as <c>--show</c>, but print specifications for
        exported functions only. Specs are displayed sorted
        alphabetically on the function's name.</p>
      </item>

      <tag><c>--annotate</c></tag>
      <item>
        <p>Annotate the specified files with type specifications.</p>
      </item>

      <tag><c>--annotate-inc-files</c></tag>
      <item>
        <p>Same as <c>--annotate</c> but annotates all
        <c>-include()</c> files as well as all .erl files. (Use this
        option with caution - it has not been tested much).</p>
      </item>

      <tag><c>--edoc</c></tag>
      <item>
        <p>Print type information as Edoc <c>@spec</c> comments, not
        as type specs.</p>
      </item>

      <tag><c>--plt</c></tag>
      <item>
        <p>Use the specified dialyzer PLT file rather than the default one.</p>
      </item>

      <tag><c>-T file*</c></tag>
      <item>
        <p>The specified file(s) already contain type specifications
        and these are to be trusted in order to print specs for the
        rest of the files. (Multiple files or dirs, separated by
        spaces, can be specified.)</p>
      </item>

      <tag><c>-Dname</c> (or <c>-Dname=value</c>)</tag>
      <item>
        <p>Pass the defined name(s) to TypEr. (**)</p>
      </item>

      <tag><c>-I</c></tag>
      <item>
        <p>Pass the include_dir to TypEr. (**)</p>
      </item>

      <tag><c>-pa dir</c></tag>
      <item>
        <p>Include <c>dir</c> in the path for Erlang. This is useful
          when analyzing files that have <c>-include_lib()</c>
          directives or use parse transforms.</p>
      </item>

      <tag><c>-pz dir</c></tag>
      <item>
        <p>Include <c>dir</c> in the path for Erlang. This is useful
          when analyzing files that have <c>-include_lib()</c>
          directives or use parse transforms.</p>
      </item>

      <tag><c>--version</c> (or <c>-v</c>)</tag>
      <item>
        <p>Print the TypEr version and some more information and
          exit.</p>
      </item>

    </taglist>

    <note>
      <p>** options <c>-D</c> and <c>-I</c> work both
        from the command line and in the TypEr GUI; the syntax of
        defines and includes is the same as that used by
        <seealso marker="erts:erlc">erlc(1)</seealso>.</p>
    </note>

  </section>

</erlref>