Skip to content

shellm-org/format

Repository files navigation

Style and Colors

Format your messages with style and colors.

pipeline status gitter chat

format is a function designed to help you add style and colors in your terminal messages.

Demo

Demo generated with termtosvg.

Installation

Installation is done with basher:

basher install gitlab.com/shellm/format

Usage

format can be used several ways:

  1. by directly giving the string to print:
format bold blue onWhite -- " info "
  1. 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
  1. with subprocesses, to use different styles and colors in the same string:
echo "$(format strike)easy$(format bold) very easy$(format reset) to use!"
  1. with printf:
printf "%s warning %s your computer will leave the room in 3...2...1...\n" \
  "$(format bold black onIntenseYellow)" \
  "$(format reset)"

About

Format your output with style and color.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published