summary refs log tree commit diff stats
path: root/lib
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
parent84e206099754c6b4b4f932af06ac90373a003ae7 (diff)
downloadorion-8c8b6105c6a9dc0e5862a2be04ed7a90dea9781e.tar.gz
Pretty print entries
Diffstat (limited to 'lib')
-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;
             };
         }
     }
170' href='#n170'>170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286