fix example, synopsis line
[unix-history] / usr / src / usr.bin / sccs / sccs.1
CommitLineData
b5dc1377 1.\" Copyright (c) 1983, 1990 The Regents of the University of California.
179426e1 2.\" All rights reserved.
e1920121 3.\"
4808ee96 4.\" %sccs.include.redist.roff%
e1920121 5.\"
4808ee96 6.\" @(#)sccs.1 2.10 (Berkeley) %G%
179426e1 7.\"
b5dc1377 8.Dd
b5dc1377
CL
9.Dt SCCS 1
10.Os BSD 4.2
11.Sh NAME
12.Nm sccs
13.Nd front end for the
14.Li SCCS
15subsystem
16.Sh SYNOPSIS
17.Nm sccs
18.Op Fl r
19.Op Fl d Ar path
20.Op Fl p Ar path
21.Ar command
4808ee96
CL
22.Op flags
23.Op Ar
b5dc1377
CL
24.Sh DESCRIPTION
25.Nm Sccs
26is a front end to the
27.Li SCCS
2de7ab2b 28programs
b5dc1377
CL
29that
30helps them mesh more cleanly
31with
32the rest of UNIX.
33It
34also includes the capability to run
35.Dq set user id
36to another user
37to
38provide additional protection.
39.Pp
39ae1365 40Basically,
b5dc1377
CL
41.Nm sccs
42runs the command with the specified
43.Ar flags
39ae1365 44and
b5dc1377
CL
45.Ar args .
46Each argument is normally modified to be prepended with
47.Dq Li SCCS/s. .
48.Pp
39ae1365 49Flags to be interpreted by the
b5dc1377 50.Nm sccs
39ae1365 51program must be before the
b5dc1377 52.Ar command
39ae1365
EA
53argument.
54Flags to be passed to the actual
b5dc1377
CL
55.Li SCCS
56program must come after the
57.Ar command
39ae1365 58argument.
b5dc1377
CL
59These flags are specific to the command and
60are discussed in the documentation for that command.
61.Pp
9e6171bb 62Besides the usual
b5dc1377 63.Li SCCS
9e6171bb 64commands,
b5dc1377
CL
65several
66.Dq pseudo-commands
67can be issued.
9e6171bb 68These are:
4808ee96
CL
69.Bl -tag -width deledit
70.It Cm edit
b5dc1377
CL
71Equivalent
72to
73.Dq Li get \-e .
4808ee96 74.It Cm delget
b5dc1377
CL
75Perform a delta on the named files and
76then get new versions.
77The new versions will have id keywords expanded, and
78will not be editable.
79The
80.Fl m ,
81.Fl p ,
82.Fl r ,
83.Fl s ,
84and
85.Fl y
86flags will be passed to
87.Nm delta ,
88and the
89.Fl b,
90.Fl c ,
91.Fl e ,
92.Fl i ,
93.Fl k ,
94.Fl l ,
95.Fl s ,
96.\" anybody who has a bad xterm which is almost anyone
b5dc1377
CL
97and
98.Fl x
99flags will be passed to get.
4808ee96 100.It Cm deledit
b5dc1377
CL
101Equivalent
102to
103.Nm delget
104except that the
105.Nm get
106phase includes the
107.Fl e
108flag.
109This
110option is useful for making a
111.Em checkpoint
112of your current editing phase. The same flags will be passed to delta
113as described above, and
114all the flags listed for
115.om get
116above except
117.Fl e
118and
119.Fl k
120are
121passed to
122.Nm edit .
4808ee96 123.It Cm create
b5dc1377
CL
124Creates
125an
126.Li SCCS
127file ,
128taking
129the initial contents from the file of the same name.
130Any
131flags to
132.Nm admin
133are accepted. If the creation is successful,
9be60522 134the files are renamed with a comma on the front.
b5dc1377
CL
135These should be removed when you are convinced that the
136.Li SCCS
137files
138have been created successfully.
4808ee96 139.It Cm fix
b5dc1377
CL
140Must
141be followed by a
142.Fl r
9e6171bb 143flag.
b5dc1377
CL
144This command essentially removes the named delta, but
145leaves you with a copy of the delta
146with the changes that were in it. It
147is useful for fixing small compiler bugs, etc.
148Since it doesn't leave audit trails, it should be used carefully.
4808ee96 149.It Cm clean
9e6171bb
EA
150This routine removes everything from the current directory
151that can be recreated from SCCS files.
c3a8e591 152It will not remove any files being edited.
28ad8b5d 153If the
b5dc1377
CL
154.Fl b
155flag is given, branches are ignored in the determination of
156whether they are being edited; this
157is dangerous if you are keeping the branches in the
28ad8b5d 158same directory.
4808ee96 159.It Cm unedit
b5dc1377
CL
160This
161is the opposite of an
162.Nm edit
163or
164a
165.Dq Li get \-e .
166It should be used with extreme caution, since
167any changes you made since the get will be irretrievably lost.
4808ee96 168.It Cm info
c3a8e591 169Gives a listing of all files being edited.
28ad8b5d 170If the
b5dc1377
CL
171.Fl b
172flag
173is given, branches (i.e.,
4808ee96 174.Li SID Ns \&\'s
b5dc1377
CL
175with two or fewer components)
176are ignored. If the
177.Fl u
178flag is given (with an optional argument) then
179only files being edited by you (or the named user) are listed.
4808ee96 180.It Cm check
b5dc1377
CL
181Like
182.Nm info
183except that nothing is printed if nothing is being edited, and
184a non-zero exit status is returned if anything is being edited.
185The intent is to have this included in an
186.Em install
187entry in a makefile to insure that everything is included into the
188.Li SCCS
189file before a version is installed.
4808ee96 190.It Cm tell
b5dc1377
CL
191Gives a newline-separated list of the files being edited
192on the standard output. Takes the
193.Fl b
194and
195.Fl u
196flags like
197.Nm info
6aac25be 198and
b5dc1377 199.Nm check .
4808ee96 200.It Cm diffs
b5dc1377
CL
201Gives a
202.Nm diff
203listing between the current version of the
204program(s) you have out for editing and the versions in
205.Li SCCS
ecf8b19b 206format.
63fe484d 207The
b5dc1377
CL
208.Fl r ,
209.Fl c ,
210.Fl i ,
211.Fl x ,
63fe484d 212and
b5dc1377 213.Fl t
63fe484d 214flags are passed to
b5dc1377
CL
215.if n \{\
216. br
217.\}
218.Nm get ;
219the
220.Fl l ,
221.Fl s ,
222.Fl e ,
223.Fl f ,
224.Fl h ,
63fe484d 225and
b5dc1377 226.Fl b
63fe484d 227options are passed to
b5dc1377
CL
228.if n \{\
229. br
230.\}
231.Nm diff .
63fe484d 232The
b5dc1377 233.Fl C
63fe484d 234flag is passed to
b5dc1377 235.Nm diff
63fe484d 236as
b5dc1377 237.Fl c .
4808ee96 238.It Cm print
23320296
EA
239This command prints out verbose information
240about the named files.
b5dc1377 241.Pp
4808ee96 242.It Fl r
b5dc1377
CL
243Runs
244.Nm sccs
245as the real user rather than as whatever effective user
246.Nm sccs
247is
248.Dq Li set user id
249to.
4808ee96 250.It Fl d
b5dc1377
CL
251Specifies a root directory for the
252.Li SCCS
c3a8e591
EA
253files.
254The default is the current directory.
b5dc1377
CL
255If environment variable
256.Ev PROJECT
257is set,
258it will be used to determine the
259.Fl d
260flag.
4808ee96
CL
261.It Fl p
262Defines the pathname of the directory in which the
b5dc1377 263.Li SCCS
c3a8e591 264files will be found;
b5dc1377
CL
265.Dq Li SCCS
266is the default.
e5b52011 267The
b5dc1377
CL
268.Fl p
269flag
270differs from the
271.Fl d
272flag
273in that the
274.Fl d
275argument is prepended to the entire pathname and the
276.Fl p
277argument is inserted before the final component of the pathname.
e5b52011 278For example,
b5dc1377 279.Dq Li sccs \-d/x \-py get a/b
e5b52011 280will convert to
b5dc1377 281.Dq Li get /x/a/y/s.b .
e5b52011 282The intent here is to create aliases such as
b5dc1377
CL
283.Dq Li alias syssccs sccs -d/usr/src
284which
285will be used as
286.Dq Li syssccs get cmd/who.c .
287.Pp
288Certain
289commands (such as
290.Nm admin )
291cannot be run
292.Dq Li set user id
293by all users, since this would allow anyone to change the authorizations.
af83554c 294These commands are always run as the real user.
b5dc1377 295.Sh EXAMPLES
c3a8e591 296To get a file for editing,
39ae1365
EA
297edit it,
298and produce a new delta:
b5dc1377
CL
299.Pp
300.Dl sccs get \-e file.c
301.Dl ex file.c
302.Dl sccs delta file.c
303.Pp
39ae1365 304To get a file from another directory:
b5dc1377
CL
305.Pp
306.Dl sccs \-p/usr/src/sccs/s. get cc.c
307.Pp
39ae1365 308or
b5dc1377
CL
309.Pp
310.Dl sccs get /usr/src/sccs/s.cc.c
311.Pp
39ae1365
EA
312To make a delta of a large number of files
313in the current directory:
b5dc1377
CL
314.Pp
315.Dl sccs delta *.c
316.Pp
6aac25be 317To get a list of files being edited that are not on branches:
b5dc1377
CL
318.Pp
319.Dl sccs info \-b
320.Pp
6aac25be 321To delta everything being edited by you:
b5dc1377
CL
322.Pp
323.Dl sccs delta \`sccs tell \-u\`
324.Pp
39ae1365
EA
325In a makefile, to get source files
326from an
b5dc1377 327.Li SCCS
39ae1365 328file if it does not already exist:
b5dc1377
CL
329.Pp
330.Dl SRCS = <list of source files>
331.Dl $(SRCS):
332.Dl \&\tsccs get $(REL) $@
333.Sh ENVIRONMENT
4808ee96
CL
334.Bl -tag -width Ar
335.It Ev PROJECT
b5dc1377
CL
336The PROJECT environment variable is checked by the
337.Fl d
338flag. If
339it begins with a slash, it is taken directly; otherwise,
340the home directory of a user of that name is
341examined for a subdirectory
342.Dq Li src
343or
344.Dq Li source .
345If such a directory is found, it is used.
4808ee96 346.El
b5dc1377
CL
347.Sh SEE ALSO
348.Xr what 1
349.Xr admin SCCS ,
350.Xr chghist SCCS ,
351.Xr comb SCCS ,
352.Xr delta SCCS ,
353.Xr get SCCS ,
354.Xr help SCCS ,
355.Xr prt SCCS ,
356.Xr rmdel SCCS ,
357.Xr sccsdiff SCCS ,
4808ee96
CL
358.Rs
359.%A Eric Allman
360.%T "An Introduction to the Source Code Control System"
361.Re
b5dc1377 362.Sh HISTORY
4808ee96
CL
363The
364.Nm sccs
365command
366appeared in
367.Bx 4.3 .
b5dc1377 368.Sh BUGS
d35f5db1
EA
369It should be able to take directory arguments on pseudo-commands
370like the
b5dc1377 371.Li SCCS
d35f5db1 372commands do.