summary refs log tree commit diff stats
path: root/lib/Orion
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-04-14 13:47:31 +0530
committerAndinus <andinus@nand.sh>2021-04-14 13:47:31 +0530
commit8c8b6105c6a9dc0e5862a2be04ed7a90dea9781e (patch)
treeda6625c7830e165d8c94b9b04cbc084850cacf17 /lib/Orion
parent84e206099754c6b4b4f932af06ac90373a003ae7 (diff)
downloadorion-8c8b6105c6a9dc0e5862a2be04ed7a90dea9781e.tar.gz
Pretty print entries
Diffstat (limited to 'lib/Orion')
-rw-r--r--lib/Orion/CLI.rakumod11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/Orion/CLI.rakumod b/lib/Orion/CLI.rakumod
index bce24a7..3fe01b8 100644
--- a/lib/Orion/CLI.rakumod
+++ b/lib/Orion/CLI.rakumod
@@ -1,8 +1,6 @@
 use LWP::Simple;
 use Digest::SHA;
 
-#proto MAIN(|) is export { unless so @*ARGS { say $*USAGE; exit }; {*} }
-
 multi sub MAIN(
     Bool :$verbose, #=increase verbosity
 ) is export {
@@ -27,11 +25,10 @@ multi sub MAIN(
                 Add-Padding => "true",
                 User-Agent => "Andinus / Orion - https://andinus.nand.sh/orion",
             }
-        ).lines.map(*.split(":")) -> ($entry, $freq) {
-            next if $freq == 0;
-            if $hash.substr(5, *) eq $entry.split(":").head {
-                say $file.Str.split('.password-store/').tail.split('.gpg').first, " ",
-                "has been seen $freq times before.";
+        ).lines.map(*.split(":")).grep(*[1] > 0) -> ($entry, $freq) {
+            if $hash.substr(5, *) eq $entry {
+                my Str $pass = $file.Str.split('.password-store/').tail.split('.gpg').first;
+                say $pass, " " x (72 - $pass.chars - $freq.chars), $freq;
             };
         }
     }