NAME
App::Sandy::CLI::Command - App::Sandy::CLI subclass for commands interface
VERSION
version 0.19
SYNOPSIS
extends 'App::Sandy::CLI::Command';
DESCRIPTION
This is the base interface to command classes. Command classes need to override validate_args
, validate_opts
and execute
methods
METHODS
validate_args
This method receives a reference to $args
in void context. It is expected that the user override it and validate the arguments
sub validate_args {
my ($self, $args) = @_
...
}
validate_opts
This method receives a reference to $opts
in void context. It is expected that the user override it and validate the options
sub validate_opts {
my ($self, $opts) = @_;
...
}
fill_opts
This method fills the $opts
with default values passed by the user. it expects two hash refs
$self->fill_opts($opts, \%default_opts);
execute
This method is called by the application class. It is where all the magic occurs. It receives two hash refs with $opts
and $args
in void context
sub execute {
my ($self, $opts, $args) = @_;
...
}
AUTHORS
Thiago L. A. Miller <tmiller@mochsl.org.br>
J. Leonel Buzzo <lbuzzo@mochsl.org.br>
Gabriela Guardia <gguardia@mochsl.org.br>
Fernanda Orpinelli <forpinelli@mochsl.org.br>
Pedro A. F. Galante <pgalante@mochsl.org.br>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2018 by Teaching and Research Institute from Sírio-Libanês Hospital.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007