Format your messages with style and colors.
format is a function designed to help you add style and colors
in your terminal messages.
Demo generated with termtosvg.
Installation is done with basher:
basher install gitlab.com/shellm/format
format can be used several ways:
- by directly giving the string to print:
format bold blue onWhite -- " info "- by first printing the style and colors, then multiple strings:
format bold red echo "error: this is not supposed to do that," echo "please turn off your computer." format reset
- with subprocesses, to use different styles and colors in the same string:
echo "$(format strike)easy$(format bold) very easy$(format reset) to use!"
- with
printf:
printf "%s warning %s your computer will leave the room in 3...2...1...\n" \ "$(format bold black onIntenseYellow)" \ "$(format reset)"