#!/usr/bin/env perl
use Applify;

documentation 'App::git::ship';
extends 'App::git::ship';
version 'App::git::ship';

app {
  my $self = shift;
  my $action = shift || 'ship';

  $action =~ s/-/_/g;

  if ($action eq 'start') {
    bless $self, $self->detect(@_ ? $_[0] : '');
    $self->start(@_);
  }
  else {
    bless $self, $self->detect;
    $self->config;
    $self->abort("Unknown action: $action") if $action !~ /^[a-z_]+$/ or !$self->can($action);
    $self->$action(@_);
  }

  return 0;
};
