diff --git a/container/src/root/common/utility.hh b/container/src/root/common/utility.hh index b86c6f7..90d7dee 100644 --- a/container/src/root/common/utility.hh +++ b/container/src/root/common/utility.hh @@ -276,6 +276,19 @@ int exec(const std::string& cmd) return gSystem->Exec(cmd.c_str()); } +//! \brief Exit the interpreter with given status (and message) +//! \param code Exit code status (return code) +//! \param message Optional exit message +//! \since docker-finance 1.2.0 +void exit(const int code, const std::string& message = {}) +{ + // TODO(unassigned): logger + if (!message.empty()) + std::cout << "Exiting: '" << message << "'" << std::endl; + + gSystem->Exit(code); +} + //! \brief Make current timestamp //! \return timestamp in "yyyy-mm-ddThh:mm:ssZ" format //! \since docker-finance 1.0.0