* getopt returns -1 not EOF
* cleanup use of .Nm in manpage
This commit is contained in:
parent
aa125494d1
commit
df49b6cc7f
24
bin/cp/cp.1
24
bin/cp/cp.1
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: cp.1,v 1.9 1995/07/25 19:36:45 jtc Exp $
|
||||
.\" $NetBSD: cp.1,v 1.10 1997/09/14 07:15:25 lukem Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1989, 1990, 1993, 1994
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
|
@ -43,14 +43,14 @@
|
|||
.Nm cp
|
||||
.Nd copy files
|
||||
.Sh SYNOPSIS
|
||||
.Nm cp
|
||||
.Nm
|
||||
.Oo
|
||||
.Fl R
|
||||
.Op Fl H | Fl L | Fl P
|
||||
.Oc
|
||||
.Op Fl fip
|
||||
.Ar source_file target_file
|
||||
.Nm cp
|
||||
.Nm
|
||||
.Oo
|
||||
.Fl R
|
||||
.Op Fl H | Fl L | Fl P
|
||||
|
@ -59,7 +59,7 @@
|
|||
.Ar source_file ... target_directory
|
||||
.Sh DESCRIPTION
|
||||
In the first synopsis form, the
|
||||
.Nm cp
|
||||
.Nm
|
||||
utility copies the contents of the
|
||||
.Ar source_file
|
||||
to the
|
||||
|
@ -71,7 +71,7 @@ is copied to the destination
|
|||
.Ar target_directory .
|
||||
The names of the files themselves are not changed.
|
||||
If
|
||||
.Nm cp
|
||||
.Nm
|
||||
detects an attempt to copy a file to itself, the copy will fail.
|
||||
.Pp
|
||||
The following options are available:
|
||||
|
@ -93,11 +93,11 @@ option is specified, no symbolic links are followed.
|
|||
If
|
||||
.Ar source_file
|
||||
designates a directory,
|
||||
.Nm cp
|
||||
.Nm
|
||||
copies the directory and the entire subtree connected at that point.
|
||||
This option also causes symbolic links to be copied, rather than
|
||||
indirected through, and for
|
||||
.Nm cp
|
||||
.Nm
|
||||
to create special files rather than copying them as normal files.
|
||||
Created directories have the same mode as the corresponding source
|
||||
directory, unmodified by the process' umask.
|
||||
|
@ -112,7 +112,7 @@ option is ignored if the
|
|||
option is specified.)
|
||||
.It Fl i
|
||||
Causes
|
||||
.Nm cp
|
||||
.Nm
|
||||
to write a prompt to the standard error output before copying a file
|
||||
that would overwrite an existing file.
|
||||
If the response from the standard input begins with the character
|
||||
|
@ -120,7 +120,7 @@ If the response from the standard input begins with the character
|
|||
the file copy is attempted.
|
||||
.It Fl p
|
||||
Causes
|
||||
.Nm cp
|
||||
.Nm
|
||||
to preserve in the copy as many of the modification time, access time,
|
||||
file flags, file mode, user ID, and group ID as allowed by permissions.
|
||||
.Pp
|
||||
|
@ -188,11 +188,11 @@ option is specified.
|
|||
In addition, these options override each other and the
|
||||
command's actions are determined by the last one specified.
|
||||
.Pp
|
||||
.Nm Cp
|
||||
.Nm
|
||||
exits 0 on success, >0 if an error occurred.
|
||||
.Sh COMPATIBILITY
|
||||
Historic versions of the
|
||||
.Nm cp
|
||||
.Nm
|
||||
utility had a
|
||||
.Fl r
|
||||
option.
|
||||
|
@ -207,7 +207,7 @@ or fifo's.
|
|||
.Xr symlink 7
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm cp
|
||||
.Nm
|
||||
utility is expected to be
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cp.c,v 1.18 1997/07/20 05:13:36 thorpej Exp $ */
|
||||
/* $NetBSD: cp.c,v 1.19 1997/09/14 07:15:28 lukem Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1993, 1994
|
||||
|
@ -47,7 +47,7 @@ __COPYRIGHT(
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)cp.c 8.5 (Berkeley) 4/29/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: cp.c,v 1.18 1997/07/20 05:13:36 thorpej Exp $");
|
||||
__RCSID("$NetBSD: cp.c,v 1.19 1997/09/14 07:15:28 lukem Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -111,7 +111,7 @@ main(argc, argv)
|
|||
char *target;
|
||||
|
||||
Hflag = Lflag = Pflag = Rflag = 0;
|
||||
while ((ch = getopt(argc, argv, "HLPRfipr")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "HLPRfipr")) != -1)
|
||||
switch (ch) {
|
||||
case 'H':
|
||||
Hflag = 1;
|
||||
|
|
Loading…
Reference in New Issue