diff options
Diffstat (limited to 'build/diagnostics.cxx')
-rw-r--r-- | build/diagnostics.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/build/diagnostics.cxx b/build/diagnostics.cxx index 6b524a5..e2e8b95 100644 --- a/build/diagnostics.cxx +++ b/build/diagnostics.cxx @@ -6,12 +6,31 @@ #include <iostream> +#include <build/context> #include <build/utility> using namespace std; namespace build { + string + diag_relative_work (const path& p) + { + if (p.absolute ()) + { + path rp (relative_work (p)); + +#ifndef _WIN32 + if (rp.absolute () && rp.sub (home)) + return "~/" + rp.leaf (home).string (); +#endif + + return rp.string (); + } + + return p.string (); + } + void print_process (const char* const* args) { |