diff options
author | Igor Sobrado <sobrado@cvs.openbsd.org> | 2007-09-16 18:13:58 +0000 |
---|---|---|
committer | Igor Sobrado <sobrado@cvs.openbsd.org> | 2007-09-16 18:13:58 +0000 |
commit | 07b358d6597d3bf69927a04de264d66f635b1202 (patch) | |
tree | fa5c64d17111999e24ae5dbf0e7f36a9e7d0e9d3 | |
parent | 7cb35f77a49c3590b46c64d12f742004bff4e5f0 (diff) |
"source" and "target" can be either files or directories;
cp(1) and ln(1) must have a synopsis consistent with mkdir(1),
mv(1), rmdir(1) and others
ok jmc@, millert@, otto@
-rw-r--r-- | bin/cp/cp.1 | 30 | ||||
-rw-r--r-- | bin/cp/utils.c | 8 | ||||
-rw-r--r-- | bin/ln/ln.1 | 26 | ||||
-rw-r--r-- | bin/ln/ln.c | 8 |
4 files changed, 37 insertions, 35 deletions
diff --git a/bin/cp/cp.1 b/bin/cp/cp.1 index ca30fbc18ff..266d6918d36 100644 --- a/bin/cp/cp.1 +++ b/bin/cp/cp.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: cp.1,v 1.28 2007/05/31 19:19:14 jmc Exp $ +.\" $OpenBSD: cp.1,v 1.29 2007/09/16 18:13:57 sobrado Exp $ .\" $NetBSD: cp.1,v 1.9 1995/07/25 19:36:45 jtc Exp $ .\" .\" Copyright (c) 1989, 1990, 1993, 1994 @@ -33,7 +33,7 @@ .\" .\" @(#)cp.1 8.3 (Berkeley) 4/18/94 .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: September 16 2007 $ .Dt CP 1 .Os .Sh NAME @@ -46,26 +46,27 @@ .Fl R .Op Fl H | L | P .Oc -.Ar source_file target_file +.Ar source target .Nm cp .Op Fl fip .Oo .Fl R .Op Fl H | L | P .Oc -.Ar source_file ... target_directory +.Ar source ... directory .Sh DESCRIPTION In the first synopsis form, the .Nm utility copies the contents of the -.Ar source_file -to the -.Ar target_file . +.Ar source +file to the +.Ar target +file. In the second synopsis form, the contents of each named -.Ar source_file -are copied to the destination -.Ar target_directory . +.Ar source +file are copied to the destination +.Ar directory . The names of the files themselves are not changed. If .Nm @@ -117,7 +118,7 @@ the set-user-ID nor set-group-ID bits are preserved in the copy's permissions. .It Fl R If -.Ar source_file +.Ar source designates a directory, .Nm copies the directory and the entire subtree connected at that point. @@ -143,9 +144,10 @@ overwritten if permissions allow, but its mode, user ID, and group ID are unchanged. .Pp In the second synopsis form, -.Ar target_directory -must exist unless there is only one named -.Ar source_file +the destination specified by the +.Ar directory +operand must exist unless there is only one named +.Ar source which is a directory and the .Fl R flag is specified. diff --git a/bin/cp/utils.c b/bin/cp/utils.c index fa62660fe76..4b89796df6c 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utils.c,v 1.27 2007/04/06 06:50:00 tedu Exp $ */ +/* $OpenBSD: utils.c,v 1.28 2007/09/16 18:13:57 sobrado Exp $ */ /* $NetBSD: utils.c,v 1.6 1997/02/26 14:40:51 cgd Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94"; #else -static char rcsid[] = "$OpenBSD: utils.c,v 1.27 2007/04/06 06:50:00 tedu Exp $"; +static char rcsid[] = "$OpenBSD: utils.c,v 1.28 2007/09/16 18:13:57 sobrado Exp $"; #endif #endif /* not lint */ @@ -324,9 +324,9 @@ void usage(void) { (void)fprintf(stderr, - "usage: %s [-fip] [-R [-H | -L | -P]] source_file target_file\n", __progname); + "usage: %s [-fip] [-R [-H | -L | -P]] source target\n", __progname); (void)fprintf(stderr, - " %s [-fip] [-R [-H | -L | -P]] source_file ... target_directory\n", + " %s [-fip] [-R [-H | -L | -P]] source ... directory\n", __progname); exit(1); } diff --git a/bin/ln/ln.1 b/bin/ln/ln.1 index b58c8456de7..570a0528f5f 100644 --- a/bin/ln/ln.1 +++ b/bin/ln/ln.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ln.1,v 1.24 2007/05/31 19:19:14 jmc Exp $ +.\" $OpenBSD: ln.1,v 1.25 2007/09/16 18:13:57 sobrado Exp $ .\" $NetBSD: ln.1,v 1.10 1995/07/25 19:37:04 jtc Exp $ .\" .\" Copyright (c) 1980, 1990, 1993 @@ -33,7 +33,7 @@ .\" .\" @(#)ln.1 8.2 (Berkeley) 12/30/93 .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: September 16 2007 $ .Dt LN 1 .Os .Sh NAME @@ -42,12 +42,12 @@ .Sh SYNOPSIS .Nm ln .Op Fl fhns -.Ar sourcefile -.Op Ar targetfile +.Ar source +.Op Ar target .Nm ln .Op Fl fs -.Ar sourcefile ...\& -.Op Ar targetdir +.Ar source ...\& +.Op Ar directory .Sh DESCRIPTION The .Nm @@ -105,21 +105,21 @@ non-existent files. Given one or two arguments, .Nm creates a link to an existing file -.Ar sourcefile . +.Ar source . If -.Ar targetfile +.Ar target is given, the link has that name; -.Ar targetfile +.Ar target may also be a directory in which to place the link. Otherwise, it is placed in the current directory. If only the directory is specified, the link will be made to the last component of -.Ar sourcefile . +.Ar source . .Pp Given more than two arguments, .Nm makes links in -.Ar targetdir +.Ar directory to all the named source files. The links made will have the same name as the files being linked to. .Pp @@ -208,7 +208,7 @@ utility appeared in .At v3 . .Sh CAVEATS Since the -.Ar sourcefile -must have its link count incremented, a hard link cannot be created to a +.Ar source +file must have its link count incremented, a hard link cannot be created to a file which is flagged immutable or append-only (see .Xr chflags 1 ) . diff --git a/bin/ln/ln.c b/bin/ln/ln.c index c042ac87ebe..25a8386282c 100644 --- a/bin/ln/ln.c +++ b/bin/ln/ln.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ln.c,v 1.15 2007/07/31 03:03:12 ray Exp $ */ +/* $OpenBSD: ln.c,v 1.16 2007/09/16 18:13:57 sobrado Exp $ */ /* $NetBSD: ln.c,v 1.10 1995/03/21 09:06:10 cgd Exp $ */ /* @@ -40,7 +40,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94"; #else -static const char rcsid[] = "$OpenBSD: ln.c,v 1.15 2007/07/31 03:03:12 ray Exp $"; +static const char rcsid[] = "$OpenBSD: ln.c,v 1.16 2007/09/16 18:13:57 sobrado Exp $"; #endif #endif /* not lint */ @@ -204,8 +204,8 @@ usage(void) extern char *__progname; (void)fprintf(stderr, - "usage: %s [-fhns] sourcefile [targetfile]\n" - " %s [-fs] sourcefile ... [targetdir]\n", + "usage: %s [-fhns] source [target]\n" + " %s [-fs] source ... [directory]\n", __progname, __progname); exit(1); } |