about summary refs log tree commit diff stats
path: root/lib/Fornax/CLI.rakumod
blob: 78162e4329a3b207db409c35fa4fec03f359762a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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>; }