-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
Megaf edited this page Sep 28, 2022
·
2 revisions
article up to date up to libsay version 1.3-202209.28.193000
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:
- Draw a box decoration around text.
- Allows you to format text.
- 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$debugis set totrueviadebug=true. - "empty line" - Empty lines are parsed as a horizontal line from side to side.
rst command is used to reset all text effects and colours.
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.
-
set_colour fg "colour"- Set's the foreground colour. -
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
-
bold_on/bold_off- Starts/stops bold text. -
italics_on/italics_off- Starts/stops italic text. -
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 libsay can do!
Including more commands and environment variables.
For more information Check the Wiki!