aboutsummaryrefslogtreecommitdiff
path: root/libbutl/command.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbutl/command.cxx')
-rw-r--r--libbutl/command.cxx50
1 files changed, 10 insertions, 40 deletions
diff --git a/libbutl/command.cxx b/libbutl/command.cxx
index c23dfd5..2df52dd 100644
--- a/libbutl/command.cxx
+++ b/libbutl/command.cxx
@@ -1,48 +1,18 @@
// file : libbutl/command.cxx -*- C++ -*-
// license : MIT; see accompanying LICENSE file
-#ifndef __cpp_modules_ts
-#include <libbutl/command.mxx>
-#endif
-
-#include <cassert>
-
-#ifndef __cpp_lib_modules_ts
-#include <map>
-#include <string>
-#include <cstddef>
-#include <functional>
+#include <libbutl/command.hxx>
#include <ios> // ios::failure
#include <vector>
+#include <cassert>
#include <utility> // move()
#include <stdexcept> // invalid_argument
#include <system_error>
-#endif
-
-// Other includes.
-
-#ifdef __cpp_modules_ts
-module butl.command;
-
-// Only imports additional to interface.
-#ifdef __clang__
-#ifdef __cpp_lib_modules_ts
-import std.core;
-import std.io;
-#endif
-import butl.process;
-import butl.optional;
-#endif
-
-import butl.builtin;
-import butl.fdstream;
-import butl.string_parser;
-#else
-#include <libbutl/builtin.mxx>
-#include <libbutl/fdstream.mxx>
-#include <libbutl/string-parser.mxx>
-#endif
+
+#include <libbutl/builtin.hxx>
+#include <libbutl/fdstream.hxx>
+#include <libbutl/string-parser.hxx>
using namespace std;
@@ -81,7 +51,7 @@ namespace butl
//
if (p == string::npos)
throw invalid_argument (string ("unmatched substitution character '") +
- open + "'");
+ open + '\'');
if (p == sp)
throw invalid_argument ("empty substitution variable");
@@ -90,12 +60,12 @@ namespace butl
if (vn.find_first_of (" \t") != string::npos)
throw invalid_argument ("whitespace in substitution variable '" +
- vn + "'");
+ vn + '\'');
// Find the variable and append its value or fail if it's unknown.
//
if (!sc (vn, r))
- throw invalid_argument ("unknown substitution variable '" + vn + "'");
+ throw invalid_argument ("unknown substitution variable '" + vn + '\'');
}
// Append the source string tail following the last substitution.
@@ -198,7 +168,7 @@ namespace butl
catch (const invalid_path& e)
{
throw invalid_argument ("invalid stdout redirect file path '" +
- e.path + "'");
+ e.path + '\'');
}
if (redir->empty ())