Ado::Command - Ado namespace for Mojo commands!
Ado::Command is the base class for eventual functionality that we can run directly from the commandline or from controllers. In this class we can put common functionality shared among all the commands.
Ado::Command inherits all attributes from Mojolicious::Command and implements the following new ones.
Returns a hash-reference containing all arguments passed to the command on the command-line or to the method "run". The keys are the long variants of the possible commandline arguments altough you may have used short variants.
#if you passed -s or --something $self->args->{something} #foo
Also, please note that some options turn out to be "eaten-up" by Mojolicious::Commands. So, do not use them in your commands and consider them reserved. The known options are 'home=s' and 'm|mode=s'. Ado::Command::generate::apache2htaccess worked around this limitation by using upper case for a short variant of its options - 'M|modules=s@'.
home=s
m|mode=s
M|modules=s@
The name of your command - (ref $self) =~ /(\w+)$/;.
(ref $self) =~ /(\w+)$/;
Returns current Ado::Command::foo home.
Ado::Command inherits all methods from Mojolicious::Command and implements the following new ones.
Should be implemented by the inheriting command.
Should get options from the commandline and populate $self->args. Must return $self.
$self->args
$self
A default $command->run(@args) method for all Ado::Command commands. This is the entry point to your mini application. Looks for subcommands/actions which are looked up in the --do commands line argument and executed. Dies with an error message advising you to implement the subcommand if it is not found in $self->config->{actions}. Override it if you want specific behavior.
$command->run(@args)
--do
$self->config->{actions}
# as bin/ado alabala --do action --param1 value Ado::Command::alabala->run(@ARGV); #or from a controller Ado::Command::alabala->run( --do => action => --param1 => 'value' );
Returns the configuration portion specific for a command.
#Somewhere in Ado::Command::alabala $self->config('username') #Same as $self->app->config('alabala')->{username}
Subcommands shared by all command classes inheriting this class.
...
Ado::Command::adduser, Ado::Command::generate, Ado::Command::version
Красимир Беров (Krasimir Berov)
Copyright 2013-2014 Красимир Беров (Krasimir Berov).
This program is free software, you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License v3 (LGPL-3.0). You may copy, distribute and modify the software provided that modifications are open source. However, software that includes the license may release under a different license.
See http://opensource.org/licenses/lgpl-3.0.html for more information.
To install Ado, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ado
CPAN shell
perl -MCPAN -e shell install Ado
For more information on module installation, please visit the detailed CPAN module installation guide.