Initial import from FreeBSD RELENG_4:
[dragonfly.git] / gnu / usr.bin / rcs / ident / ident.1
1 .de Id
2 .ds Rv \\$3
3 .ds Dt \\$4
4 .ds iD \\$3 \\$4 \\$5 \\$6 \\$7
5 ..
6 .Id $FreeBSD: src/gnu/usr.bin/rcs/ident/ident.1,v 1.5 1999/08/27 23:36:42 peter Exp $
7 .ds r \&\s-1RCS\s0
8 .ds u \&\s-1UTC\s0
9 .if n .ds - \%--
10 .if t .ds - \(em
11 .TH IDENT 1 \*(Dt GNU
12 .SH NAME
13 ident \- identify RCS keyword strings in files
14 .SH SYNOPSIS
15 .B ident
16 [
17 .B \-q
18 ] [
19 .B \-V
20 ] [
21 .I file
22 \&.\|.\|. ]
23 .SH DESCRIPTION
24 .B ident
25 searches for all instances of the pattern
26 .BI $ keyword : "\ text\ " $
27 in the named files or, if no files are named, the standard input.
28 .PP
29 These patterns are normally inserted automatically by the \*r command
30 .BR co (1),
31 but can also be inserted manually.
32 The option
33 .B \-q
34 suppresses
35 the warning given if there are no patterns in a file.
36 The option
37 .B \-V
38 prints
39 .BR ident 's
40 version number.
41 .PP
42 .B ident
43 works on text files as well as object files and dumps.
44 For example, if the C program in
45 .B f.c
46 contains
47 .IP
48 .ft 3
49 #include <stdio.h>
50 .br
51 static char const rcsid[] =
52 .br
53   \&"$\&Id: f.c,v \*(iD $\&";
54 .br
55 int main() { return printf(\&"%s\en\&", rcsid) == EOF; }
56 .ft P
57 .LP
58 and
59 .B f.c
60 is compiled into
61 .BR f.o ,
62 then the command
63 .IP
64 .B "ident  f.c  f.o"
65 .LP
66 will output
67 .nf
68 .IP
69 .ft 3
70 f.c:
71     $\&Id: f.c,v \*(iD $
72 f.o:
73     $\&Id: f.c,v \*(iD $
74 .ft
75 .fi
76 .PP
77 If a C program defines a string like
78 .B rcsid
79 above but does not use it,
80 .BR lint (1)
81 may complain, and some C compilers will optimize away the string.
82 The most reliable solution is to have the program use the
83 .B rcsid
84 string, as shown in the example above.
85 .PP
86 .B ident
87 finds all instances of the
88 .BI $ keyword : "\ text\ " $
89 pattern, even if
90 .I keyword
91 is not actually an \*r-supported keyword.
92 This gives you information about nonstandard keywords like
93 .BR $\&XConsortium$ .
94 .SH KEYWORDS
95 Here is the list of keywords currently maintained by
96 .BR co (1).
97 All times are given in Coordinated Universal Time (\*u,
98 sometimes called \&\s-1GMT\s0) by default, but if the files
99 were checked out with
100 .BR co 's
101 .BI \-z zone
102 option, times are given with a numeric time zone indication appended.
103 .TP
104 .B $\&Author$
105 The login name of the user who checked in the revision.
106 .TP
107 .B $\&Date$
108 The date and time the revision was checked in.
109 .TP
110 .B $\&Header$
111 A standard header containing the full pathname of the \*r file, the
112 revision number, the date and time, the author, the state,
113 and the locker (if locked).
114 .TP
115 .B $\&Id$
116 Same as
117 .BR $\&Header$ ,
118 except that the \*r filename is without a path.
119 .TP
120 .B $\&Locker$
121 The login name of the user who locked the revision (empty if not locked).
122 .TP
123 .B $\&Log$
124 The log message supplied during checkin.
125 For
126 .BR ident 's
127 purposes, this is equivalent to
128 .BR $\&RCSfile$ .
129 .TP
130 .B $\&Name$
131 The symbolic name used to check out the revision, if any.
132 .TP
133 .B $\&RCSfile$
134 The name of the \*r file without a path.
135 .TP
136 .B $\&Revision$
137 The revision number assigned to the revision.
138 .TP
139 .B $\&Source$
140 The full pathname of the \*r file.
141 .TP
142 .B $\&State$
143 The state assigned to the revision with the
144 .B \-s
145 option of
146 .BR rcs (1)
147 or
148 .BR ci (1).
149 .PP
150 .BR co (1)
151 represents the following characters in keyword values by escape sequences
152 to keep keyword strings well-formed.
153 .LP
154 .RS
155 .nf
156 .ne 6
157 .ta \w'newline  'u
158 \f2char escape sequence\fP
159 tab     \f3\et\fP
160 newline \f3\en\fP
161 space   \f3\e040
162 $       \e044
163 \e      \e\e\fP
164 .fi
165 .RE
166 .SH IDENTIFICATION
167 Author: Walter F. Tichy.
168 .br
169 Manual Page Revision: \*(Rv; Release Date: \*(Dt.
170 .br
171 Copyright \(co 1982, 1988, 1989 Walter F. Tichy.
172 .br
173 Copyright \(co 1990, 1992, 1993 Paul Eggert.
174 .SH "SEE ALSO"
175 ci(1), co(1), rcs(1), rcsdiff(1), rcsintro(1), rcsmerge(1), rlog(1),
176 rcsfile(5)
177 .br
178 Walter F. Tichy,
179 \*r\*-A System for Version Control,
180 .I "Software\*-Practice & Experience"
181 .BR 15 ,
182 7 (July 1985), 637-654.