On 11/8/25 2:09 AM, Peter Pentchev wrote:
4. All the parameters to `run` are documented in `run`.


The docs for run:

sub run(
    *@args ($, *@),
    :$in = '-',
    :$out = '-',
    :$err = '-',
    Bool :$bin = False,
    Bool :$chomp = True,
    Bool :$merge = False,
    Str:D :$enc = 'UTF-8',
    Str:D :$nl = "\n",
    :$cwd = $*CWD,
    Hash() :$env = %*ENV,
    :$arg0,
    :$win-verbatim-args = False
--> Proc:D)


The actual sub:

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,
    :$arg0,
    :$win-verbatim-args = False) {

    my $proc := Proc.new(
       :$in, :$out, :$err, :$bin, :$chomp, :$merge, :$enc, :$nl);
    $proc.spawn(@args, :$cwd, :$env, :$arg0, :$win-verbatim-args);
    $proc
}

Looks like everything is there.



The Docs for Proc:

method new(Proc:U:
        :$in = '-',
        :$out = '-',
        :$err = '-',
        Bool :$bin = False,
        Bool :$chomp = True,
        Bool :$merge = False,
        Str:D :$enc = 'UTF-8',
        Str:D :$nl = "\n",
    --> Proc:D)


The actual source code for Proc:

my class Proc {
    has IO::Pipe $.in;
    has IO::Pipe $.out;
    has IO::Pipe $.err;
    has Str $.os-error;
    has $.exitcode is default(Nil);
    has $.signal;
    has $.pid is default(Nil);
    has @.command;

    has Proc::Async $!proc;
    has Bool $!w;
    has @!pre-spawn;
    has @!post-spawn;
    has $!active-handles = 0;
    has &!start-stdout;
    has &!start-stderr;
    has $!finished;

    submethod BUILD(
      :$in = '-',
      :$out = '-',
      :$err = '-',
      :$exitcode,
      Bool :$bin,
      Bool :$chomp = True,
      Bool :$merge,
      :$command,
      Str :$enc,
      Str:D :$nl = "\n", :
      $signal --> Nil) {
      @!command := $command.List if command.List

    method exitcode {
        self!wait-for-finish;
        $!exitcode
    }

    method signal {
        self!wait-for-finish;
        $!signal
    }



A bunch of stuff is missing from the docs:
$.extcode, $.signal, $.pid, @.command.
Mostly the things from "submethod BUILD".
I think that submethod is kind of cool!

The ones with the ! can be forgiven as they
are private to the rakumod.






Reply via email to