]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
add RC_BOOTTIME option to include uptime counter to all show messages
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 30 May 2013 20:04:30 +0000 (20:04 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Thu, 30 May 2013 20:04:30 +0000 (20:04 +0000)
svn-id: @12674

lib/functions

index f4395fb92dc2fb3b633f6fbfdc20812fcf2f97c6..75f0de3f66ed8e53f76669287db8ce36ff5792e5 100644 (file)
@@ -392,12 +392,16 @@ msg_usage() {
 
 # Some functions to handle PLD Linux-style messages
 show() {
-       local text len
+       local text len time
+
+       if is_yes "$RC_BOOTTIME"; then
+               time=$(awk '{printf("[%8.2f] ", $1)}' /proc/uptime)
+       fi
 
        if is_no "$FASTRC" && is_yes "$GETTEXT"; then
-               text=$(nls -n "$@")
+               text=$time$(nls -n "$@")
        else
-               text=$(printf "$@")
+               text=$time$(printf "$@")
        fi
        len=${#text}
        while [ $((len++)) -lt $INIT_COL ]; do
This page took 0.086256 seconds and 4 git commands to generate.