diff --git a/lib/utils/mu-test-utils.hh b/lib/utils/mu-test-utils.hh index b35beb07..e1f3d0c7 100644 --- a/lib/utils/mu-test-utils.hh +++ b/lib/utils/mu-test-utils.hh @@ -130,12 +130,17 @@ struct TempDir { * * @return the path. */ - const std::string& path() {return path_; } + const std::string& path() const { return path_; } private: std::string path_; const bool autodelete_; }; +static inline auto format_as(const TempDir& td) { + return td.path(); +} + + /** * Temporary (RAII) timezone */ diff --git a/lib/utils/mu-utils-file.cc b/lib/utils/mu-utils-file.cc index a22e5040..b8966f77 100644 --- a/lib/utils/mu-utils-file.cc +++ b/lib/utils/mu-utils-file.cc @@ -289,6 +289,13 @@ Mu::run_command(std::initializer_list args) argvec.push_back(g_strdup(arg.c_str())); argvec.push_back({}); + { + std::vector qargs{}; + for(auto&& arg: args) + qargs.emplace_back("'" + arg + "'"); + mu_debug("run-command: {}", fmt::join(qargs, " ")); + } + GError *err{}; int wait_status{}; gchar *std_out{}, *std_err{}; diff --git a/lib/utils/mu-utils.hh b/lib/utils/mu-utils.hh index be2afe94..73f32dfd 100644 --- a/lib/utils/mu-utils.hh +++ b/lib/utils/mu-utils.hh @@ -145,7 +145,7 @@ auto mu_join(Range&& range, std::string_view sepa) { return fmt::join(std::forward(range), sepa); } -template +template std::tm mu_time(T t={}, bool use_utc=false) { ::time_t tt{static_cast<::time_t>(t)}; return use_utc ? fmt::gmtime(tt) : fmt::localtime(tt);