Skip to content

evanschoffstall/unicornsay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


unicornsay banner

unicornsay

Say something. A unicorn will deliver it.

Bash 4.2+ Tested with bats MIT License

A single-file Bash script that wraps any message in a styled speech bubble beside a unicorn. Reads from an argument or stdin. Pipe anything through it.

Install

cp unicornsay ~/.local/bin/unicornsay && chmod +x ~/.local/bin/unicornsay

Usage

# Argument
unicornsay "Hello, world!"

# Stdin
echo "Build passed." | unicornsay

# Login greeting with fortune and lolcat
unicornsay "$(date "+%b %e, %Y %I:%M:%S %p"; echo; fortune)" | lolcat

Tip

Add the fortune | lolcat line to your .zshrc or .bashrc for a colorful greeting every time you open a terminal.

Options

Flag Values Default Description
--above off Bubble above the unicorn instead of side-by-side.
--art big, small auto Art size. Auto-selected from terminal height.
--side left, right left Which side the unicorn appears on.
-h, --help Print usage and exit.

Side-by-side layout requires at least 60 columns. Set COLUMNS and LINES to pin layout for scripts and CI.

Tests

bats unicornsay.bats

Covers all 20 combinations of --above, --art, and --side with exact-output assertions at COLUMNS=80 LINES=24. Uses bats-core.

Important

If you change the output layout, re-capture snapshots at COLUMNS=80 LINES=24 and update the heredocs in unicornsay.bats.

License

Released under the MIT License.

Made with ❤️ by Evan Schoffstall

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages