mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-16 16:33:55 +02:00
Make the process building functions chainable
This commit is contained in:
+10
-3
@@ -183,16 +183,23 @@ class Process {
|
|||||||
Process(std::string command);
|
Process(std::string command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an argument to the command invocation.
|
* Add an argument to the command invocation. Returns a reference to this
|
||||||
|
* object for easier chaining.
|
||||||
*/
|
*/
|
||||||
inline void arg(std::string arg) { args_.emplace_back(std::move(arg)); }
|
inline Process& arg(std::string arg) {
|
||||||
|
args_.emplace_back(std::move(arg));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use the specified environment for this command.
|
* Use the specified environment for this command.
|
||||||
*
|
*
|
||||||
* @see environment
|
* @see environment
|
||||||
*/
|
*/
|
||||||
inline void environment(ProcessEnvironment env) { env_ = std::move(env); }
|
inline Process& environment(ProcessEnvironment env) {
|
||||||
|
env_ = std::move(env);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Spawn the process, leave STDIN, redirect STDERR to `/dev/null`, and
|
* Spawn the process, leave STDIN, redirect STDERR to `/dev/null`, and
|
||||||
|
|||||||
Reference in New Issue
Block a user