aboutsummaryrefslogtreecommitdiff
path: root/build/diagnostics
diff options
context:
space:
mode:
Diffstat (limited to 'build/diagnostics')
-rw-r--r--build/diagnostics24
1 files changed, 19 insertions, 5 deletions
diff --git a/build/diagnostics b/build/diagnostics
index 7e56fa3..e61295a 100644
--- a/build/diagnostics
+++ b/build/diagnostics
@@ -14,8 +14,27 @@
#include <exception>
#include <type_traits>
+#include <build/path>
+
namespace build
{
+ // Throw this exception to terminate the build. The handler should
+ // assume that the diagnostics has already been issued.
+ //
+ class failed: public std::exception {};
+
+ // In addition to calling relative_work(), this function also uses
+ // shorter notations such as ~/.
+ //
+ std::string
+ diag_relative_work (const path&);
+
+ inline std::ostream&
+ operator<< (std::ostream& os, const path& p)
+ {
+ return os << diag_relative_work (p);
+ }
+
// Print process commmand line.
//
void
@@ -27,11 +46,6 @@ namespace build
print_process (args.data ());
}
- // Throw this exception to terminate the build. The handler should
- // assume that the diagnostics has already been issued.
- //
- class failed: public std::exception {};
-
// Trace verbosity level.
//
// 1 - command lines to update explicit targets (e.g., .o)