Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mention which options are parsed during compile time
  • Loading branch information
kraih committed Jan 14, 2015
1 parent 45ea7b0 commit 0283ada
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/Mojolicious.pm
Expand Up @@ -646,7 +646,9 @@ L<Mojolicious> distribution see L<Mojolicious::Plugins/"PLUGINS">.
$app->start(@ARGV);
Start the command line interface for your application, for a full list of
commands available by default see L<Mojolicious::Commands/"COMMANDS">.
commands available by default see L<Mojolicious::Commands/"COMMANDS">. Note
that the options C<-h>/C<--help>, C<--home> and C<-m>/C<--mode>, which are
shared by all commands, will be parsed from C<@ARGV> during compile time.
# Always start daemon
$app->start('daemon', '-l', 'http://*:8080');
Expand Down
6 changes: 4 additions & 2 deletions lib/Mojolicious/Commands.pm
Expand Up @@ -54,7 +54,7 @@ sub run {

# Help
$name = shift @args if my $help = $name eq 'help';
$help = $ENV{MOJO_HELP} = $ENV{MOJO_HELP} ? 1 : $help;
$help = $ENV{MOJO_HELP} ||= $help;

# Remove options shared by all commands before loading the command
_args(\@args);
Expand Down Expand Up @@ -316,7 +316,9 @@ disabled with the C<MOJO_NO_DETECT> environment variable.
Mojolicious::Commands->start_app('MyApp');
Mojolicious::Commands->start_app(MyApp => @ARGV);
Load application from class and start the command line interface for it.
Load application from class and start the command line interface for it. Note
that the options C<-h>/C<--help>, C<--home> and C<-m>/C<--mode>, which are
shared by all commands, will be parsed from C<@ARGV> during compile time.
# Always start daemon for application
Mojolicious::Commands->start_app('MyApp', 'daemon', '-l', 'http://*:8080');
Expand Down

0 comments on commit 0283ada

Please sign in to comment.