sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit af627b21fdb94e8330af06e1120628119cc463ef
parent 43f9291e1d4b94d70326b37ee3dc64c61ba68028
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri May  8 12:28:51 +0200

tar: add verbose flag (-v)

Diffstat:
tar.c | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tar.c b/tar.c @@ -65,7 +65,7 @@ static int tarfd; static ino_t tarinode; static dev_t tardev; -static int mflag; +static int mflag, vflag; static int filtermode; static void @@ -326,6 +326,8 @@ static void c(const char *path, struct stat *st, void *data, struct recursor *r) { archive(path); + if (vflag) + puts(path); if (st && S_ISDIR(st->st_mode)) recurse(path, NULL, r); @@ -429,6 +431,8 @@ xt(int argc, char *argv[], int (*fn)(char *, ssize_t, char[BLKSIZ])) } fn(fname, size, b); + if (vflag && mode != 't') + puts(fname); } if (!mflag) { @@ -482,6 +486,9 @@ main(int argc, char *argv[]) case 'h': r.follow = 'L'; break; + case 'v': + vflag = 1; + break; default: usage(); } ARGEND;