print command

This commit is contained in:
vrd
2025-06-06 18:00:38 +03:00
parent 39e9c1bff0
commit c538d70823
4 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -14,8 +14,8 @@ mv cppipe ${PREFIX}/bin
# Install headers # Install headers
mkdir -p ${PREFIX}/include/cppipe mkdir -p ${PREFIX}/include/cppipe
cp basicTypes.h commands.hpp commands.inl childProcess.hpp childProcess.inl ${PREFIX}/include/cppipe
chmod 755 ${PREFIX}/include/cppipe chmod 755 ${PREFIX}/include/cppipe
cp basicTypes.h commands.hpp commands.inl childProcess.hpp childProcess.inl ${PREFIX}/include/cppipe
chmod 644 ${PREFIX}/include/cppipe/* chmod 644 ${PREFIX}/include/cppipe/*
# Clear old cache # Clear old cache
+3
View File
@@ -161,4 +161,7 @@ PendingCmd operator&(const PendingCmd&, const Cmd&);
*/ */
std::string $(const PendingCmd&); std::string $(const PendingCmd&);
/* Operator<< for printing */
std::ostream& operator<<(std::ostream&, const Cmd&);
#include "commands.inl" #include "commands.inl"
+7
View File
@@ -283,3 +283,10 @@ inline PendingCmd operator&(const PendingCmd& cleft, const Cmd& right)
const_cast<PendingCmd&>(cleft).detach(); const_cast<PendingCmd&>(cleft).detach();
return PendingCmd(right); return PendingCmd(right);
} }
inline std::ostream& operator<<(std::ostream& s, const Cmd& c)
{
for(size_t i = 0; i < c.argv.size() - 1; ++i)
s << '"' << c.argv[i] << '"' << ' ';
return s << std::endl;
}
+2
View File
@@ -5,6 +5,8 @@ cppipe compile options from tft
respect CXXFLAGS LDFLAGS respect CXXFLAGS LDFLAGS
? ?
run(cmd)
string args
args before src file go to compiler args before src file go to compiler
use exceptions (open_or_die) use exceptions (open_or_die)
precompiled header cppipe.h precompiled header cppipe.h