add files
|
1 |
package Mojolicious::Command::generate; |
2 |
use Mojo::Base 'Mojolicious::Commands'; |
|
3 | ||
4 |
has description => "Generate files and directories from templates.\n"; |
|
5 |
has hint => <<EOF; |
|
6 | ||
7 |
See '$0 generate help GENERATOR' for more information on a specific generator. |
|
8 |
EOF |
|
9 |
has message => <<EOF; |
|
10 |
usage: $0 generate GENERATOR [OPTIONS] |
|
11 | ||
12 |
These generators are currently available: |
|
13 |
EOF |
|
14 |
has namespaces => sub { ['Mojolicious::Command::generate'] }; |
|
15 |
has usage => "usage: $0 generate GENERATOR [OPTIONS]\n"; |
|
16 | ||
17 |
sub help { shift->run(@_) } |
|
18 | ||
19 |
1; |
|
20 | ||
21 |
=encoding utf8 |
|
22 | ||
23 |
=head1 NAME |
|
24 | ||
25 |
Mojolicious::Command::generate - Generator command |
|
26 | ||
27 |
=head1 SYNOPSIS |
|
28 | ||
29 |
use Mojolicious::Command::generate; |
|
30 | ||
31 |
my $generator = Mojolicious::Command::generate->new; |
|
32 |
$generator->run(@ARGV); |
|
33 | ||
34 |
=head1 DESCRIPTION |
|
35 | ||
36 |
L<Mojolicious::Command::generate> lists available generators. |
|
37 | ||
38 |
This is a core command, that means it is always enabled and its code a good |
|
39 |
example for learning to build new commands, you're welcome to fork it. |
|
40 | ||
41 |
=head1 ATTRIBUTES |
|
42 | ||
43 |
L<Mojolicious::Command::generate> inherits all attributes from |
|
44 |
L<Mojolicious::Commands> and implements the following new ones. |
|
45 | ||
46 |
=head2 description |
|
47 | ||
48 |
my $description = $generator->description; |
|
49 |
$generator = $generator->description('Foo!'); |
|
50 | ||
51 |
Short description of this command, used for the command list. |
|
52 | ||
53 |
=head2 hint |
|
54 | ||
55 |
my $hint = $generator->hint; |
|
56 |
$generator = $generator->hint('Foo!'); |
|
57 | ||
58 |
Short hint shown after listing available generator commands. |
|
59 | ||
60 |
=head2 usage |
|
61 | ||
62 |
my $usage = $generator->usage; |
|
63 |
$generator = $generator->usage('Foo!'); |
|
64 | ||
65 |
Usage information for this command, used for the help screen. |
|
66 | ||
67 |
=head2 message |
|
68 | ||
69 |
my $msg = $generator->message; |
|
70 |
$generator = $generator->message('Bar!'); |
|
71 | ||
72 |
Short usage message shown before listing available generator commands. |
|
73 | ||
74 |
=head2 namespaces |
|
75 | ||
76 |
my $namespaces = $generator->namespaces; |
|
77 |
$generator = $generator->namespaces(['MyApp::Command::generate']); |
|
78 | ||
79 |
Namespaces to search for available generator commands, defaults to |
|
80 |
L<Mojolicious::Command::generate>. |
|
81 | ||
82 |
=head1 METHODS |
|
83 | ||
84 |
L<Mojolicious::Command::generate> inherits all methods from |
|
85 |
L<Mojolicious::Commands> and implements the following new ones. |
|
86 | ||
87 |
=head2 help |
|
88 | ||
89 |
$generator->help('app'); |
|
90 | ||
91 |
Print usage information for generator command. |
|
92 | ||
93 |
=head1 SEE ALSO |
|
94 | ||
95 |
L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicio.us>. |
|
96 | ||
97 |
=cut |