Skip to content
Megaf edited this page Sep 28, 2022 · 2 revisions

article up to date up to libsay version 1.3-202209.28.193000

Using libsay

The libsay library adds a number of commands to your shell and projects!

On this page we are going to check some of the available commands and their functionality.

say

The say command can do the following:

  1. Draw a box decoration around text.
  2. Allows you to format text.
  3. Automatically parses text, line by line, applying pre-defined formatting for the following keywords.
  • TITLE: - Formats the line as a title, centring text and removing "TITLE:".
  • INFO: - Formats as INFO, gives a modest highlight to text.
  • NOTICE: - Formats as a NOTICE, strong highlight is given to attract the user's attention.
  • WARNING: - Formats as a WARNING, even stronger highlighting.
  • ERROR: - Formats as an ERROR, even stronger still.
  • DEBUG: - Debug messages will be hidden by default, only printed when $debug is set to true via debug=true.
  • "empty line" - Empty lines are parsed as a horizontal line from side to side.

Text Formatting

rst

rst command is used to reset all text effects and colours.

set_colour

The set_colour command sets background and foreground colours for any command ran after set_colour.

It can be used with any command, "echo", "printf", "say" and others.

  1. set_colour fg "colour" - Set's the foreground colour.
  2. set_colour bg "colour" - Set's the background colour.

set_colour Example:

  • set_colour fg light_cyan; set_colour bg blue; echo "Hello There!"

Other text formatting commands

  1. bold_on/bold_off- Starts/stops bold text.
  2. italics_on/italics_off - Starts/stops italic text.
  3. underline_on/underline_off - Starts/stops underline text.

Text Formatting Example

  • printf "The following words are written in "; bold_on; printf "bold, "; bold_off; italics_on; printf "italics, "; italics_off; printf "and "; underline_on; printf "underline."; rst

There's a lot more!

There's a lot libsay can do!

Including more commands and environment variables.

Check the Commands List!

For more information Check the Wiki!

Clone this wiki locally