Skip to content

Commit

Permalink
Allow passing in an explicit config file
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwistow committed Apr 30, 2012
1 parent f6bdcb1 commit 554e0fb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/Net/Fastly.pm
Expand Up @@ -498,8 +498,14 @@ sub get_options {
%options = load_options($config);
last;
}
while (@ARGV && $ARGV[0] =~ m!^-+(\w+)\=(\w+)$!) {
$options{$1} = $2;
while (@ARGV && $ARGV[0] =~ m!^-+(\w+)\=(.+)$!) {
if ($1 eq "config") {
die "No such file '$2'" unless -f $2;
my %tmp = load_options($2);
$options{$_} = $tmp{$_} for keys %tmp;
} else {
$options{$1} = $2;
}
shift @ARGV;
}
die "Couldn't find options from command line arguments or ".join(", ", @configs)."\n" unless keys %options;
Expand Down

0 comments on commit 554e0fb

Please sign in to comment.