about summary refs log tree commit diff
path: root/src/libutil/util.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-11-01T17·43+0100
committerEelco Dolstra <edolstra@gmail.com>2017-11-01T17·43+0100
commite026bc3b05ca45c2d855d0a38820034ab4ef3c4c (patch)
tree3a4d9435ac4c37df0099439cf42c71f44cb44dba /src/libutil/util.hh
parent1969f357b7f9abbff82b613b88ae53b84ff4e483 (diff)
fetchMercurial: Don't fetch hashes we already have
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r--src/libutil/util.hh17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 63a93f2ca6a7..a3494e09b09b 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -245,6 +245,23 @@ string runProgram(Path program, bool searchPath = false,
     const Strings & args = Strings(),
     const std::experimental::optional<std::string> & input = {});
 
+struct RunOptions
+{
+    Path program;
+    bool searchPath = true;
+    Strings args;
+    std::experimental::optional<std::string> input;
+    bool _killStderr = false;
+
+    RunOptions(const Path & program, const Strings & args)
+        : program(program), args(args) { };
+
+    RunOptions & killStderr(bool v) { _killStderr = true; return *this; }
+};
+
+std::pair<int, std::string> runProgram(const RunOptions & options);
+
+
 class ExecError : public Error
 {
 public: