diff -r c87bde92805f -r 82680ce258d6 src/process.h --- a/src/process.h Tue Jan 21 20:24:45 2025 +0100 +++ b/src/process.h Tue Jan 21 21:01:54 2025 +0100 @@ -31,13 +31,17 @@ namespace fm { class process final { - std::string m_path; + std::string m_path = "/bin/false"; + std::string m_dir = "."; std::string m_output; public: - explicit process(std::string path); - ~process() = default; + void setbin(std::string path); + void chdir(std::string path); - [[nodiscard]] bool exec(std::vector args); + [[nodiscard]] int exec(std::vector args, bool capture = false); + [[nodiscard]] int exec_log(std::vector args) { + return exec(std::move(args), true); + } [[nodiscard]] const std::string &output() const; };