refactor: replace all use of fold with fmt; no need for ncurses

This commit is contained in:
Martin Wimpress 2024-07-02 13:54:19 +01:00 committed by Martin Wimpress
parent 0440ce149b
commit e305c41118
1 changed files with 5 additions and 5 deletions

View File

@ -138,7 +138,7 @@ function os_homepage() {
function error_specify_os() { function error_specify_os() {
echo "ERROR! You must specify an operating system." echo "ERROR! You must specify an operating system."
echo "- Supported Operating Systems:" echo "- Supported Operating Systems:"
os_support | fold -s -w "$(tput cols)" os_support | fmt -w 80
echo -e "\nTo see all possible arguments, use:\n quickget -h or quickget --help" echo -e "\nTo see all possible arguments, use:\n quickget -h or quickget --help"
exit 1 exit 1
} }
@ -146,7 +146,7 @@ function error_specify_os() {
function os_supported() { function os_supported() {
if [[ ! "$(os_support)" =~ ${OS} ]]; then if [[ ! "$(os_support)" =~ ${OS} ]]; then
echo -e "ERROR! ${OS} is not a supported OS.\n" echo -e "ERROR! ${OS} is not a supported OS.\n"
os_support | fold -s -w "$(tput cols)" os_support | fmt -w 80
exit 1 exit 1
fi fi
} }
@ -171,10 +171,10 @@ function error_specify_release() {
;; ;;
*) *)
echo -en " - Releases:\t" echo -en " - Releases:\t"
"releases_${OS}" | fold -s -w "$(tput cols)" "releases_${OS}" | fmt -w 80
if [[ $(type -t "editions_${OS}") == function ]]; then if [[ $(type -t "editions_${OS}") == function ]]; then
echo -en " - Editions:\t" echo -en " - Editions:\t"
"editions_${OS}" | fold -s -w "$(tput cols)" "editions_${OS}" | fmt -w 80
fi fi
;; ;;
esac esac
@ -3364,7 +3364,7 @@ Arguments:
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Supported Operating Systems:\n\n' "$(quickemu --version)" "${CURL_VERSION}" Supported Operating Systems:\n\n' "$(quickemu --version)" "${CURL_VERSION}"
os_support | fold -s -w "$(tput cols)" os_support | fmt -w 80
} }
trap cleanup EXIT trap cleanup EXIT