Skip to content

Commit

Permalink
use getopt everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 1, 2016
1 parent bcf2943 commit 1ee6074
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions script/morbo
Expand Up @@ -14,8 +14,7 @@ getopt \@ARGV,
'v|verbose' => \$ENV{MORBO_VERBOSE},
'w|watch=s' => \my @watch;

my $app = shift;
die Mojolicious::Command->new->extract_usage if $help || !$app;
die Mojolicious::Command->new->extract_usage if $help || !(my $app = shift);
my $morbo = Mojo::Server::Morbo->new;
$morbo->daemon->listen(\@listen) if @listen;
$morbo->watch(\@watch) if @watch;
Expand Down
4 changes: 2 additions & 2 deletions t/mojolicious/lib/MojoliciousTest/Command/test_command.pm
@@ -1,11 +1,11 @@
package MojoliciousTest::Command::test_command;
use Mojo::Base 'Mojolicious::Command';

use Getopt::Long 'GetOptionsFromArray';
use Mojo::Util 'getopt';

sub run {
my ($self, @args) = @_;
GetOptionsFromArray \@args, 'too' => \my $too;
getopt \@args, ['default'], 'too' => \my $too;
return $too ? 'works too!' : 'works!';
}

Expand Down

0 comments on commit 1ee6074

Please sign in to comment.