mirror of
https://github.com/IlanCosman/tide.git
synced 2024-11-27 13:18:02 +03:00
Add minutes and hours to cmd_duration
This commit is contained in:
parent
30f787b5a8
commit
31fd9d8f85
@ -22,8 +22,23 @@ function _lean_status
|
|||||||
end
|
end
|
||||||
|
|
||||||
function _lean_cmd_duration
|
function _lean_cmd_duration
|
||||||
if test (math $CMD_DURATION/1000) -gt $lean_cmd_duration_threshold
|
set -l seconds (math --scale=$lean_cmd_duration_decimals $CMD_DURATION/1000)
|
||||||
echo -n (math --scale=$lean_cmd_duration_decimals $CMD_DURATION/1000)'s'
|
|
||||||
|
if test $seconds -gt $lean_cmd_duration_threshold
|
||||||
|
set -l secondsMod (math $seconds % 60)
|
||||||
|
|
||||||
|
set -l minutes (math -s0 $seconds/60)
|
||||||
|
set -l minutesMod (math $minutes % 60)
|
||||||
|
|
||||||
|
set -l hours (math -s0 $minutes/60)
|
||||||
|
|
||||||
|
for time in hours minutesMod secondsMod
|
||||||
|
if test $$time -eq 0
|
||||||
|
set -e $time
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
echo {$hours}'h' {$minutesMod}'m' {$secondsMod}'s'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user