aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2019-09-21 17:25:51 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2019-09-21 17:25:51 +0000
commit259e287098dfcfffa22047a97eadf01f436aa075 (patch)
tree055051780483dacbd9b8aad6ce5273e5219104bb
parent9e07793903c752c7249c68da9da06bf24ca37e6b (diff)
downloadcpt-259e287098dfcfffa22047a97eadf01f436aa075.tar.gz
kiss: explain log
FossilOrigin-Name: 82aa30ad2f6f4320960eb6bc30e79ce9f272fb1f7f20853eec13785e9e2637d9
-rwxr-xr-xkiss5
1 files changed, 5 insertions, 0 deletions
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"
}