From 85c13ee6070cf4086ffc73628e25a438f807f543 Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Mon, 23 Nov 2015 15:22:40 +0100 Subject: Added commandline attribute to Module --- Changes | 2 ++ lib/ManaTools/Module.pm | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Changes b/Changes index 9e2641e8..c1f2afb2 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + - Added CommandLine attribute to Module, to make it available + for all the GUI modules. - Added CommandLine module to manage common CL options - Added event_timeout rw attribute to GUI::Dialog to allow manage $yui::YEvent::TimeoutEvent diff --git a/lib/ManaTools/Module.pm b/lib/ManaTools/Module.pm index a53b97ea..bf7eeb60 100644 --- a/lib/ManaTools/Module.pm +++ b/lib/ManaTools/Module.pm @@ -26,6 +26,7 @@ use Moose; use ManaTools::Shared; use ManaTools::Shared::Locales; use ManaTools::Shared::Logging; +use ManaTools::Shared::GUI::CommandLine; =head1 VERSION @@ -147,6 +148,30 @@ sub _loggerInitialize{ return ManaTools::Shared::Logging->new(ident => $self->name); } + +#============================================================= + +=head2 commandline + + commandline attribute defines the given command line, if + --help is passed help message is shown and the module is not + loaded. + See ManaTools::Shared::GUI::CommandLine for details and usage. + +=cut + +#============================================================= +has 'commandline' => ( + is => 'ro', + isa => 'ManaTools::Shared::GUI::CommandLine', + init_arg => undef, + default => sub { + return ManaTools::Shared::GUI::CommandLine->new_with_options(); + } +); + + + #============================================================= =head1 SUBROUTINES/METHODS -- cgit v1.2.1