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

Expose buildCmd #151

Open
se7entyse7en opened this issue Apr 5, 2019 · 1 comment
Open

Expose buildCmd #151

se7entyse7en opened this issue Apr 5, 2019 · 1 comment

Comments

@se7entyse7en
Copy link

I don't know how much spread is this need. In my specific case, I need to access the underlying exec.Cmd that is built in buildCmd without starting it. Currently, all the exposed functions that return icmd.Result already started the underlying exec.Cmd.

In case you wonder why I need to do this, here's some context. I need to test an interactive REPL, so I'm using this. The entrypoint of pty is this function:

func Start(c *exec.Cmd) (pty *os.File, err error)

so I'd like to do something like:

r := icmd.BuildCmd(cmd)
in, err := pty.Start(r.Cmd)
@dnephin
Copy link
Member

dnephin commented Apr 6, 2019

I think it would be nice to be able to use an exec.Cmd directly and still take advantage of the comparison provided by icmd. Sounds like a good idea.

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

No branches or pull requests

2 participants