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

how to change the bufSize of the stdoutStream when i use cmd.NewCmdOptions.. to get the object? #66

Closed
ChessC95 opened this issue Aug 22, 2021 · 4 comments · Fixed by #85

Comments

@ChessC95
Copy link

hello , my question is :
when i use the following code envCmd := cmd.NewCmdOptions(cmdOptions, args[0], args[1:]...) to get the envCmd object, can i still change the value of stdoutStream's bufSize in the envCmd object ?
it confused me a lot . thanks !

@bjohnsonAPF
Copy link

I have run into the same issue. If you create a Cmd object using NewCmdOptions or NewCmd the NewOutputStream is created for you with the default bufSize. The stdoutStream field of Cmd is not public so you can not use it to set a new bufSize with the SetLineBufferSize function.

@Crevil
Copy link
Contributor

Crevil commented Mar 4, 2022

I'd love to make a PR on this to make the line buffer size configurable if that would be accepted. 🙏

We have hit this issue in the past migrating off of go-cmd but I'd much rather add it here as it seems more users could benifit from it. 🙏 @daniel-nichter would you accept a PR on this? If not no problem ofc, I just don't want to spend the time creating a PR if in vain 😄

@daniel-nichter
Copy link
Member

@Crevil That'd be a good PR. I think the original hard-coded value predate Options, but these can be options now.

@daniel-nichter
Copy link
Member

Released as v1.4.1.

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 a pull request may close this issue.

4 participants