Skip to content

Latest commit

 

History

History
65 lines (49 loc) · 1.91 KB

README.md

File metadata and controls

65 lines (49 loc) · 1.91 KB

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)"