diff options
author | 2022-07-28 02:06:18 +0100 | |
---|---|---|
committer | 2022-07-29 03:03:18 +0100 | |
commit | 173e25b61a7ccc838250280cd7cd2aa262484e57 (patch) | |
tree | 79a96cc7bcd1e4f6ea0a17b5e3829e1b6771ca24 | |
parent | functions.sh: sort color definition ordering (diff) | |
download | gentoo-functions-0.16.tar.gz gentoo-functions-0.16.tar.bz2 gentoo-functions-0.16.zip |
functions.sh: use consistent Gentoo style for braces0.16
Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r-- | functions.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/functions.sh b/functions.sh index 0b9e9cf..a5f3bfd 100644 --- a/functions.sh +++ b/functions.sh @@ -26,7 +26,7 @@ _esetdent() eindent() { local i="$1" - [ -n "$i" ] && [ "$i" -gt 0 ] || i=$RC_DEFAULT_INDENT + [ -n "$i" ] && [ "$i" -gt 0 ] || i=${RC_DEFAULT_INDENT} _esetdent $(( ${#RC_INDENTATION} + i )) } @@ -36,7 +36,7 @@ eindent() eoutdent() { local i="$1" - [ -n "$i" ] && [ "$i" -gt 0 ] || i=$RC_DEFAULT_INDENT + [ -n "$i" ] && [ "$i" -gt 0 ] || i=${RC_DEFAULT_INDENT} _esetdent $(( ${#RC_INDENTATION} - i )) } @@ -71,7 +71,7 @@ esyslog() local pri= local tag= - if [ -n "$EINFO_LOG" ] && command -v logger > /dev/null 2>&1; then + if [ -n "${EINFO_LOG}" ] && command -v logger > /dev/null 2>&1; then pri="$1" tag="$2" @@ -424,10 +424,10 @@ done # Setup COLS and ENDCOL so eend can line up the [ ok ] COLS="${COLUMNS:-0}" # bash's internal COLUMNS variable -[ "$COLS" -eq 0 ] && \ +[ "${COLS}" -eq 0 ] && \ COLS="$(set -- $(stty size 2>/dev/null) ; printf "$2\n")" -[ -z "$COLS" ] && COLS=80 -[ "$COLS" -gt 0 ] || COLS=80 # width of [ ok ] == 7 +[ -z "${COLS}" ] && COLS=80 +[ "${COLS}" -gt 0 ] || COLS=80 # width of [ ok ] == 7 if yesno "${RC_ENDCOL}"; then ENDCOL='\033[A\033['$(( COLS - 8 ))'C' |