#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; { package My; use Moose; extends 'MooseX::App::Cmd::Command'; with qw{ MooseX::Getopt::Usage }; has test => ( traits => [qw[ Getopt ]], isa => 'Bool', is => 'rw', cmd_aliases => 't', documentation => 'test me', ); sub execute { my ($self, $opt, $args) = @_; say $self->test; } __PACKAGE__->meta->make_immutable; } my $app = 'My'->new_with_options;