kiss: explain log

This commit is contained in:
Dylan Araps 2019-09-21 20:25:51 +03:00
parent 6ad2c6e451
commit a74988ca1f
1 changed files with 5 additions and 0 deletions

5
kiss
View File

@ -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"
}