diff options
author | Andinus <andinus@nand.sh> | 2021-11-02 13:43:28 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2021-11-02 13:43:28 +0530 |
commit | 31e11e8f2d1cdfbe1d06ad691cc22f582a45c282 (patch) | |
tree | 81c5ce3b3dff6fc243f5d65cc011755fcfc9d019 /lib/Fornax/CLI.rakumod | |
parent | 5721d15df645d19857d68b67273f9bcf625b76fd (diff) | |
download | fornax-31e11e8f2d1cdfbe1d06ad691cc22f582a45c282.tar.gz |
Move to Raku module structure
Diffstat (limited to 'lib/Fornax/CLI.rakumod')
-rw-r--r-- | lib/Fornax/CLI.rakumod | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Fornax/CLI.rakumod b/lib/Fornax/CLI.rakumod new file mode 100644 index 0000000..78162e4 --- /dev/null +++ b/lib/Fornax/CLI.rakumod @@ -0,0 +1,19 @@ +use Cairo; + +subset Directory of Str where *.IO.d; +proto MAIN(|) is export { unless so @*ARGS { say $*USAGE; exit }; {*} } + +#| Collection of tools to visualize Path Finding Algorithms +multi sub MAIN( + Str $script, #= script to run (e.g. java/DFS) + Directory :$algorithms = 'algorithms/', #= algorithms directory +) is export { + my Str $interpreter = $script.split("/").first; + my IO() $program-path = $algorithms ~ $script ~ '.' ~ $interpreter; + + die "Program path invalid" unless $program-path.IO.f; +} + +multi sub MAIN( + Bool :$version #= print version +) { say "Fornax v" ~ $?DISTRIBUTION.meta<version>; } |