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

feat: add underlying Command accessors to *CommandWrap #3

Merged
merged 2 commits into from
Mar 27, 2024

Conversation

9999years
Copy link
Contributor

Port of watchexec/command-group#27.

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 process-wrap 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 process_wrap::std::StdCommandWrap, 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 StdCommandWrap.

@passcod passcod changed the title Add accessors to StdCommandWrap feat: add underlying Command accessors to *CommandWrap Mar 27, 2024
@passcod passcod merged commit 2e2f548 into watchexec:main Mar 27, 2024
13 checks passed
@9999years 9999years deleted the accessors branch March 27, 2024 15:45
@9999years
Copy link
Contributor Author

Thanks! Let me know when there's a release cut for this?

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.

2 participants