boostorg / boostorg/process

How to get the command line from `boost::process::child` (or other classes)?

Open
#221 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
145
Forks
151
PR merge metrics
No merged PRs in 30d

Description

I'm using `boost::process:child` to launch a process as follows:

```c++
boost::process::child c(
boost::process::search_path("my-app"),
"--some-option",
"--verbose",
boost::process::std_out > ::stdout,
boost::process::std_in < ::stdin);
c.wait();
```

But it looks like `boost::process::child` doesn't provide any interface to return a `string` (or a `vector`) that has the actual command line. For example, in the above case, the command line may be `/usr/local/bin/my-app --some-option --verbose`.

I can surely form the `string` or `vector` by myself but I'm wondering if `boost::process` has already provided a way to get it. I searched in the documentation and examples but didn't seem to find it.

(I want to get the command line string so when an error happens I can log the actual command in the log message.)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.