Last active
May 18, 2022 03:03
-
-
Save ConnerWill/9b551f54285b29e3f6b3e3a1a093496d to your computer and use it in GitHub Desktop.
Pointless bash function to show an interesting figlet font with basic help menu. More of a test/example/template than anything :-) Requires figlet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### figlet-tr help | |
funcname="figlet-tr" | |
figlettrhelp=" | |
TITLE: | |
$funcname [-h|--help] [string] | |
DESCRIPTION: | |
{{_Description_}} # Description | |
If no input messege is used, the ENVIROMENT VARIABLE 'USER' will be used instead. | |
INSTALLATION: | |
Add this line to your '.bashrc' or '.zshrc'\ | |
source \"/PATH/TO/$funcname\" | |
USAGE: | |
% $funcname [string] | |
OPTIONS: | |
--help | -h : Show this help menu | |
EXAMPLES: | |
% $funcname 'string' (Using string input) | |
% $funcname (Using no input resulting is showing env '$USER') | |
$ $funcname -h (Show help) | |
" | |
function figlettr(){ | |
if [[ "$1" == "--help" ]] || [[ "$1" == "-h" ]] && echo "$figlettrhelp" && return | |
[[ -z "$1" ]] && local mssssg="$USER" || local mssssg="$1" | |
echo "$mssssg" | |
echo "$mssssg" | figlet -t -f lean | tr ' _/' ' ()' | |
echo "$mssssg" | figlet -t -f lean | tr ' _/' '/ ' | |
echo "$mssssg" | figlet -t -f lean | tr ' _/' ' //' | |
echo "$mssssg" | figlet -t -f lean | tr ' _/' './\\' | |
} | |
alias figlet-tr="figlettr" |
Author
ConnerWill
commented
May 18, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment