-
Notifications
You must be signed in to change notification settings - Fork 131
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
sassc hangs when called with no args #177
Conversation
Thanks @LuizFB |
Well, it does not hang. It just waits for Sass input from the standard input, I've been using it pretty often. This change now breaks this. |
@saper Well it's not really about "just press Ctrl-D", that's not the behaviour most people expect when using command line programs. Usual behaviour is:
That's what virtually what every program does. No reason to not just have another PR that adds " There could, alternatively, be a check to verify if there is actually any piped input to be received from STDIN, and if not, prints the help text, else reads from it. That would probably the easiest fix, although the "right" thing to do would be to conform to default behaviour of just using |
It depends on the tradition one subscribes to. If you are used to the Unix-like command line, no arguments usually mean standard input (like a filter) scenario. |
The original bug report was about "hanging", not about discussing of the expected command line behaviour. Checking for piped (typed, maybe?) output is way too complex and almost certainly incorrect. |
This reverts commit 0730454.
Nothing complex about it, it only takes a call to We could debate this forever, but I fear that would be counterproductive. Since it was never my intention to have it stop complying to a use case, and there is an obvious (and easy) fix that tends to everyone's demands, I propose just checking if STDIN is a pipe or not, and acting accordingly, rather than reverting the pull. That way it will go back to working as you expected, and when there is no piped input to be had it will not dumbly sit there idling. Sounds reasonable? |
I really think we should refrain from this "simple" change (#177). I'll leave it up to @xzyfer to decide. |
It does exist in Windows under As for the quite unusual use cases of your clipboard usage and |
I agree with @LuizFB that the existing behaviour is surprising. I would prefer we detect stdin or an --stdin flag. IMHO the current "hanging" behaviour is the worse case. However given that it was hanging waiting for stdin this is a significant breaking a change, so I will revert it. We should address a suitable implementation that does not hang like this for 3.4. |
@xzyfer Any opinion on using That would be the quickest and easiest way to fix it IMO, and then later is just a matter of adding the stdin explicit flag whenever you feel like. I could make another PR if you want. |
@LuizFB in theory it sounds idea but honestly it's out of my area of knowledge. I always give @saper the benefit of the doubt. I expect the concerns he's raised about some edge cases will need to be addressed. However for now there's a way to implement what you suggest that'll work for the vast majority of people I'm 👍 . We can address the edges case as people file issues. |
This pull just checks if
argc == 1
and if so, prints the usage guide and returns 0 just like calling it with-h
would.