diff options
author | Dean Jansa <djansa@redhat.com> | 2005-09-13 21:49:10 +0000 |
---|---|---|
committer | Nathan Straz <nstraz@redhat.com> | 2008-09-23 09:37:44 -0400 |
commit | bd083c50264fcefcf4454401793c0dc43e8a3d62 (patch) | |
tree | 5cc31873162f932dafe7a5c33cd0bd067482227f /qacp.c | |
parent | dc0208b08c7df7c0e559b021bdffcebdb2dc221e (diff) | |
download | qarsh-bd083c50264fcefcf4454401793c0dc43e8a3d62.tar.gz qarsh-bd083c50264fcefcf4454401793c0dc43e8a3d62.tar.xz qarsh-bd083c50264fcefcf4454401793c0dc43e8a3d62.zip |
Clean up printing of file xfers.
Diffstat (limited to 'qacp.c')
-rw-r--r-- | qacp.c | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -32,6 +32,7 @@ /* Globals */ int qacp_fd = -1; /* The control connection to qacpd */ +short quiet = 0; void usage() @@ -156,6 +157,10 @@ qacp_sendonefile(const char *host, const char *srcfile, const char *destfile) exit(125); } + if (!quiet) { + printf("%-30.30s -> %s:%s\n", srcfile, host, destfile); + } + return; } @@ -246,13 +251,17 @@ qacp_recvonefile(const char *host, const char *srcfile, const char *destfile) close(qacp_fd); exit(125); } + + if (!quiet) { + printf("%s:%s -> %30.30s\n", host, srcfile, destfile); + } return; } int -recvfiles(char **argv, int argc, int fileidx, short recursive, short quiet) +recvfiles(char **argv, int argc, int fileidx, short recursive) { char *cp; char *rhost = NULL; @@ -392,10 +401,6 @@ recvfiles(char **argv, int argc, int fileidx, short recursive, short quiet) free(cp); free(rbnp); } else { - if (!quiet) { - printf("%s:%s -> %30.30s\n", - rhost, rmtpath, destpath); - } qacp_recvonefile(rhost, rmtpath, destpath); } } @@ -416,7 +421,7 @@ recvfiles(char **argv, int argc, int fileidx, short recursive, short quiet) int -sendfiles(char **argv, int argc, int fileidx, short recursive, short quiet) +sendfiles(char **argv, int argc, int fileidx, short recursive) { char *cp; char *rhost = NULL; @@ -526,10 +531,6 @@ sendfiles(char **argv, int argc, int fileidx, short recursive, short quiet) } } - if (!quiet) { - printf("%-30.30s -> %s:%s\n", argv[file], rhost, destpath); - } - qacp_sendonefile(rhost, argv[file], destpath); free(lbnp); @@ -545,7 +546,6 @@ main(int argc, char *argv[]) { int c; short recursive=0; - short quiet=0; int eflag; while ((c = getopt(argc, argv, "+rq")) != -1) { @@ -574,11 +574,11 @@ main(int argc, char *argv[]) eflag = 0; /* If last arg has a ':' then we are sending files */ if (strchr(argv[argc-1], ':') != NULL) { - if (sendfiles(argv, argc, optind, recursive, quiet) < 0) { + if (sendfiles(argv, argc, optind, recursive) < 0) { eflag++; } } else { - if (recvfiles(argv, argc, optind, recursive, quiet) < 0) { + if (recvfiles(argv, argc, optind, recursive) < 0) { eflag++; } } |