#!/usr/bin/env perl6

use v6;

my constant $root = $?FILE.IO.parent.parent;
use lib $root.child('lib').Str;
use lib $root.child('blib').child('lib').Str;

use Pray;

sub MAIN (
    Str $scene = 'scene.json',
    Str $image = $scene.IO.basename.subst(/ [ \. <-[ \. ]>* ]? $ /, '.png'),
    Int :$width,
    Int :$height,
    Bool :$quiet = False,
    Bool :$verbose = False,
    Bool :$preview = !$quiet,
) {
    Pray::render(
        $scene,
        $image,
        $width,
        $height,
        :$quiet,
        :$verbose,
        :$preview,
    );
}


