10# define MIM_WHICH "where"
12# define MIM_WHICH "which"
17namespace fs = std::filesystem;
27std::string
exec(std::string cmd);
35 :
std::logic_error(s) {}
48int run(std::string cmd, std::string args = {});
51std::string
escape(
const std::filesystem::path& path);
CmdNotFound(const std::string &s)
int run(std::string cmd, std::string args={})
Wraps sys::system and puts .exe at the back (Windows) and ./ at the front (otherwise) of cmd.
void require_run(const std::string &cmd)
Runs cmd via sys::system and throws if it exits with a non-zero status.
int system(std::string)
Wraps std::system and makes the return value usable.
std::string escape(const std::filesystem::path &path)
Returns the path as std::string and escapes all whitespaces with backslash.
std::string find_cmd(std::string)
std::string require_cmd(std::string_view name)
Locates name on the system or throws CmdNotFound.
std::optional< fs::path > path_to_libmim()
Yields std::nullopt if an error occurred.
std::string exec(std::string cmd)
Executes command cmd.