From: Graham Knop Date: Sat, 12 Oct 2013 08:05:05 +0000 (-0400) Subject: add shelltype option X-Git-Tag: v2.000_000~45 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=db6f44a9a1caec5091a6fa8d280c9f5f300ad216;p=p5sagit%2Flocal-lib.git add shelltype option --- diff --git a/lib/local/lib.pm b/lib/local/lib.pm index f735680..1e4808e 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -15,6 +15,7 @@ sub import { my ($class, @args) = @_; my @steps; + my %opts; while (@args) { my $arg = shift @args; @@ -40,6 +41,10 @@ DEATH elsif ( $arg eq '--deactivate-all' ) { push @steps, ['deactivate_all']; } + elsif ( $arg =~ /^--shelltype(?:=(.*))?$/ ) { + my $shell = defined $1 ? $1 : shift @args; + $opts{shelltype} = $shell; + } elsif ( $arg =~ /^--/ ) { die "Unknown import argument: $arg"; } @@ -51,7 +56,7 @@ DEATH push @steps, ['activate', undef]; } - my $self = $class->new; + my $self = $class->new(%opts); for (@steps) { my ($method, @args) = @$_;