From c90760488f8a11886d2bb2baee4cc2714ac2fc83 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 17 Dec 2017 08:51:35 +0200 Subject: Add support for printing canonical process exit status description --- libbutl/process.mxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libbutl/process.mxx') diff --git a/libbutl/process.mxx b/libbutl/process.mxx index af6f995..27c13fa 100644 --- a/libbutl/process.mxx +++ b/libbutl/process.mxx @@ -200,6 +200,18 @@ LIBBUTL_MODEXPORT namespace butl description () const; }; + // Print canonical exit status diagnostics: + // + // "terminated abnormally: <...> (core dumped)" + // "exited with code <...>" + // + // So you would normally do: + // + // cerr << "process " << args[0] << " " << *pr.exit << endl; + // + LIBBUTL_SYMEXPORT std::ostream& + operator<< (std::ostream&, process_exit); + class LIBBUTL_SYMEXPORT process { public: -- cgit v1.1