Skip to content

Commit

Permalink
moved morbo and hypnotoad usage messages as well
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 25, 2014
1 parent 18ea4de commit 763db50
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 40 deletions.
31 changes: 16 additions & 15 deletions script/hypnotoad
Expand Up @@ -14,19 +14,11 @@ GetOptions
's|stop' => sub { $ENV{HYPNOTOAD_STOP} = 1 },
't|test' => sub { $ENV{HYPNOTOAD_TEST} = 1 };

die <<EOF if $help || !(my $app = shift || $ENV{HYPNOTOAD_APP});
Usage: hypnotoad [OPTIONS] [APPLICATION]
hypnotoad script/myapp
hypnotoad myapp.pl
hypnotoad -f myapp.pl
Options:
-f, --foreground Keep manager process in foreground.
-h, --help Show this message.
-s, --stop Stop server gracefully.
-t, --test Test application and exit.
EOF
my $app = shift || $ENV{HYPNOTOAD_APP};
if ($help || !$app) {
require Mojolicious::Command;
die Mojolicious::Command->new->extract_usage;
}

require Mojo::Server::Hypnotoad;
Mojo::Server::Hypnotoad->new->run($app);
Expand All @@ -39,8 +31,17 @@ hypnotoad - Hypnotoad HTTP and WebSocket server
=head1 SYNOPSIS
$ hypnotoad --help
$ hypnotoad myapp.pl
Usage: hypnotoad [OPTIONS] [APPLICATION]
hypnotoad script/myapp
hypnotoad myapp.pl
hypnotoad -f myapp.pl
Options:
-f, --foreground Keep manager process in foreground.
-h, --help Show this message.
-s, --stop Stop server gracefully.
-t, --test Test application and exit.
=head1 DESCRIPTION
Expand Down
52 changes: 27 additions & 25 deletions script/morbo
Expand Up @@ -15,29 +15,11 @@ GetOptions
'v|verbose' => sub { $ENV{MORBO_VERBOSE} = 1 },
'w|watch=s' => \my @watch;

die <<EOF if $help || !(my $app = shift);
Usage: morbo [OPTIONS] [APPLICATION]
morbo script/myapp
morbo myapp.pl
morbo -m production -l https://*:443 -l http://[::]:3000 myapp.pl
morbo -w /usr/local/lib -w public myapp.pl
Options:
-h, --help Show this message.
-l, --listen <location> One or more locations you want to listen on,
defaults to the value of MOJO_LISTEN or
"http://*:3000".
-m, --mode <name> Operating mode for your application, defaults
to the value of MOJO_MODE/PLACK_ENV or
"development".
-v, --verbose Print details about what files changed to
STDOUT.
-w, --watch <directory/file> One or more directories and files to watch
for changes, defaults to the application
script as well as the "lib" and "templates"
directories in the current working directory.
EOF
my $app = shift;
if ($help || !$app) {
require Mojolicious::Command;
die Mojolicious::Command->new->extract_usage;
}

$ENV{MOJO_LISTEN} = join ',', @listen if @listen;
require Mojo::Server::Morbo;
Expand All @@ -53,8 +35,28 @@ morbo - Morbo HTTP and WebSocket development server
=head1 SYNOPSIS
$ morbo --help
$ morbo myapp.pl
Usage: morbo [OPTIONS] [APPLICATION]
morbo script/myapp
morbo myapp.pl
morbo -m production -l https://*:443 -l http://[::]:3000 myapp.pl
morbo -w /usr/local/lib -w public myapp.pl
Options:
-h, --help Show this message.
-l, --listen <location> One or more locations you want to listen
on, defaults to the value of MOJO_LISTEN or
"http://*:3000".
-m, --mode <name> Operating mode for your application,
defaults to the value of
MOJO_MODE/PLACK_ENV or "development".
-v, --verbose Print details about what files changed to
STDOUT.
-w, --watch <directory/file> One or more directories and files to watch
for changes, defaults to the application
script as well as the "lib" and "templates"
directories in the current working
directory.
=head1 DESCRIPTION
Expand Down

0 comments on commit 763db50

Please sign in to comment.