]> git.tdb.fi Git - builder.git/blobdiff - source/externaltask.h
Utility function for capturing command output
[builder.git] / source / externaltask.h
index 8127c75762459f9a4c73f1c532412a7567c45281..d997f9a7b4891ad473aea0d2cfdffb8bcd53bef5 100644 (file)
@@ -49,6 +49,10 @@ public:
        void set_stdout(Destination);
        void set_stderr(Destination);
        const std::string &get_output() const { return output; }
+
+       /** Executes a command and captures its output.  Stderr is ignored, but if
+       the command exits with a nonzero status, an exception is thrown. */
+       static std::string run_and_capture_output(const Arguments &, const Msp::FS::Path & = Msp::FS::Path());
 };
 
 #endif