From 6e0e47098c440283b3997abff1a3828bea3e6ebf Mon Sep 17 00:00:00 2001 From: The Magician Date: Sat, 4 Nov 2023 22:18:38 +0000 Subject: [PATCH] Move sections to distinct functions --- thebookofcolors | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/thebookofcolors b/thebookofcolors index f83d391..2ca1d31 100755 --- a/thebookofcolors +++ b/thebookofcolors @@ -34,10 +34,7 @@ title() { printf '\e[0m\n' } -main() { - thebookofcolors - newline 2 - +section_introduction() { title "Introduction" thebookofcolors printf ' is an in-terminal manual on ANSI escape codes, or "color codes", for use in terminal emulators.\n' @@ -46,9 +43,9 @@ main() { printf ' is used in ' thebookofcolors "The Book" printf ' itself.\n' +} - newline - +section_disclaimers() { title "Disclaimers" thebookofcolors printf ' is open-source software and is provided as-is with NO WARRANTY under applicable law.\n' @@ -57,7 +54,16 @@ main() { printf ', use the `reset` command to restore your terminal.\n' printf 'If you believe you have found a bug, please open an issue on the repository, which can be found at .\n' printf 'If you have a fix for said bug, please submit a pull request instead.\n' +} +main() { + thebookofcolors + newline 2 + + section_introduction + newline + + section_disclaimers #printf 'Use \\e (or \\033) followed by the control sequence specified next to activate that color.\n' #printf 'Use the reset sequence "[0m" to remove all set colors and styles.\n'