package Catalyst::Script::Create;
use Moose;
-use strict;
-use warnings;
-use Getopt::Long;
use Pod::Usage;
use Catalyst::Helper;
-
-my $force = 0;
-my $mech = 0;
-my $help = 0;
-
-GetOptions(
- 'nonew|force' => \$force,
- 'mech|mechanize' => \$mech,
- 'help|?' => \$help
- );
-
-pod2usage(1) if ( $help || !$ARGV[0] );
-
-my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } );
-
-pod2usage(1) unless $helper->mk_component( 'BoyosPlace', @ARGV );
-
+use MooseX::Types::Moose qw/Str Bool/;
+use namespace::autoclean;
+
+with "MooseX::Getopt";
+#extends qw(MooseX::App::Cmd);
+
+
+has _app => (
+ reader => 'app',
+ init_arg => 'app',
+ traits => [qw(NoGetopt)],
+ isa => Str,
+ is => 'ro',
+);
+
+has force => (
+ traits => [qw(Getopt)],
+ cmd_aliases => 'nonew',
+ isa => Bool,
+ is => 'ro',
+ documentation => qq{ force new scripts }
+);
+
+has help => (
+ traits => [qw(Getopt)],
+ cmd_aliases => 'h',
+ isa => Bool,
+ is => 'ro',
+ documentation => qq{ display this help and exits },
+);
+
+has debug => (
+ traits => [qw(Getopt)],
+ cmd_aliases => 'd',
+ isa => Bool,
+ is => 'ro',
+ documentation => qq{ force debug mode }
+);
+
+has mechanize => (
+ traits => [qw(Getopt)],
+ cmd_aliases => 'mech',
+ isa => Bool,
+ is => 'ro',
+ documentation => qq{ use WWW::Mechanize },
+);
+
+sub run {
+ my ($self) = @_;
+
+
+ pod2usage(1) if ( $self->help || !$ARGV[0] );
+
+ my $helper = Catalyst::Helper->new( { '.newfiles' => !$self->force, mech => $self->mech } );
+
+ pod2usage(1) unless $helper->mk_component( $self->app, @ARGV );
+
+}
+
+__PACKAGE__->meta->make_immutable;
1;
=head1 NAME