NAME
Mojo::Commands - Commands
SYNOPSIS
use Mojo::Commands;
# Command line interface
my $commands = Mojo::Commands->new;
$commands->run(@ARGV);
DESCRIPTION
Mojo::Commands is the interactive command line interface to the Mojo framework. It will automatically detect available commands in the Mojo::Command namespace. Commands are implemented by subclassing Mojo::Command.
These commands are available by default.
help-
mojo mojo helpList available commands with short descriptions.
mojo help <command>List available options for the command with short descriptions.
cgi-
mojo cgi script/myapp cgiStart application with CGI backend.
daemon-
mojo cgi script/myapp daemonStart application with standalone HTTP 1.1 server backend.
fastcgi-
mojo fastcgi script/myapp fastcgiStart application with FastCGI backend.
get-
mojo get http://mojolicious.org script/myapp get /fooPerform GET request to remote host or local application.
test-
mojo test script/myapp test script/myapp test t/foo.tRuns application tests from the
tdirectory. version-
mojo versionList version information for installed core and optional modules, very useful for debugging.
ATTRIBUTES
Mojo::Commands inherits all attributes from Mojo::Command and implements the following new ones.
hint
my $hint = $commands->hint;
$commands = $commands->hint('Foo!');
Short hint shown after listing available commands.
message
my $message = $commands->message;
$commands = $commands->message('Hello World!');
Short usage message shown before listing available commands.
namespaces
my $namespaces = $commands->namespaces;
$commands = $commands->namespaces(['Mojo::Command']);
Namespaces to search for available commands, defaults to Mojo::Command.
METHODS
Mojo::Commands inherits all methods from Mojo::Command and implements the following new ones.
detect
my $env = $commands->detect;
my $env = $commands->detect($guess);
Try to detect environment.
run
$commands->run;
$commands->run(@ARGV);
Load and run commands.
start
Mojo::Commands->start;
Mojo::Commands->start(@ARGV);
Start the command line interface.