summaryrefslogtreecommitdiff
path: root/hscript/util.hh
diff options
context:
space:
mode:
Diffstat (limited to 'hscript/util.hh')
-rw-r--r--hscript/util.hh11
1 files changed, 11 insertions, 0 deletions
diff --git a/hscript/util.hh b/hscript/util.hh
index d350cd3..47da022 100644
--- a/hscript/util.hh
+++ b/hscript/util.hh
@@ -14,6 +14,7 @@
#define HSCRIPT_UTIL_HH
#include <string>
+#include <vector>
/*! Download the contents of a URL to a path.
* @param url The URL to download.
@@ -22,4 +23,14 @@
*/
bool download_file(const std::string &url, const std::string &path);
+/*! Run a command.
+ * @param cmd The command to run.
+ * @param args Arguments to pass to the command.
+ * @returns 0 if the command exited normally with status 0,
+ * the exit code if the command exited abnormally,
+ * -1 if the command signalled.
+ * @note Status of the command is output using +output_error+.
+ */
+int run_command(const std::string &cmd, const std::vector<std::string> &args);
+
#endif /* !HSCRIPT_UTIL_HH */