File: Commands.pm

package info (click to toggle)
libmojolicious-perl 0.999926-1%2Bsqueeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,672 kB
  • ctags: 949
  • sloc: perl: 17,391; makefile: 4
file content (103 lines) | stat: -rw-r--r-- 2,170 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Copyright (C) 2008-2010, Sebastian Riedel.

package Mojolicious::Commands;

use strict;
use warnings;

use base 'Mojo::Commands';

__PACKAGE__->attr(
    namespaces => sub { [qw/Mojolicious::Command Mojo::Command/] });

# One day a man has everything, the next day he blows up a $400 billion
# space station, and the next day he has nothing. It makes you think.

1;
__END__

=head1 NAME

Mojolicious::Commands - Commands

=head1 SYNOPSIS

    use Mojo::Commands;

    # Command line interface
    my $commands = Mojolicious::Commands->new;
    $commands->run(@ARGV);

=head1 DESCRIPTION

L<Mojolicous::Commands> is the interactive command line interface to the
L<Mojolicious> framework.
It will automatically detect available commands in the
L<Mojolicious::Command> namespace.

These commands are available by default in addition to the commands listed in
L<Mojo::Commands>.

=over 4

=item C<generate>

    mojolicious generate
    mojolicious generate help

List available generator commands with short descriptions.

    mojolicious generate help <generator>

List available options for generator command with short descriptions.

=item C<generate app>

    mojolicious generate app <AppName>

Generate application directory structure for a fully functional
L<Mojolicious> application.

=item C<generate lite_app>

    mojolicious generate lite_app

Generate a fully functional L<Mojolicious::Lite> application.

=item C<inflate>

    myapp.pl inflate

Turn embedded files from the C<__DATA__> section into real files.

=item C<routes>

    myapp.pl routes
    script/myapp routes

List application routes.

=back

=head1 ATTRIBUTES

L<Mojolicious::Commands> inherits all attributes from L<Mojo::Commands> and
implements the following new ones.

=head2 C<namespaces>

    my $namespaces = $commands->namespaces;
    $commands      = $commands->namespaces(['Mojolicious::Commands']);

Namespaces to search for available commands, defaults to L<Mojo::Command> and
L<Mojolicious::Command>.

=head1 METHODS

L<Mojolicious::Commands> inherits all methods from L<Mojo::Commands>.

=head1 SEE ALSO

L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicious.org>.

=cut