* Changed name for _log function to _msg, added bail() function.

* Created _ansi function library to set terminal properties like
  cursor position and text color.
* Created _if function library, a set of simple if statements.
  Added _if_array_contains, _if_is_integer, _if_is defined,
  if_has_value
This commit is contained in:
ayakael 2018-01-06 20:30:09 -09:00
parent 5f446594ee
commit fca165b274
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026
9 changed files with 476 additions and 141 deletions

28
test/test-msg.sh Normal file
View file

@ -0,0 +1,28 @@
#!/bin/bash
source ../lib/if.sh
source ../lib/ansi.sh
source ../lib/msg.sh
clean() {
return 0
}
echo "Starting test for log library"
_msg ECHO "Testing echo"
sleep 1
_msg EXEC "Testing EXEC w/ OK"
sleep 1
_msg OK
sleep 1
_msg EXEC "Testing EXEC w/ WARN"
sleep 1
_msg WARN "This is a WARN"
sleep 1
_msg EXEC "Testing EXEC w/ FAIL"
sleep 1
_msg FAIL "This is a FAIL"
sleep 1
_msg INDENT +1
_msg EXEC "This is EXEC w/ indent of 1"
sleep 1
_msg OK