mxcl / swift-sh

Easily script with third-party Swift dependencies.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stdin is read and evaluated from script if stdin isn’t TTY even when invoking swift-sh -h

goranmoomin opened this issue · comments

I’m not sure if this is intended or not, but swift-sh tries to read stdin even with the flags -h when stdin isn’t a TTY. I’m not sure if this is intended, but AFAIU -- -h does the same thing, right? I believe that just printing the help message would be more consistent and less surprising.

For context, I’m trying to add swift-sh on the Homebrew core tap, and it looks like the test (which is just checking the help message) is failing because the stdin isn’t a TTY in the testing environment so it tries to read from it, and (due to reasons I don’t know) errors due to the sandbox and returns 2.

I would like the formula included in the main tap, so I would like if you can consider to remove the conditional behavior. I also can open a (trivial) PR removing the conditional if it’s preferable.

Thanks.

Yeah this probably incorrect behavior, will merge.