watchexec / command-group

Deprecated: use process-wrap. || Extension to Command to spawn in a process group
https://docs.rs/command-group
Other
37 stars 10 forks source link

Add command accessors to `CommandGroupBuilder` #27

Closed 9999years closed 7 months ago

9999years commented 7 months ago

Hello! I'm implementing command-error, a crate that provides nicer error messages for commands, like this:

`sh` failed: exit status: 1
Command failed: `sh -c 'echo puppy; false'`
Stdout:
  puppy

I'd like to add optional support for the command-group crate (https://github.com/9999years/command-error/issues/2). Because traits can only be implemented once per type (and I think a generic trait would have poor ergonomics here), I'm attempting to impl command_error::CommandExt for command_group::builder::CommandGroupBuilder<'_, std::process::Command>, but it's not possible to access the underlying Command (to produce the name of the program that was run for error messages) with the current API.

Therefore, this PR adds getters to access the Command field of CommandGroupBuilder.

passcod commented 7 months ago

That's neat, but could you instead work on top of https://github.com/watchexec/process-wrap ? Development has moved there and I'm going to be freezing command-group; process-wrap gives you direct access to the command as part of its architecture.

9999years commented 7 months ago

Sure, I guess. Could you add a deprecation notice to this repo and the documentation?