diff options
author | Andinus <andinus@nand.sh> | 2021-08-15 23:41:16 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2021-08-15 23:41:16 +0530 |
commit | 414025e62113f5aacbbae06e7c4a04804ac071f3 (patch) | |
tree | f11ac38267ee6964a2c2eb730f5c3c207404d2e0 /lib/Taurus | |
parent | ebe451ddc2c219c9d8a9f1b684e137529ae95bb9 (diff) | |
download | taurus-414025e62113f5aacbbae06e7c4a04804ac071f3.tar.gz |
Update formatting
Diffstat (limited to 'lib/Taurus')
-rw-r--r-- | lib/Taurus/CLI.rakumod | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/Taurus/CLI.rakumod b/lib/Taurus/CLI.rakumod index 04ef4aa..56ef889 100644 --- a/lib/Taurus/CLI.rakumod +++ b/lib/Taurus/CLI.rakumod @@ -51,7 +51,7 @@ multi sub MAIN ( $f.draw; until $initial.status { $p.splash: "Parsing logs" ~ (". ", ".. ", "...")[$++ % 3]; - sleep 0.8; + sleep 1; } $p.splash: "Parsed {@logs.elems} entries in {now - $timed}s."; $p.put: " " x 18 ~ "Ok"; @@ -83,9 +83,9 @@ multi sub MAIN ( my $outgoing = .grep(*.[2] eqv "Outgoing Call").map(*.[4]).sum; my $incoming = .grep(*.[2] eqv "Incoming Call").map(*.[4]).sum; - $p1.put: sprintf("%-*s", $fmt, "Outgoing:") ~ $outgoing / 3600 ~ " hours" ; - $p1.put: sprintf("%-*s", $fmt, "Incoming:") ~ $incoming / 3600 ~ " hours"; - $p1.put: sprintf("%-*s", $fmt, "Total:") ~ ($incoming + $outgoing) / 3600 ~ " hours"; + $p1.put: "%-*s %.2f hours".sprintf($fmt, "Outgoing:", $outgoing / 3600); + $p1.put: "%-*s %.2f hours".sprintf($fmt, "Incoming:", $incoming / 3600); + $p1.put: "%-*s %.2f hours".sprintf($fmt, "Total:", ($incoming + $outgoing) / 3600); $p1.put: ""; } } elsif %meta<number> -> $num { @@ -99,16 +99,17 @@ multi sub MAIN ( my $outgoing = .grep(*.[2] eqv "Outgoing Call").map(*.[4]).sum; my $incoming = .grep(*.[2] eqv "Incoming Call").map(*.[4]).sum; - $p1.put: sprintf("%-*s", $fmt, "Outgoing:") ~ $outgoing / 3600 ~ " hours"; - $p1.put: sprintf("%-*s", $fmt, "Incoming:") ~ $incoming / 3600 ~ " hours"; - $p1.put: sprintf("%-*s", $fmt, "Total:") ~ ($incoming + $outgoing) / 3600 ~ " hours"; + $p1.put: "%-*s %.2f hours".sprintf($fmt, "Outgoing:", $outgoing / 3600); + $p1.put: "%-*s %.2f hours".sprintf($fmt, "Incoming:", $incoming / 3600); + $p1.put: "%-*s %.2f hours".sprintf($fmt, "Total:", ($incoming + $outgoing) / 3600); $p1.put: ""; - $p1.put: sprintf("%-*s", $fmt, "Declined:") ~ .grep( - {$_.[2] eqv "Incoming Call" and $_.[4] == 0}).elems; - $p1.put: sprintf("%-*s", $fmt, "Declined (they):") ~ .grep( - {$_.[2] eqv "Outgoing Call" and $_.[4] == 0}).elems; - $p1.put: sprintf("%-*s", $fmt, "Missed Calls:") ~ .grep(*.[2] eqv "Missed Call").elems; + $p1.put: "%-*s %d".sprintf($fmt, "Declined:", + .grep({$_.[2] eqv "Incoming Call" and $_.[4] == 0}).elems); + $p1.put: "%-*s %d".sprintf($fmt, "Declined (they):", + .grep({$_.[2] eqv "Outgoing Call" and $_.[4] == 0}).elems); + $p1.put: "%-*s %d".sprintf($fmt, "Missed Calls:", + .grep(*.[2] eqv "Missed Call").elems); } } } |