[PATCH 2/2] wget: notify on download begin and end
Martin Lewis
martin.lewis.x84 at gmail.com
Wed Dec 26 15:28:46 UTC 2018
When using -o to file the progress meter is not displayed, so write that
we started the download and that we finished it.
Signed-off-by: Martin Lewis <martin.lewis.x84 at gmail.com>
---
networking/wget.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/networking/wget.c b/networking/wget.c
index 8da0ce8..914221c 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -876,6 +876,10 @@ static void NOINLINE retrieve_file_data(FILE *dfp)
polldata.fd = fileno(dfp);
polldata.events = POLLIN | POLLPRI;
#endif
+ if (G.output_fd == 1)
+ fprintf(stderr, "writing to stdout\n");
+ else
+ fprintf(stderr, "saving to '%s'\n", G.fname_out);
progress_meter(PROGRESS_START);
if (G.chunked)
@@ -1021,6 +1025,10 @@ static void NOINLINE retrieve_file_data(FILE *dfp)
G.chunked = 0; /* makes it show 100% even for chunked download */
G.got_clen = 1; /* makes it show 100% even for download of (formerly) unknown size */
progress_meter(PROGRESS_END);
+ if (G.output_fd == 1)
+ fprintf(stderr, "written to stdout\n");
+ else
+ fprintf(stderr, "'%s' saved\n", G.fname_out);
}
static void download_one_url(const char *url)
--
1.9.1
More information about the busybox
mailing list