forked from EvergreenCrypto/docker-finance
container: root: common: add interpreter exit function
Wrapper (with optional message) to underlying interpreter exit call.
This commit is contained in:
@@ -276,6 +276,19 @@ int exec(const std::string& cmd)
|
|||||||
return gSystem->Exec(cmd.c_str());
|
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
|
//! \brief Make current timestamp
|
||||||
//! \return timestamp in "yyyy-mm-ddThh:mm:ssZ" format
|
//! \return timestamp in "yyyy-mm-ddThh:mm:ssZ" format
|
||||||
//! \since docker-finance 1.0.0
|
//! \since docker-finance 1.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user