base-files: upgrade: add vn and variants

To be used with in the following pattern

  vn "Remaining: "
  for p in $xx; do
    _vn "$p"
  done
  _v

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
This commit is contained in:
Yousong Zhou 2020-11-10 21:30:29 +08:00
parent 826bb13742
commit 7863c33cea

View File

@ -63,8 +63,20 @@ ask_bool() {
[ "$answer" -gt 0 ]
}
_v() {
[ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$*" >&2
}
_vn() {
[ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo -n "$*" >&2
}
v() {
[ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$(date) upgrade: $@" >&2
_v "$(date) upgrade: $@"
}
vn() {
_vn "$(date) upgrade: $@"
}
json_string() {