aboutsummaryrefslogtreecommitdiff
path: root/lib/logging.bash
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2020-03-22 13:44:01 +0100
committerPatrick Spek <p.spek@tyil.nl>2020-03-22 13:44:01 +0100
commit1548063b6ac54affecccc19872b1ffeed64f0887 (patch)
tree645d7ec3faeff40be96172b134023510334b5b6a /lib/logging.bash
parente335ffb41f7d65f369a8e4170affcd8d68a40be2 (diff)
Work out (most?) issues reported by shellcheck
Diffstat (limited to 'lib/logging.bash')
-rw-r--r--lib/logging.bash4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/logging.bash b/lib/logging.bash
index 33ead42..ad0bedd 100644
--- a/lib/logging.bash
+++ b/lib/logging.bash
@@ -7,18 +7,18 @@
log() {
local OPTIND
local color
- local format="[%s] %s\n"
while getopts ":c:" opt
do
case "$opt" in
c) color=$OPTARG ;;
+ *) alert "Unused argument specified: $opt" ;;
esac
done
shift $(( OPTIND - 1 ))
- printf "$color[%s] %s\e[0m\n" "$(date +%FT%T)" "$*" >&2
+ printf "${color}[%s] %s\e[0m\n" "$(date +%FT%T)" "$*" >&2
}
debug() {