# HG changeset patch # User Rob Landley # Date 1207796480 18000 # Node ID a08f1affe01674af204ff85e1bf89cedace25e84 # Parent 1c160cadf5b9ddea9f2d8bbf87ebd1fb67f3a0d4 Add -v to cp. diff -r 1c160cadf5b9 -r a08f1affe016 toys/cp.c --- a/toys/cp.c Wed Apr 09 00:22:04 2008 -0500 +++ b/toys/cp.c Wed Apr 09 22:01:20 2008 -0500 @@ -7,7 +7,7 @@ * See http://www.opengroup.org/onlinepubs/009695399/utilities/cp.html * * "R+ra+d+p+r" -USE_CP(NEWTOY(cp, "<2slrR+rdpa+d+p+rHLPif", TOYFLAG_BIN)) +USE_CP(NEWTOY(cp, "<2vslrR+rdpa+d+p+rHLPif", TOYFLAG_BIN)) config CP bool "cp" @@ -25,6 +25,7 @@ -d don't dereference symlinks -a same as -dpr -l hard link instead of copying + -v verbose */ #include "toys.h" @@ -41,6 +42,7 @@ #define FLAG_r 512 #define FLAG_l 1024 // todo #define FLAG_s 2048 // todo +#define FLAG_v 4098 DEFINE_GLOBALS( char *destname; @@ -57,6 +59,9 @@ { int fdout = -1; + if (toys.optflags & FLAG_v) + printf("'%s' -> '%s'\n", src, dst); + // Copy directory or file to destination. if (S_ISDIR(srcst->st_mode)) {