diff options
| author | Gavin Atkinson <gavin@FreeBSD.org> | 2010-03-14 16:03:36 +0000 |
|---|---|---|
| committer | Gavin Atkinson <gavin@FreeBSD.org> | 2010-03-14 16:03:36 +0000 |
| commit | dc82e6ff42e48f15dbd219e64392421e8f3eae5e (patch) | |
| tree | 9edf4cfc68af1ae836841d5af196fc7b7725a630 | |
| parent | 33878b41be7ec000aae6b589d8a4aec88887ba1a (diff) | |
Notes
| -rw-r--r-- | bin/cp/cp.1 | 8 | ||||
| -rw-r--r-- | bin/cp/cp.c | 7 | ||||
| -rw-r--r-- | bin/cp/utils.c | 4 |
3 files changed, 12 insertions, 7 deletions
diff --git a/bin/cp/cp.1 b/bin/cp/cp.1 index 7329b64aca50..fc5a9f73ad65 100644 --- a/bin/cp/cp.1 +++ b/bin/cp/cp.1 @@ -32,7 +32,7 @@ .\" @(#)cp.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 27, 2006 +.Dd January 17, 2010 .Dt CP 1 .Os .Sh NAME @@ -45,7 +45,7 @@ .Op Fl H | Fl L | Fl P .Oc .Op Fl f | i | n -.Op Fl alpv +.Op Fl alpvx .Ar source_file target_file .Nm .Oo @@ -53,7 +53,7 @@ .Op Fl H | Fl L | Fl P .Oc .Op Fl f | i | n -.Op Fl alpv +.Op Fl alpvx .Ar source_file ... target_directory .Sh DESCRIPTION In the first synopsis form, the @@ -183,6 +183,8 @@ permissions. Cause .Nm to be verbose, showing files as they are copied. +.It Fl x +File system mount points are not traversed. .El .Pp For each destination file that already exists, its contents are diff --git a/bin/cp/cp.c b/bin/cp/cp.c index e3238133cd9b..a1f6feabc4c0 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -101,8 +101,9 @@ main(int argc, char *argv[]) int Hflag, Lflag, Pflag, ch, fts_options, r, have_trailing_slash; char *target; + fts_options = FTS_NOCHDIR | FTS_PHYSICAL; Hflag = Lflag = Pflag = 0; - while ((ch = getopt(argc, argv, "HLPRafilnprv")) != -1) + while ((ch = getopt(argc, argv, "HLPRafilnprvx")) != -1) switch (ch) { case 'H': Hflag = 1; @@ -150,6 +151,9 @@ main(int argc, char *argv[]) case 'v': vflag = 1; break; + case 'x': + fts_options |= FTS_XDEV; + break; default: usage(); break; @@ -160,7 +164,6 @@ main(int argc, char *argv[]) if (argc < 2) usage(); - fts_options = FTS_NOCHDIR | FTS_PHYSICAL; if (Rflag && rflag) errx(1, "the -R and -r options may not be specified together"); if (rflag) diff --git a/bin/cp/utils.c b/bin/cp/utils.c index d64fc7d6b2be..357c6111598f 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -429,8 +429,8 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", -"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file target_file", -" cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file ... " +"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file target_file", +" cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file ... " "target_directory"); exit(EX_USAGE); } |
