Lingy
view release on metacpan or search on metacpan
lib/Lingy/Main.pm view on Meta::CPAN
}, $class;
}
sub run {
my ($self, @args) = @_;
$self->getopt(@args);
my ($repl, $run, $eval, $version, $clj, $dev, $nrepl, $args) =
@{$self}{qw<repl run eval version clj dev nrepl args>};
local @ARGV = @$args;
return $self->do_nrepl if $nrepl;
RT->init;
RT->rep(qq<(clojure-repl-on)>) if $clj;
RT->rep(qq<(use 'lingy.devel)>) if $dev;
$version ? $self->do_version :
$eval ? $self->do_eval :
$repl ? $self->do_repl :
lib/Lingy/Main.pm view on Meta::CPAN
sub getopt {
my ($self, @args) = @_;
my $default = $self->default;
if ($default and not(@args or $self->from_stdin)) {
@args = ($default);
}
local @ARGV = @args;
my $spec = {};
my $opts = $self->options;
for my $key (keys %$opts) {
(my $name = $key) =~ s/\|.*//;
my $type = $opts->{$key};
if ($type eq 'bool') {
$spec->{$key} = \$self->{$name};
}
elsif ($type eq 'str') {
( run in 0.604 second using v1.01-cache-2.11-cpan-49f99fa48dc )