2008-12-08 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / man / mdoc-update.1
1 .\" 
2 .\" mdoc-update manual page.
3 .\" (C) 2008 Jonathan Pryor
4 .\" Author:
5 .\"   Jonathan Pryor (jpryor@novell.com)
6 .\"
7 .de Sp \" Vertical space (when we can't use .PP)
8 .if t .sp .5v
9 .if n .sp
10 ..
11 .TH "mdoc-update" 1
12 .SH NAME
13 mdoc update \- \fBmdoc\fR(5) documentation format support
14 .SH SYNOPSIS
15 \fBmdoc update\fR [OPTIONS]* ASSEMBLIES
16 .SH DESCRIPTION
17 \fBmdoc update\fR is responsible for the following:
18 .TP
19 .B *
20 Creating documentation stubs based on \fIASSEMBLIES\fR.  The stub-creation
21 process will create new \fBmdoc\fR(5) XML files for each type within
22 \fIASSEMBLIES\fR, and provide documentation stubs for each member of those
23 types.
24 .TP
25 .B *
26 Update documentation stubs based on \fIASSEMBLIES\fR.  Existing \fBmdoc\fR(5)
27 documentation can be updated to reflect changes within \fIASSEMBLIES\fR, such
28 as added types and members, while preserving existing documentation.
29 .Sp
30 In some limited circumstances, renames will be tracked, minimizing the
31 documentation burden when e.g. a parameter is renamed.
32 circumstances, 
33 creates stubs and updates documentation in the \fBmdoc\fR(5)
34 documentation format from \fIASSEMBLIES\fR.
35 .PP
36 \fBmdoc update\fR does not rely on documentation found within source code.
37 .PP
38 See \fBmdoc\fR(1) and \fBmdoc\fR(5) for more information.
39 .SH OPTIONS
40 .TP
41 .B \-\-delete
42 Allow \fBmdoc update\fR to delete members from documentation files.  
43 The only members deleted are members which are no longer present within
44 \fIASSEMBLIES\fR and are not present in any other assembly versions.
45 .Sp
46 If a type is no longer present, the documentation file is \fInot\fR
47 deleted, but is instead \fIrenamed\fR to have a \fB.remove \fR extension.
48 .Sp
49 Version detection is done with the \fI//AssemblyVersion\fR elements; if there
50 are no \fI//AssemblyVersion\fR elements for a given \fI<Type>\fR or 
51 \fI<Member/>\fR, then the \fI<Type>\fR will be renamed and/or the 
52 \fI<Member/>\fR will be removed.
53 .TP
54 \fB\-\-exceptions\fR[=\fISOURCES\fR]
55 EXPERIMENTAL.  This is not 100% reliable, but is intended to serve as an aid
56 for documentation writers.
57 .Sp
58 Inspect member bodies to determine what exceptions can be generated from the
59 member.
60 .Sp
61 \fISOURCES\fR is an optional comma-separated list of the following sources
62 that should be searched for exceptions:
63 .Sp
64 .nf
65         all     Find exceptions created in the member itself, 
66                   references to members in the same assembly, 
67                   and references to members in dependent 
68                   assemblies.
69         asm     Find exceptions created in the member itself and
70                   references to members within the same assembly
71                   as the member.
72         depasm  Find exceptions created in the member itself and
73                   references to members within dependent 
74                   assemblies.
75 .fi
76 .Sp
77 If \fISOURCES\fR isn't provided (the default), then only exceptions created 
78 within the member itself will be documented.
79 .Sp
80 LIMITATIONS: Exception searching is currently implemented by looking for the
81 exception types that are explicitly created based on the known compile-time
82 types.  This has the following limitations:
83 .RS
84 .ne 8
85 .TP
86 .B *
87 This will not find exceptions which are implicit to the IL, such as
88 NullReferenceException and IndexOutOfRangeException.
89 .TP
90 .B *
91 This will find exceptions which are \fInot\fR thrown, e.g.
92 .nf
93
94     public void CreateAnException ()
95     {
96         Exception e = new Exception ();
97     }
98
99 .fi
100 .TP
101 .B *
102 This will not "follow" delegate and interface calls:
103 .nf
104
105     public void UsesDelegates ()
106     {
107         Func<int, int> a = x => {throw new Exception ();};
108         a (4);
109     }
110
111 .fi
112 The function \fIUsesDelegates()\fR won't have any exceptions documented.
113 .TP
114 .B *
115 This will find exceptions which "cannot happen", such as
116 ArgumentNullExceptions for arguments which are "known" to be non-null:
117 .nf
118
119     public void A ()
120     {
121         B ("this parameter isn't null");
122     }
123
124     public void B (string s)
125     {
126         if (s == null)
127             throw new ArgumentNullException ("s");
128     }
129
130 .fi
131 For the above, if \fB--exceptions=asm\fR is provided then \fIA()\fR will be
132 documented as throwing an ArgumentNullException, which cannot happen.
133 .ne
134 .RE
135 .TP
136 \fB\-i\fR, \fB\-\-import\fR=\fIFILE\fR
137 Import documentation found within \fIFILE\fR.
138 .Sp
139 \fIFILE\fR may contain either \fIcsc /doc\fR XML or \fIECMA-335\fR XML.
140 .TP
141 \fB\-o\fR, \fB\-\-out\fB=\fIDIRECTORY\fR
142 Place the generated stubs into \fIDIRECTORY\fR.
143 .Sp
144 When updating documentation, \fIDIRECTORY\fR is also the source directory.
145 .TP
146 \fB\-\-since\fR=\fIVERSION\fR
147 When \fIupdating\fR documentation for an assembly, if a type or member is
148 encountered which didn't exist in the previous version of the assembly a
149 \fB<since version="\fR\fIVERSION\fR\fB"/>\fR element will be inserted.
150 .TP
151 \fB\-\-type\fR=\fITYPE\fR
152 Only update documentation for the type \fITYPE\fR.
153 .TP
154 .B \-h, \-?, \-\-help
155 Display a help message and exit.
156 .SH SEE ALSO
157 mdoc(1), 
158 mdoc(5), 
159 mdoc-assemble(1),
160 mdoc-export-html(1),
161 mdoc-validate(1),
162 .SH MAILING LISTS
163 .TP
164 Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details.
165 .SH WEB SITE
166 Visit http://www.mono-project.com for details