Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command accessors to CommandGroupBuilder #27

Closed

Conversation

9999years
Copy link

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 (9999years/command-error#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
Copy link
Member

passcod commented Mar 26, 2024

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants