Rename http-password flag to http-passwd. Fix debug output.

This commit is contained in:
2020-07-31 13:35:07 +02:00
parent b2267537c5
commit 3891e874ca

View File

@ -31,7 +31,7 @@ func main() {
var showVersion bool
flag.StringVar(&c.User, "http-user", "", "HTTP auth username")
flag.StringVar(&c.Password, "http-password", "", "HTTP auth password")
flag.StringVar(&c.Password, "http-passwd", "", "HTTP auth password")
flag.IntVar(&c.Retries, "retries", 1, "Number of retries in case of download errors.")
flag.DurationVar(&c.RetryWait, "retry-wait", 2*time.Second, "Time to wait before retrying download.")
flag.DurationVar(&c.ConnectTimeout, "connect-timeout", 5*time.Second, "TCP connections that take longer to establish will be aborted")
@ -74,7 +74,7 @@ func main() {
}
func (c *client) DownloadFile(filename string, url string) (err error) {
println("Downloading %s to file %s\n", url, filename)
fmt.Fprintf(os.Stderr, "downloading %s to file %s\n", url, filename)
// Create the target file
out, err := os.Create(filename)
if err != nil {