aboutsummaryrefslogtreecommitdiff
path: root/butl/process
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-09-15 21:49:24 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-09-16 12:57:09 +0300
commitf4f6d906733027a7bd802e035b3e9852db7be967 (patch)
tree9ca4c5c72b2ca0c7bea49bf43b62bfa8adda1f38 /butl/process
parent60dfe51f11d247f8490f54b4441a4fda14d6c66a (diff)
Add process::print()
Diffstat (limited to 'butl/process')
-rw-r--r--butl/process15
1 files changed, 14 insertions, 1 deletions
diff --git a/butl/process b/butl/process
index 96b161f..e1eea29 100644
--- a/butl/process
+++ b/butl/process
@@ -9,8 +9,9 @@
# include <sys/types.h> // pid_t
#endif
+#include <iosfwd>
#include <cassert>
-#include <cstdint> // uint32_t
+#include <cstdint> // uint32_t
#include <system_error>
#include <butl/path>
@@ -260,6 +261,18 @@ namespace butl
static process_path
try_path_search (const path&, bool, const dir_path& = dir_path ());
+ // Print process commmand line. If the number of elements is specified,
+ // then it will print the piped multi-process command line, if present.
+ // In this case, the expected format is as follows:
+ //
+ // name1 arg arg ... nullptr
+ // name2 arg arg ... nullptr
+ // ...
+ // nameN arg arg ... nullptr nullptr
+ //
+ static void
+ print (std::ostream&, const char* const args[], size_t n = 0);
+
public:
#ifndef _WIN32
using handle_type = pid_t;