diff options
Diffstat (limited to 'bash-lib.sh')
-rw-r--r-- | bash-lib.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bash-lib.sh b/bash-lib.sh index b2bb3df..58fbd7a 100644 --- a/bash-lib.sh +++ b/bash-lib.sh | |||
@@ -11,23 +11,32 @@ tput() { | |||
11 | } | 11 | } |
12 | 12 | ||
13 | NORMAL="$(tput sgr0)" | 13 | NORMAL="$(tput sgr0)" |
14 | # shellcheck disable=SC2034 | ||
14 | readonly NORMAL | 15 | readonly NORMAL |
15 | BOLD="$(tput bold)" | 16 | BOLD="$(tput bold)" |
17 | # shellcheck disable=SC2034 | ||
16 | readonly BOLD | 18 | readonly BOLD |
17 | 19 | ||
18 | RED="$(tput setaf 1)" | 20 | RED="$(tput setaf 1)" |
21 | # shellcheck disable=SC2034 | ||
19 | readonly RED | 22 | readonly RED |
20 | GREEN="$(tput setaf 2)" | 23 | GREEN="$(tput setaf 2)" |
24 | # shellcheck disable=SC2034 | ||
21 | readonly GREEN | 25 | readonly GREEN |
22 | YELLOW="$(tput setaf 3)" | 26 | YELLOW="$(tput setaf 3)" |
27 | # shellcheck disable=SC2034 | ||
23 | readonly YELLOW | 28 | readonly YELLOW |
24 | BLUE="$(tput setaf 4)" | 29 | BLUE="$(tput setaf 4)" |
30 | # shellcheck disable=SC2034 | ||
25 | readonly BLUE | 31 | readonly BLUE |
26 | PURPLE="$(tput setaf 5)" | 32 | PURPLE="$(tput setaf 5)" |
33 | # shellcheck disable=SC2034 | ||
27 | readonly PURPLE | 34 | readonly PURPLE |
28 | CYAN="$(tput setaf 6)" | 35 | CYAN="$(tput setaf 6)" |
36 | # shellcheck disable=SC2034 | ||
29 | readonly CYAN | 37 | readonly CYAN |
30 | WHITE="$(tput setaf 7)" | 38 | WHITE="$(tput setaf 7)" |
39 | # shellcheck disable=SC2034 | ||
31 | readonly WHITE | 40 | readonly WHITE |
32 | 41 | ||
33 | readonly BASH_LIB_LOG_VAR="${BASH_LIB_NAME:-BASH}_LOG" | 42 | readonly BASH_LIB_LOG_VAR="${BASH_LIB_NAME:-BASH}_LOG" |
@@ -46,6 +55,7 @@ if is_debug; then | |||
46 | else | 55 | else |
47 | VERBOSE_ARG=() | 56 | VERBOSE_ARG=() |
48 | fi | 57 | fi |
58 | # shellcheck disable=SC2034 | ||
49 | readonly VERBOSE_ARG | 59 | readonly VERBOSE_ARG |
50 | 60 | ||
51 | echoe() { | 61 | echoe() { |
@@ -57,7 +67,7 @@ log() { | |||
57 | local color="$2" | 67 | local color="$2" |
58 | local message="$3" | 68 | local message="$3" |
59 | shift 3 | 69 | shift 3 |
60 | local rest="$@" | 70 | local -a rest=("$@") |
61 | 71 | ||
62 | echoe "${BOLD}${color}${level} ${WHITE}${message}${NORMAL}" "${rest[@]}" | 72 | echoe "${BOLD}${color}${level} ${WHITE}${message}${NORMAL}" "${rest[@]}" |
63 | } | 73 | } |