container: root: common: add interpreter exit function

Wrapper (with optional message) to underlying interpreter exit call.
This commit is contained in:
2026-02-13 16:03:53 -08:00
parent 5c35bfd466
commit 8a1d06be63

View File

@@ -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