@@ -43,13 +43,12 @@ has [qw(blocking_stop serialize quirkiness total_sleeptime_during_kill)] => 0;
4343has [
4444 qw( execute code process_id pidfile return_status) ,
4545 qw( channel_in channel_out write_stream read_stream error_stream) ,
46- qw( _internal_err _internal_return _status)
46+ qw( _internal_err _internal_return _status args )
4747];
4848
4949has max_kill_attempts => 5;
5050has kill_whole_group => 0;
5151
52- has args => sub { [] };
5352has error => sub { Mojo::Collection-> new };
5453
5554has ioloop => sub { Mojo::IOLoop-> singleton };
@@ -465,7 +464,7 @@ sub start {
465464 die " Nothing to do" unless !!$self -> execute || !!$self -> code;
466465
467466 my @args
468- = $self -> args
467+ = defined ( $self -> args)
469468 ? ref ($self -> args) eq " ARRAY"
470469 ? @{$self -> args}
471470 : $self -> args
@@ -645,7 +644,7 @@ Mojo::IOLoop::ReadWriteProcess - Execute external programs or internal code bloc
645644 my $output = process( sub { print "Hello\n" } )->start()->wait_stop->getline;
646645
647646 # Handles seamelessy also external processes:
648- my $process = process(execute=> '/path/to/bin' )->args(qw(foo bar baz));
647+ my $process = process(execute=> '/path/to/bin' )->args([ qw(foo bar baz)] );
649648 $process->start();
650649 my $line_output = $process->getline();
651650 my $pid = $process->pid();
@@ -798,7 +797,7 @@ You do not need to specify C<code>, it is implied if no arguments is given.
798797
799798 # The process will print "Hello User"
800799
801- Array or arrayref of options to pass by to the external binary or the code block.
800+ Arguments pass to the external binary or the code block. Use arrayref to pass many .
802801
803802=head2 blocking_stop
804803
0 commit comments