Skip to content

Commit

Permalink
better command example
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 30, 2012
1 parent b6bdc48 commit 49adce0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

3.16 2012-07-29
3.16 2012-07-30
- Improved documentation.

3.15 2012-07-28
Expand Down
11 changes: 1 addition & 10 deletions lib/Mojolicious/Command.pm
Expand Up @@ -101,13 +101,8 @@ Mojolicious::Command - Command base class
# Lower case command name
package Mojolicious::Command::mycommand;
# Subclass
use Mojo::Base 'Mojolicious::Command';
# Take care of command line options
use Getopt::Long 'GetOptions';
# Short description
has description => "My first Mojo command.\n";
Expand All @@ -121,11 +116,7 @@ Mojolicious::Command - Command base class
# <suitable Futurama quote here>
sub run {
my $self = shift;
# Handle options
local @ARGV = @_;
GetOptions('s|something' => sub { $something = 1 });
my ($self, @args) = @_;
# Magic here! :)
}
Expand Down

0 comments on commit 49adce0

Please sign in to comment.