Changed long-running command time appearance.

This commit is contained in:
Aaron D. Lee
2025-12-14 03:10:26 -05:00
parent 1676481b5d
commit 5c5dc7ab36

View File

@@ -107,15 +107,15 @@ _adlee_format_elapsed_time() {
local remainder=$((elapsed % 3600))
local minutes=$((remainder / 60))
local seconds=$((remainder % 60))
print -P "${COLOR_RED}•[ completed in: %b%B${COLOR_RED}${hours}h${minutes}m${seconds}s%b${COLOR_RED} at: %b%B${COLOR_RED}${timestamp}%b${COLOR_RED} ]•%b"
print -P "${COLOR_RED}•••[ completed in: %b%B${COLOR_RED}${hours}h${minutes}m${seconds}s%b${COLOR_RED} at: %b%B${COLOR_RED}${timestamp}%b${COLOR_RED} ]•••%b"
elif [[ $elapsed -ge 60 ]]; then
# Minutes
local minutes=$((elapsed / 60))
local seconds=$((elapsed % 60))
print -P "${COLOR_ORANGE}•[ completed in: %b%B${COLOR_LIGHT_ORANGE}${minutes}m${seconds}s%b${COLOR_ORANGE} at: %b%B${COLOR_LIGHT_ORANGE}${timestamp}%b${COLOR_ORANGE} ]•%b"
print -P "${COLOR_ORANGE}•[ completed in: %b%B${COLOR_LIGHT_ORANGE}${minutes}m${seconds}s%b${COLOR_ORANGE} at: %b%B${COLOR_LIGHT_ORANGE}${timestamp}%b${COLOR_ORANGE} ]•%b"
else
# Seconds only
print -P "${COLOR_LIGHT_GREEN}•[ completed in: %b%B${COLOR_BRIGHT_GREEN}${elapsed}s%b${COLOR_BRIGHT_GREEN} at: %b%B${COLOR_LIGHT_GREEN}${timestamp}%b${COLOR_LIGHT_GREEN} ]•%b"
print -P "${COLOR_LIGHT_GREEN}•[ completed in: %b%B${COLOR_BRIGHT_GREEN}${elapsed}s%b${COLOR_BRIGHT_GREEN} at: %b%B${COLOR_LIGHT_GREEN}${timestamp}%b${COLOR_LIGHT_GREEN} ]•%b"
fi
}