Skip to content

Commit

Permalink
mention that command line arguments are passed through
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 16, 2014
1 parent fd2e74f commit 3fe6d20
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/Mojolicious/Guides/Cookbook.pod
Expand Up @@ -1210,16 +1210,17 @@ that they will be picked up automatically by the command line interface?
has usage => "Usage: APPLICATION spy [TARGET]\n";

sub run {
my ($self, $target) = @_;
my ($self, @args) = @_;

# Leak secret passphrases
say for @{$self->app->secrets} if $target eq 'secrets';
say for @{$self->app->secrets} if $args[0] eq 'secrets';
}

1;

There are many more useful attributes and methods in L<Mojolicious::Command>
that you can use or overload.
Command line arguments are passed right through and there are many useful
attributes and methods in L<Mojolicious::Command> that you can use or
overload.

$ mojo spy secrets
HelloWorld
Expand Down

0 comments on commit 3fe6d20

Please sign in to comment.