about summary refs log tree commit diff stats
path: root/lib/Taurus/CLI.rakumod
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-08-16 20:03:10 +0530
committerAndinus <andinus@nand.sh>2021-08-16 20:03:10 +0530
commitafc3d1618d994e616606c0a526ff2b745712ac8c (patch)
tree3f656ef43abc9e8e63ba08fd70bfc54989672f5e /lib/Taurus/CLI.rakumod
parent242f220dde5570b72c1c1a06fa1da9bf1f3f8cb2 (diff)
downloadtaurus-afc3d1618d994e616606c0a526ff2b745712ac8c.tar.gz
Remove progress frame
We don't have to create a new frame to show progress, this instead
prints it to pane0 and clears it when done.
Diffstat (limited to 'lib/Taurus/CLI.rakumod')
-rw-r--r--lib/Taurus/CLI.rakumod27
1 files changed, 9 insertions, 18 deletions
diff --git a/lib/Taurus/CLI.rakumod b/lib/Taurus/CLI.rakumod
index 8aacc7a..560ef75 100644
--- a/lib/Taurus/CLI.rakumod
+++ b/lib/Taurus/CLI.rakumod
@@ -51,27 +51,18 @@ multi sub MAIN (
     my $p0 = ui.panes[0];
     my $p1 = ui.panes[1];
 
+    until $initial.status {
+        $p0.splash: "Parsing logs" ~ (".  ", ".. ", "...")[$++ % 3];
+        sleep 1;
+    }
+    $p0.splash: "Parsed {@logs.elems} entries in {now - $timed}s.";
+    $p0.select-last;
+    ui.get-key;
+    $p0.clear;
+
     $p0.put: t.bold ~ t.bg-cyan ~ t.black ~ t.underline ~ "Taurus v" ~ $?DISTRIBUTION.meta<version>;
     $p0.put: "";
 
-    with ui.screen.add-frame(:4height, :40width, :center) -> $f {
-        with $f.add-pane -> $p {
-            $f.draw;
-            until $initial.status {
-                $p.splash: "Parsing logs" ~ (".  ", ".. ", "...")[$++ % 3];
-                sleep 1;
-            }
-            $p.splash: "Parsed {@logs.elems} entries in {now - $timed}s.";
-            $p.put: " " x 18 ~ "Ok";
-            $p.select-last;
-            ui.focus($f);
-        }
-        ui.get-key;
-        ui.screen.remove-frame($f);
-        ui.focus($f);
-    }
-    ui.refresh;
-
     $p0.put: "- Show Records", :meta(:all);
     $p0.put: "";
     $p0.put: "Yearly Records";