From a82cdb8fd9ba02034d296769772cdf81244da66a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 20 Apr 2015 13:01:46 +0200 Subject: Automatically decide when to print relative/absolute paths --- build/context.txx | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'build/context.txx') diff --git a/build/context.txx b/build/context.txx index 218c65e..5c93221 100644 --- a/build/context.txx +++ b/build/context.txx @@ -25,18 +25,18 @@ namespace build } catch (const std::system_error& e) { - if (verb >= 1) - text << "rm " << f.string (); + if (verb) + text << "rm " << f; else text << "rm " << t; - fail << "unable to remove file " << f.string () << ": " << e.what (); + fail << "unable to remove file " << f << ": " << e.what (); } if (rs == rmfile_status::success) { - if (verb >= 1) - text << "rm " << f.string (); + if (verb) + text << "rm " << f; else text << "rm " << t; } @@ -62,21 +62,20 @@ namespace build } catch (const std::system_error& e) { - if (verb >= 1) - text << "rmdir " << d.string (); + if (verb) + text << "rmdir " << d; else text << "rmdir " << t; - fail << "unable to remove directory " << d.string () << ": " - << e.what (); + fail << "unable to remove directory " << d << ": " << e.what (); } switch (rs) { case rmdir_status::success: { - if (verb >= 1) - text << "rmdir " << d.string (); + if (verb) + text << "rmdir " << d; else text << "rmdir " << t; @@ -84,8 +83,8 @@ namespace build } case rmdir_status::not_empty: { - if (verb >= 1) - text << "directory " << d.string () << " is " + if (verb) + text << "directory " << d << " is " << (w ? "current working directory" : "not empty") << ", not removing"; -- cgit v1.1