Index of /night/

      Name                                                                             Last modified         Size  Description
up Parent Directory 20-Feb-2021 03:09 - unknown CHECKSUM.MD5 20-Feb-2021 03:09 4k unknown Makefile 20-Feb-2021 03:09 4k [TXT] main.c 20-Feb-2021 03:09 4k [CMP] night-1.4.tar.gz 20-Feb-2021 03:09 8k [CMP] night.7.gz 20-Feb-2021 03:09 4k [TXT] night.c 20-Feb-2021 03:09 4k [TXT] night.h 20-Feb-2021 03:09 4k


Version 1.4


Night interpreter manipulates console text color and style codes from a file or from the command line.
Can interpret standalone executable scripts.


1. Compiling & Installation
2. Usage
3. Codes
4. Examples


To build the 'night' binary:

	$ make

To move the 'night' binary to /usr/bin and copy the manual page file
'night.7.gz' to /usr/share/man/man7:

	$ make install

To remove the object files generated by make:

	$ make clean

To delete the installed binary and manual:

	$ make uninstall


A standalone Night script begins with #!/usr/bin/night as the first line. All lines
after this are interpreted, and an extra line should be appended to the file to ensure
it is fully processed. Night scripts must have execute permissions.

When called on the command line, Night can process either a provided file or string.

$ night file

	Interprets Night codes in the provided file, outputting to standard output.
	Returns an error message and empty string if file was not found or syntax
	error in command line.

$ night -s 'text'

	Interprets Night codes in the provided string, outputting to standard output.
	Returns an empty string if syntax error in command line.

$ night -h

	Displays command usage and color code table.


Night codes are case-sensitive and always begin with ~.

       Color         Code
       -----         ----
       black         ~BLAK
       red           ~REDX
       green         ~GREE
       yellow        ~YELL
       blue          ~BLUE
       purple        ~PURP
       cyan          ~CYAN
       white         ~WHIT
       bold black    ~BLD~BLAK
       bold red      ~BLD~REDX
       bold green    ~BLD~GREE
       bold yellow   ~BLD~YELL
       bold blue     ~BLD~BLUE
       bold purple   ~BLD~PURP
       bold cyan     ~BLD~CYAN
       bold white    ~BLD~WHIT
       bold          ~BLD
       underline     ~LIN
       clear         ~CLR
       cursor        ~CUR
       reverse       ~REV
       reset         ~RES

Codes may be used in any order and quantity.


The 'reset' code marks the end of all color and effect codes before it. Use ~RES to
close a string:


The color codes are used to set basic colors:

	~BLUEblue text~RES

The 'bold' code bolds or brightens color; it can be used before any or no color codes:

	~BLD~GREEgreen text~RES

The 'underline' code underlines text:
	~LINunderlined text~RES

The 'clear' code clears the screen of text:
	~CLRempty screen

The 'cursor' code sets the cursor position to the upper left corner of the screen. This
is most useful when used with ~CLR:
	~CLR~WHIT~CURclear screen~RES

The 'reverse' code sets the current text color to the background color and the background
color to the text color:
	~REDX~REVblack on red text~RES

Proudly Served by LiteSpeed Web Server at Port 443