about summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-07-29 22:24:48 +0530
committerAndinus <andinus@nand.sh>2021-07-29 22:24:48 +0530
commitd84045b407da3503e06d763947a88ade9ee6454d (patch)
treecb89c691ed3fe46df0a534137a8b584b11e1e315 /lib
parent206c0aab0ed1f99cad242a147390c489c56ee605 (diff)
downloadlacerta-d84045b407da3503e06d763947a88ade9ee6454d.tar.gz
Add proto, make profile-name option named v0.1.0
Diffstat (limited to 'lib')
-rw-r--r--lib/Lacerta/CLI.rakumod7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Lacerta/CLI.rakumod b/lib/Lacerta/CLI.rakumod
index cc74879..ad52e0c 100644
--- a/lib/Lacerta/CLI.rakumod
+++ b/lib/Lacerta/CLI.rakumod
@@ -1,10 +1,13 @@
 use Terminal::Spinners;
 use Text::Table::Simple;
 
+# If no arguments are passed then run USAGE & exit.
+proto MAIN(|) is export {unless so @*ARGS {put $*USAGE; exit}; {*}}
+
 #| parses WhatsApp export
-multi sub MAIN (
+multi sub MAIN(
     Str $input where *.IO.f = "input", #= input log file to parse
-    Str $profile-name = "Andinus", #= your WhatsApp profile name
+    Str :$profile-name = "Andinus", #= your WhatsApp profile name
 ) is export {
     #| Parses the WhatsApp logs.
     grammar WhatsApp {