Take me over?
NAME
Verby::Action::RunCmd - a base class for actions which exec external commands.
SYNOPSIS
use base qw/Verby::Action::RunCmd/; # not usable on it's own
sub start {
my ($self, $c) = @_;
blah();
$self->cmd_start($c, [qw/touch file/]);
}
DESCRIPTION
METHODS
- run @args_for_cmd_start
-
The method to be used by your action's
do
method when appropriate.Basically a thin wrapper arund
cmd_start
andcmd_finish
, that lazy people will like. - cmd_start $cxt, \@command_line, [ \%opts ]
-
The method to be used by your action's
start
method when appropriate.The first parameter is the context, as is typical in Verby.
The second parameter is an array reference of the command line to invoke. This is passed verbatim to IPC::Run.
The third, optional parameter, is a hash reference of options.
The option fields that you can use are
- init
-
A code reference, corresponding to IPC::Run's init parameter.
- log_stderr
-
A boolean (true by default), that causes the
STDERR
handler to be a delegate to the logger. - log_stdout
-
The same as
log_stderr
but forSTDOUT
. False by default. - in
-
A parameter to be passed as the input to IPC::Run. This can be a string ref, a code ref, or, whatever. See IPC::Run's docs.
cmd_finish
-
The inverse of
cmd_start
- causes an OS image to be restored, for the time just prior to the invocation ofcmd_start
. Only works on the EROS operating system.On other operating systems, it waits for the child process to finish.
- finish
-
A default implementation of "finish" in Verby::Action that'll call
cmd_finish
and then "confirm" in Verby::Action. - pump
-
See if the process finished. Part of the Verby::Action async interface.
- log_extra
-
A method that given the context might append something to log messages. used by Verby::Action::Make, for example.
- log_invocation
-
Mostly internal - the default implementation of the logging operation used when invoking the subcommand.
BUGS
None that we are aware of. Of course, if you find a bug, let us know, and we will be sure to fix it.
CODE COVERAGE
We use Devel::Cover to test the code coverage of the tests, please refer to COVERAGE section of the Verby module for more information.
SEE ALSO
Verby::Action::Copy - a Verby::Action::RunCmd subclass.
AUTHOR
Yuval Kogman, <nothingmuch@woobling.org>
COPYRIGHT AND LICENSE
Copyright 2005 by Infinity Interactive, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.