Skip to content
Snippets Groups Projects
Commit e88ab23b authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Process.spawn_pike: Added launcher argument.

parent 36b57377
No related branches found
No related tags found
No related merge requests found
......@@ -442,9 +442,18 @@ protected array(string) runpike;
//! order to include these components in command path (module path is
//! included by default.)
//!
//! @param launcher
//! Optional launcher prefix command used to spawn the pike binary.
//!
//! When used this is typically something like
//! @expr{({ "/usr/bin/valgrind" })@}.
//!
//! Defaults to the empty array.
//!
//! @seealso
//! @[Process.Process]
Process spawn_pike(array(string) argv, void|mapping(string:mixed) options)
Process spawn_pike(array(string) argv, void|mapping(string:mixed) options,
array(string)|void launcher)
{
if (!runpike) {
array(string) res = ({
......@@ -481,7 +490,8 @@ Process spawn_pike(array(string) argv, void|mapping(string:mixed) options)
res[0] = search_path(res[0]);
runpike = res;
}
return Process(runpike + argv, options);
if (!launcher) launcher = ({});
return Process(launcher + runpike + argv, options);
}
//! Easy and lazy way of using @[Process.Process] that runs a process
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment