Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
slightly more consistent option handling
  • Loading branch information
kraih committed Jul 7, 2013
1 parent 2acef0b commit 6fed490
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions script/hypnotoad
Expand Up @@ -8,12 +8,11 @@ BEGIN { unshift @INC, "$FindBin::Bin/../lib" }

use Getopt::Long qw(GetOptions :config no_auto_abbrev no_ignore_case);

GetOptions(
GetOptions
'f|foreground' => sub { $ENV{HYPNOTOAD_FOREGROUND} = 1 },
'h|help' => \my $help,
's|stop' => sub { $ENV{HYPNOTOAD_STOP} = 1 },
't|test' => sub { $ENV{HYPNOTOAD_TEST} = 1 }
);
't|test' => sub { $ENV{HYPNOTOAD_TEST} = 1 };

die <<EOF if $help || !(my $app = shift || $ENV{HYPNOTOAD_APP});
usage: $0 [OPTIONS] [APPLICATION]
Expand Down
5 changes: 2 additions & 3 deletions script/morbo
Expand Up @@ -8,13 +8,12 @@ BEGIN { unshift @INC, "$FindBin::Bin/../lib" }

use Getopt::Long qw(GetOptions :config no_auto_abbrev no_ignore_case);

GetOptions(
GetOptions
'h|help' => \my $help,
'l|listen=s' => \my @listen,
'm|mode=s' => sub { $ENV{MOJO_MODE} = $_[1] },
'v|verbose' => sub { $ENV{MORBO_VERBOSE} = 1 },
'w|watch=s' => \my @watch
);
'w|watch=s' => \my @watch;

die <<EOF if $help || !(my $app = shift);
usage: $0 [OPTIONS] [APPLICATION]
Expand Down

0 comments on commit 6fed490

Please sign in to comment.