diff options
| author | Michael Haro <mharo@FreeBSD.org> | 1999-08-29 07:58:19 +0000 |
|---|---|---|
| committer | Michael Haro <mharo@FreeBSD.org> | 1999-08-29 07:58:19 +0000 |
| commit | fcb2f1b3895c0a0b2244385c164fe80a95ce695c (patch) | |
| tree | b20ea8070cbe5feadda970d33954a3e53201d3d1 /bin/cp | |
| parent | a8c345fb03ba0f5653ecb1ebb0be5391a5cbe8cd (diff) | |
Notes
Diffstat (limited to 'bin/cp')
| -rw-r--r-- | bin/cp/cp.1 | 6 | ||||
| -rw-r--r-- | bin/cp/cp.c | 4 | ||||
| -rw-r--r-- | bin/cp/utils.c | 8 |
3 files changed, 7 insertions, 11 deletions
diff --git a/bin/cp/cp.1 b/bin/cp/cp.1 index 29a997f4e540..f51a28ee33dd 100644 --- a/bin/cp/cp.1 +++ b/bin/cp/cp.1 @@ -48,8 +48,7 @@ .Op Fl H | Fl L | Fl P .Oc .Op Fl f | i -.Op Fl p -.Op Fl v +.Op Fl pv .Ar source_file target_file .Nm cp .Oo @@ -57,8 +56,7 @@ .Op Fl H | Fl L | Fl P .Oc .Op Fl f | i -.Op Fl p -.Op Fl v +.Op Fl pv .Ar source_file ... target_directory .Sh DESCRIPTION In the first synopsis form, the diff --git a/bin/cp/cp.c b/bin/cp/cp.c index 488e7d81d0ed..9b5c05fd5139 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -378,8 +378,6 @@ copy(argv, type, fts_options) if (mkdir(to.p_path, curr->fts_statp->st_mode | S_IRWXU) < 0) err(1, "%s", to.p_path); - if (vflag) - printf("%s -> %s\n", curr->fts_path, to.p_path); } else if (!S_ISDIR(to_stat.st_mode)) { errno = ENOTDIR; err(1, "%s", to.p_path); @@ -420,6 +418,8 @@ copy(argv, type, fts_options) rval = 1; break; } + if (!rval && vflag) + (void)printf("%s -> %s\n", curr->fts_path, to.p_path); } if (errno) err(1, "fts_read"); diff --git a/bin/cp/utils.c b/bin/cp/utils.c index 2c02947cdd59..368886a22f3c 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -118,9 +118,6 @@ copy_file(entp, dne) rval = 0; - if (vflag) - printf("%s -> %s\n",entp->fts_path, to.p_path); - /* * Mmap and write if less than 8M (the limit is so we don't totally * trash memory on big files. This is really a minor hack, but it @@ -323,8 +320,9 @@ setfile(fs, fd) void usage() { + (void)fprintf(stderr, "%s\n%s\n", -"usage: cp [-R [-H | -L | -P]] [-f | -i] [-p] [-v] src target", -" cp [-R [-H | -L | -P]] [-f | -i] [-p] [-v] src1 ... srcN directory"); +"usage: cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target", +" cp [-R [-H | -L | -P]] [-f | -i] [-pv] src1 ... srcN directory"); exit(1); } |
