From 23916db38cab1264ba844ce04cdcbb1b424d7942 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 18 Apr 2017 19:57:28 +0300 Subject: Add process_args --- butl/process | 6 ++++++ butl/process-io | 7 +++++++ 2 files changed, 13 insertions(+) (limited to 'butl') diff --git a/butl/process b/butl/process index 282a994..c16e39e 100644 --- a/butl/process +++ b/butl/process @@ -44,6 +44,12 @@ namespace butl process_child_error (int e): process_error (e, true) {} }; + struct process_args + { + const char* const* argv; + std::size_t argc; + }; + // A process executable has three paths: initial, recall, and effective. // Initial is the original "command" that you specify in argv[0] and on // POSIX that's what ends up in the child's argv[0]. But not on Windows. On diff --git a/butl/process-io b/butl/process-io index 42a720a..1212b22 100644 --- a/butl/process-io +++ b/butl/process-io @@ -16,6 +16,13 @@ namespace butl { return o << p.recall_string (); } + + inline std::ostream& + operator<< (std::ostream& o, const process_args& a) + { + process::print (o, a.argv, a.argc); + return o; + } } #endif // BUTL_PROCESS_IO -- cgit v1.1