summaryrefslogtreecommitdiff
path: root/command.h
blob: 91d3b08d6256653fcd7a7e44d0be716dfb2c81bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#pragma once

#include <vector>
#include <string>
#include <utility>


// Run a command and wait for completion; if successful (exit code 0), return
// the stdout output, else throw an exception.
std::string runCommand(const std::vector<std::string> &args);

// Run a command and wait for completion, returning the exit code and the
// stdout output.
std::pair<int, std::string> readCommand(const std::vector<std::string> &args);