Implement a curl-like CLI tool (let’s name it curly) that downloads a file from the provided URL. By default, curly sends the output to /dev/null and sets exit code to 0 if download was successful, 1 if failed + prints error to stderr.
But if -output=FILE flag is set - tool should store the contents of URL to the FILE. If “-output=-” tool should print output to stdout
Add flag -md5, so if set md5 sum will be printed to Stderr
Add flag -output-chunked FILEPREFIX - if set - content should be splitted to 3.5 Mb files FILEPREFIX.0 FILEPREFIX.1 ... FILEPREFIX.N so it could be stored on floppy disks 🙂. output-chunked should work together with other flags!
wget https://play.golang.org/p/HmnNoBf0p1z; md5sum HmnNoBf0p1z
# 474b18855ceed917e30c29b98dcc1854
go run main.go --md5=true https://play.golang.org/p/HmnNoBf0p1z