From 38fbe272294a4b4a596958a0180b11c5429c5b04 Mon Sep 17 00:00:00 2001
From: Slaven Rezic <slaven@rezic.de>
Date: Thu, 24 Nov 2016 09:39:30 +0100
Subject: [PATCH] fix for RT #107068

The patch is modelled after PPISAR's patch attached to
the RT ticket, only it's done for the post-dzil
distribution.
---
 Makefile.PL           |  2 ++
 lib/MouseX/App/Cmd.pm | 20 ++------------------
 2 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/Makefile.PL b/Makefile.PL
index 795c18a..12fc7c9 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -29,6 +29,7 @@ my %WriteMakefileArgs = (
     "Mouse" => 0,
     "Mouse::Object" => 0,
     "MouseX::Getopt" => 0,
+    "MouseX::NonMoose" => 0,
     "namespace::autoclean" => 0
   },
   "TEST_REQUIRES" => {
@@ -62,6 +63,7 @@ my %FallbackPrereqs = (
   "Mouse" => 0,
   "Mouse::Object" => 0,
   "MouseX::Getopt" => 0,
+  "MouseX::NonMoose" => 0,
   "Test::More" => 0,
   "Test::Output" => 0,
   "YAML" => 0,
diff --git a/lib/MouseX/App/Cmd.pm b/lib/MouseX/App/Cmd.pm
index d9bc2bc..30446bd 100644
--- a/lib/MouseX/App/Cmd.pm
+++ b/lib/MouseX/App/Cmd.pm
@@ -3,27 +3,11 @@ use 5.006;
 package MouseX::App::Cmd; # git description: v0.29-32-g69e2d04
 use Mouse;
 use English '-no_match_vars';
-use File::Basename ();
+use MouseX::NonMoose;
+extends 'App::Cmd';
 
 our $VERSION = '0.30'; # VERSION
 use namespace::autoclean;
-extends 'Mouse::Object', 'App::Cmd';
-
-sub BUILDARGS {
-    my ( undef, @arg ) = @_;
-    return {} if !@arg;
-    return { arg => $arg[0] } if 1 == @arg;
-    return {@arg};
-}
-
-sub BUILD {
-    my $self  = shift;
-    my $class = blessed $self;
-    $self->{arg0}      = File::Basename::basename($PROGRAM_NAME);
-    $self->{command}   = $class->_command( {} );
-    $self->{full_arg0} = $PROGRAM_NAME;
-    return;
-}
 
 ## no critic (Modules::RequireExplicitInclusion)
 __PACKAGE__->meta->make_immutable();
-- 
2.1.2