From a74988ca1fb35c1867c0bacb51e5d71abc2aa76d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 21 Sep 2019 20:25:51 +0300 Subject: [PATCH] kiss: explain log --- kiss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kiss b/kiss index 6b6aec3..9c558c6 100755 --- a/kiss +++ b/kiss @@ -14,6 +14,11 @@ log() { # Print a message prettily. + # '\033[1;32m': Set text to color '2' and make it bold. + # '\033[m': Reset text formatting. + # '${3:-->}': If the 3rd argument is missing, set prefix to '->'. + # '${2:+}': If the 2nd argument exists, set the text style of '$1'. + # '${2:+}': If the 2nd argument exists, reset text formatting. printf '\033[1;32m%s \033[m%s\033[m %s\n' \ "${3:-->}" "${2:+}$1${2:+}" "$2" }