From 8c8b6105c6a9dc0e5862a2be04ed7a90dea9781e Mon Sep 17 00:00:00 2001 From: Andinus Date: Wed, 14 Apr 2021 13:47:31 +0530 Subject: Pretty print entries --- lib/Orion/CLI.rakumod | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lib') 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; }; } } -- cgit 1.4.1-2-gfad0