.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Mojolicious::Commands 3pm" .TH Mojolicious::Commands 3pm "2012-09-05" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Mojolicious::Commands \- Command line interface .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Mojolicious::Commands; \& \& # Command line interface \& my $commands = Mojolicious::Commands\->new; \& $commands\->run(@ARGV); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Mojolicious::Commands is the interactive command line interface to the Mojolicious framework. It will automatically detect available commands in the \f(CW\*(C`Mojolicious::Command\*(C'\fR namespace. .SH "COMMANDS" .IX Header "COMMANDS" These commands are available by default. .ie n .SS """help""" .el .SS "\f(CWhelp\fP" .IX Subsection "help" .Vb 3 \& $ mojo \& $ mojo help \& $ ./myapp.pl help .Ve .PP List available commands with short descriptions. .PP .Vb 2 \& $ mojo help \& $ ./myapp.pl help .Ve .PP List available options for the command with short descriptions. .ie n .SS """cgi""" .el .SS "\f(CWcgi\fP" .IX Subsection "cgi" .Vb 1 \& $ ./myapp.pl cgi .Ve .PP Start application with \s-1CGI\s0 backend. .ie n .SS """cpanify""" .el .SS "\f(CWcpanify\fP" .IX Subsection "cpanify" .Vb 1 \& $ mojo cpanify \-u sri \-p secr3t Mojolicious\-Plugin\-Fun\-0.1.tar.gz .Ve .PP Upload files to \s-1CPAN\s0. .ie n .SS """daemon""" .el .SS "\f(CWdaemon\fP" .IX Subsection "daemon" .Vb 1 \& $ ./myapp.pl daemon .Ve .PP Start application with standalone \s-1HTTP\s0 1.1 server backend. .ie n .SS """eval""" .el .SS "\f(CWeval\fP" .IX Subsection "eval" .Vb 1 \& $ ./myapp.pl eval \*(Aqsay app\->home\*(Aq .Ve .PP Run code against application. .ie n .SS """generate""" .el .SS "\f(CWgenerate\fP" .IX Subsection "generate" .Vb 3 \& $ mojo generate \& $ mojo generate help \& $ ./myapp.pl generate help .Ve .PP List available generator commands with short descriptions. .PP .Vb 2 \& $ mojo generate help \& $ ./myapp.pl generate help .Ve .PP List available options for generator command with short descriptions. .ie n .SS """generate app""" .el .SS "\f(CWgenerate app\fP" .IX Subsection "generate app" .Vb 1 \& $ mojo generate app .Ve .PP Generate application directory structure for a fully functional Mojolicious application. .ie n .SS """generate lite_app""" .el .SS "\f(CWgenerate lite_app\fP" .IX Subsection "generate lite_app" .Vb 1 \& $ mojo generate lite_app .Ve .PP Generate a fully functional Mojolicious::Lite application. .ie n .SS """generate makefile""" .el .SS "\f(CWgenerate makefile\fP" .IX Subsection "generate makefile" .Vb 2 \& $ mojo generate makefile \& $ ./myapp.pl generate makefile .Ve .PP Generate \f(CW\*(C`Makefile.PL\*(C'\fR file for application. .ie n .SS """generate plugin""" .el .SS "\f(CWgenerate plugin\fP" .IX Subsection "generate plugin" .Vb 1 \& $ mojo generate plugin .Ve .PP Generate directory structure for a fully functional Mojolicious plugin. .ie n .SS """get""" .el .SS "\f(CWget\fP" .IX Subsection "get" .Vb 2 \& $ mojo get http://mojolicio.us \& $ ./myapp.pl get /foo .Ve .PP Perform requests to remote host or local application. .ie n .SS """inflate""" .el .SS "\f(CWinflate\fP" .IX Subsection "inflate" .Vb 1 \& $ ./myapp.pl inflate .Ve .PP Turn templates and static files embedded in the \f(CW\*(C`DATA\*(C'\fR sections of your application into real files. .ie n .SS """psgi""" .el .SS "\f(CWpsgi\fP" .IX Subsection "psgi" .Vb 1 \& $ ./myapp.pl psgi .Ve .PP Start application with \s-1PSGI\s0 backend. .ie n .SS """routes""" .el .SS "\f(CWroutes\fP" .IX Subsection "routes" .Vb 1 \& $ ./myapp.pl routes .Ve .PP List application routes. .ie n .SS """test""" .el .SS "\f(CWtest\fP" .IX Subsection "test" .Vb 3 \& $ mojo test \& $ ./myapp.pl test \& $ ./myapp.pl test t/fun.t .Ve .PP Runs application tests from the \f(CW\*(C`t\*(C'\fR directory. .ie n .SS """version""" .el .SS "\f(CWversion\fP" .IX Subsection "version" .Vb 2 \& $ mojo version \& $ ./myapp.pl version .Ve .PP Show version information for installed core and optional modules, very useful for debugging. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" Mojolicious::Commands inherits all attributes from Mojo::Command and implements the following new ones. .ie n .SS """hint""" .el .SS "\f(CWhint\fP" .IX Subsection "hint" .Vb 2 \& my $hint = $commands\->hint; \& $commands = $commands\->hint(\*(AqFoo!\*(Aq); .Ve .PP Short hint shown after listing available commands. .ie n .SS """message""" .el .SS "\f(CWmessage\fP" .IX Subsection "message" .Vb 2 \& my $message = $commands\->message; \& $commands = $commands\->message(\*(AqHello World!\*(Aq); .Ve .PP Short usage message shown before listing available commands. .ie n .SS """namespaces""" .el .SS "\f(CWnamespaces\fP" .IX Subsection "namespaces" .Vb 2 \& my $namespaces = $commands\->namespaces; \& $commands = $commands\->namespaces([\*(AqMojolicious::Commands\*(Aq]); .Ve .PP Namespaces to load commands from, defaults to \f(CW\*(C`Mojolicious::Command\*(C'\fR and \&\f(CW\*(C`Mojo::Command\*(C'\fR. .PP .Vb 2 \& # Add another namespace to load commands from \& push @{$commands\->namespaces}, \*(AqMyApp::Command\*(Aq; .Ve .SH "METHODS" .IX Header "METHODS" Mojolicious::Commands inherits all methods from Mojo::Command and implements the following new ones. .ie n .SS """detect""" .el .SS "\f(CWdetect\fP" .IX Subsection "detect" .Vb 2 \& my $env = $commands\->detect; \& my $env = $commands\->detect($guess); .Ve .PP Try to detect environment. .ie n .SS """run""" .el .SS "\f(CWrun\fP" .IX Subsection "run" .Vb 2 \& $commands\->run; \& $commands\->run(@ARGV); .Ve .PP Load and run commands. Automatic deployment environment detection can be disabled with the \f(CW\*(C`MOJO_NO_DETECT\*(C'\fR environment variable. .ie n .SS """start""" .el .SS "\f(CWstart\fP" .IX Subsection "start" .Vb 2 \& Mojolicious::Commands\->start; \& Mojolicious::Commands\->start(@ARGV); .Ve .PP Start the command line interface. .PP .Vb 2 \& # Always start daemon and ignore @ARGV \& Mojolicious::Commands\->start(\*(Aqdaemon\*(Aq, \*(Aq\-l\*(Aq, \*(Aqhttp://*:8080\*(Aq); .Ve .ie n .SS """start_app""" .el .SS "\f(CWstart_app\fP" .IX Subsection "start_app" .Vb 2 \& Mojolicious::Commands\->start_app(\*(AqMyApp\*(Aq); \& Mojolicious::Commands\->start_app(MyApp => @ARGV); .Ve .PP Load application and start the command line interface for it. .PP .Vb 2 \& # Always start daemon for application and ignore @ARGV \& Mojolicious::Commands\->start_app(\*(AqMyApp\*(Aq, \*(Aqdaemon\*(Aq, \*(Aq\-l\*(Aq, \*(Aqhttp://*:8080\*(Aq); .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Mojolicious, Mojolicious::Guides, .