#!perl6

use Terminal::ANSIColor;
use Tomtit;

sub MAIN (
  Str  :$run, 
  Bool :$bootstrap  = False, 
  Bool :$verbose    = False, 
  Bool :$quiet      = False, 
  Bool :$clean      = False, 
  Bool :$help       = False, 
  Bool :$list       = False, 
  Bool :$last       = False 
)

{

  mkdir ".tom/.cache";
  
  if ($last) {

    scenario-last("{$*CWD}/.tom");
    
  } elsif ($run) {

    die "you can't use both verbose and quiet options" if ( $quiet && $verbose );

    scenario-run("{$*CWD}/.tom",$run, %( quiet => $quiet , verbose => $verbose ));

  } elsif ($list) {

    scenario-list("{$*CWD}/.tom")

  } elsif ($help) {

    tomtit-help();

  } elsif ($clean) {

    tomtit-clean("{$*CWD}/.tom");

  } elsif ($bootstrap) {

    tomtit-bootstrap();

  } else {

    tomtit-help();

  }

}


