commit 34508527cab3b61fca58aa9e3643a6c1da41c736
parent 896b0ac9531b0b3bc2f08989a84eed6733e4328a
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date: Wed, 14 Feb 2018 07:03:34 +0100
SBO::App: separate out new constructor
Diffstat:
3 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/SBO-Lib/MANIFEST b/SBO-Lib/MANIFEST
@@ -4,6 +4,8 @@ MANIFEST
README
t/SBO-Lib.t
t/versions.t
+lib/SBO/App.pm
+lib/SBO/App/Remove.pm
lib/SBO/Lib.pm
lib/SBO/Lib/Build.pm
lib/SBO/Lib/Download.pm
diff --git a/SBO-Lib/lib/SBO/App.pm b/SBO-Lib/lib/SBO/App.pm
@@ -0,0 +1,24 @@
+package SBO::App::Remove;
+
+# vim: ts=2:et
+#
+# authors: Luke Williams <xocel@iquidus.org>
+# Jacob Pipkin <j@dawnrazor.net>
+# Andreas Guldstrand <andreas.guldstrand@gmail.com>
+# license: WTFPL <http://sam.zoy.org/wtfpl/COPYING>
+
+use 5.16.0;
+use strict;
+use warnings FATAL => 'all';
+use File::Basename;
+
+sub new {
+ my $class = shift;
+
+ my $self = _parse_opts(@_);
+ $self->{fname} = basename( (caller(0))[1] );
+
+ return bless $self, $class;
+}
+
+1;
diff --git a/SBO-Lib/lib/SBO/App/Remove.pm b/SBO-Lib/lib/SBO/App/Remove.pm
@@ -12,16 +12,8 @@ use strict;
use warnings FATAL => 'all';
use SBO::Lib qw/ get_inst_names get_installed_packages get_sbo_location get_build_queue merge_queues get_requires get_readme_contents prompt show_version in /;
use Getopt::Long qw(GetOptionsFromArray :config bundling);
-use File::Basename;
-sub new {
- my $class = shift;
-
- my $self = _parse_opts(@_);
- $self->{fname} = basename( (caller(0))[1] );
-
- return bless $self, $class;
-}
+use parent 'SBO::App';
sub _parse_opts {
my @ARGS = @_;