Skip to content

Commit

Permalink
Make sub run/shell multi's
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Feb 27, 2018
1 parent c1d2a5b commit 4da2418
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/Proc.pm
Expand Up @@ -225,15 +225,17 @@ my class Proc {
}
}

sub run(*@args where .so, :$in = '-', :$out = '-', :$err = '-',
proto sub run(|) {*}
multi sub run(*@args where .so, :$in = '-', :$out = '-', :$err = '-',
Bool :$bin, Bool :$chomp = True, Bool :$merge,
Str :$enc, Str:D :$nl = "\n", :$cwd = $*CWD, :$env) {
my $proc = Proc.new(:$in, :$out, :$err, :$bin, :$chomp, :$merge, :$enc, :$nl);
$proc.spawn(@args, :$cwd, :$env);
$proc
}

sub shell($cmd, :$in = '-', :$out = '-', :$err = '-',
proto sub shell(|) {*}
multi sub shell($cmd, :$in = '-', :$out = '-', :$err = '-',
Bool :$bin, Bool :$chomp = True, Bool :$merge,
Str :$enc, Str:D :$nl = "\n", :$cwd = $*CWD, :$env) {
my $proc = Proc.new(:$in, :$out, :$err, :$bin, :$chomp, :$merge, :$enc, :$nl);
Expand Down

0 comments on commit 4da2418

Please sign in to comment.