Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Nov 1998 15:00:27 -0500 (EST)
From:      jcplace@ibm.net
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/8880: cp missing verbose switch
Message-ID:  <199811282000.PAA00675@ibm.net.>

next in thread | raw e-mail | index | archive | help

>Number:         8880
>Category:       bin
>Synopsis:       cp missing verbose switch
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 28 12:10:01 PST 1998
>Last-Modified:
>Originator:     John C. Place
>Organization:
>Release:        FreeBSD 2.2.7-RELEASE i386
>Environment:

	

>Description:
Something I miss is verbose option (-v) on cp,mv,rm to let me see what
is hapening.  


>How-To-Repeat:

	

>Fix:
	Small changes to cp.c and utils.c

--- cp.org	Wed Nov 25 04:08:44 1998
+++ cp.c	Wed Nov 25 04:48:53 1998
@@ -86,7 +86,7 @@
 PATH_T to = { to.p_path, "" };
 
 uid_t myuid;
-int Rflag, iflag, pflag, rflag, fflag;
+int Rflag, iflag, pflag, rflag, vflag, fflag;
 int myumask;
 
 enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
@@ -105,7 +105,7 @@
 	char *target;
 
 	Hflag = Lflag = Pflag = 0;
-	while ((ch = getopt(argc, argv, "HLPRfipr")) != -1)
+	while ((ch = getopt(argc, argv, "HLPRfiprv")) != -1)
 		switch (ch) {
 		case 'H':
 			Hflag = 1;
@@ -135,6 +135,9 @@
 			break;
 		case 'r':
 			rflag = 1;
+			break;
+		case 'v':
+			vflag = 1;
 			break;
 		default:
 			usage();


--- utils.org	Wed Nov 25 04:44:01 1998
+++ utils.c	Sat Nov 28 10:03:40 1998
@@ -115,6 +115,10 @@
 		return (1);;
 	}
 
+	if (vflag) { 
+		(void)fprintf(stderr,"Copying %s to %s\n", entp->fts_path, to.p_path);
+	}
+
 	rval = 0;
 
 	/*
@@ -319,7 +323,7 @@
 usage()
 {
 	(void)fprintf(stderr, "%s\n%s\n",
-"usage: cp [-R [-H | -L | -P]] [-f | -i] [-p] src target",
-"       cp [-R [-H | -L | -P]] [-f | -i] [-p] src1 ... srcN directory");
+"usage: cp [-R [-H | -L | -P]] [-f | -i] [-p] [-v] src target",
+"       cp [-R [-H | -L | -P]] [-f | -i] [-p] [-v] src1 ... srcN directory");
 	exit(1);
 }
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811282000.PAA00675>