aboutsummaryrefslogtreecommitdiff
path: root/build/context.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-20 13:01:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-20 13:01:46 +0200
commita82cdb8fd9ba02034d296769772cdf81244da66a (patch)
tree2cd5fb0211984716780ce5fad18c19d7c4d9a794 /build/context.txx
parentc775a7f28a56ef96f097e677434eceec9d8f2cdf (diff)
Automatically decide when to print relative/absolute paths
Diffstat (limited to 'build/context.txx')
-rw-r--r--build/context.txx25
1 files changed, 12 insertions, 13 deletions
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";