print command
This commit is contained in:
+1
-1
@@ -14,8 +14,8 @@ mv cppipe ${PREFIX}/bin
|
||||
|
||||
# Install headers
|
||||
mkdir -p ${PREFIX}/include/cppipe
|
||||
cp basicTypes.h commands.hpp commands.inl childProcess.hpp childProcess.inl ${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/*
|
||||
|
||||
# Clear old cache
|
||||
|
||||
@@ -161,4 +161,7 @@ PendingCmd operator&(const PendingCmd&, const Cmd&);
|
||||
*/
|
||||
std::string $(const PendingCmd&);
|
||||
|
||||
/* Operator<< for printing */
|
||||
std::ostream& operator<<(std::ostream&, const Cmd&);
|
||||
|
||||
#include "commands.inl"
|
||||
|
||||
@@ -283,3 +283,10 @@ inline PendingCmd operator&(const PendingCmd& cleft, const Cmd& right)
|
||||
const_cast<PendingCmd&>(cleft).detach();
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user