Simplify help output

This commit is contained in:
Samuel Henrique 2024-06-09 18:19:25 +01:00
parent 110ec46248
commit 9ad03eec9d

59
wcurl
View file

@ -27,63 +27,8 @@
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
function print_help { function print_help {
printf "\e[1mNAME\e[0m\n" printf "Usage: wcurl [-o|--opts=<CURL_OPTIONS>...] <URL>...\n"
printf "\twcurl - a simple wrapper around curl for easily downloading files.\n" printf "For all options use the manual: man wcurl\n"
printf "\n"
printf "\e[1mSYNOPSIS\e[0m\n"
printf "\twcurl \e[3m[-o/--opts=<CURL_OPTIONS>...]\e[0m <URL>...\n"
printf "\n"
printf "\e[1mDESCRIPTION\e[0m\n"
printf "\twcurl is a simple curl wrapper which lets you use curl to\n"
printf "\tdownload files without having to remember any parameters.\n"
printf "\n"
printf "\tSimply call wcurl with a list of URLs you want to download and\n"
printf "\twcurl will pick sane defaults.\n"
printf "\n"
printf "\tIf you need anything more fancy, you can provide any of curl's\n"
printf "\tsupported parameters via the -o/--opts option.\n"
printf "\n"
printf "\tBy default, wcurl will encode whitespaces, follow redirects,\n"
printf "\tautomatically chose a filename as output, perform retries, and resume from\n"
printf "\tbroken/interrupted downloads.\n"
printf "\n"
printf "\e[1mOPTIONS\e[0m\n"
printf "\t\e[3m-o, --opts=<CURL_OPTIONS>...\e[0m\n"
printf "\t\tOptions to be passed to the curl invocation.\n"
printf "\n"
printf "\e[1mCURL_OPTIONS\e[0m\n"
printf "\tAny option supported by curl can be set here, this is not used by\n"
printf "\twcurl, it's instead forwarded to the curl invocation.\n"
printf "\tSee also \e[1mcurl (1)\e[0m for extensive documentation of options.\n"
printf "\n"
printf "\e[1mURL\e[0m\n"
printf "\tAny arguments not prefixed by '-' will be considered an URL.\n"
printf "\twcurl will encode whitespaces and pass that to curl, which will perform the\n"
printf "\tparsing of the URL.\n"
printf "\n"
printf "\e[1mEXAMPLES\e[0m\n"
printf "\tDownload a single file\n"
printf "\t\e[1mwcurl example.com/filename.txt\e[0m\n"
printf "\n"
printf "\tDownload two files\n"
printf "\t\e[1mwcurl example.com/filename1.txt example.com/filename2.txt\e[0m\n"
printf "\n"
printf "\tDownload a file passing the \e[4m--progress-bar\e[0m and \e[4m--http2\e[0m flags to curl\n"
printf "\t\e[1mwcurl --opts=\"--progress-bar -http2\" example.com/filename.txt\e[0m\n"
printf "\n"
printf "\e[1mREPORTING BUGS\e[0m\n"
printf "\tIf you experience any problems with wcurl that you do not\n"
printf "\texperience with curl, submit an issue on the Debian Bug Tracking system\n"
printf "\tagainst the curl package.\n"
printf "\n"
printf "\e[1mAUTHORS\e[0m\n"
printf "\tSamuel Henrique <samueloph@debian.org>\n"
printf "\n"
printf "\e[1mCOPYRIGHT\e[0m\n"
printf "\twcurl is licensed under the MIT license\n"
printf "\n"
printf "\e[1mSEE ALSO\e[0m\n"
printf "\t\e[1mcurl (1)\e[0m\n"
} }
# Initialize array which stores list of encoded URLs. # Initialize array which stores list of encoded URLs.