-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added a --progress option for snazzer-receive. #40
base: master
Are you sure you want to change the base?
Conversation
Good idea! I'm thinking about whether the explicit command line option is really needed though - maybe we could turn progress metering automatically if snazzer is run interactively, i.e. stderr is a tty with a user in front of it? In fish there's |
Seems like checking that when run in a terminal via ssh is not that trivial in bash, though… |
We could show the progress by default if |
Great idea! I would love to see receive progress indicator by default, ssh does look fiddly to detect though. My only concern with the code is that I would like to avoid eval. |
Afaik it wouldn't hurt ssh if it was enabled for ssh as well (so we skip the ssh detection), though I did not look into the ssh option just now. I do not know about I can look into expansion of the patch tomorrow. |
To be more explicit: If possible, the progress meter should show automatically in three cases:
It shouldn't show if snazzer is started from inside a shell script, a cron job or a systemd timer, or when the stderr is redirected to a file or something else that is not a tty. References: http://stackoverflow.com/questions/911168/how-to-detect-if-my-shell-script-is-running-through-a-pipe |
Regarding the conditional pipeline issue, this looks like a solution that does not need eval or another if level: http://unix.stackexchange.com/questions/38310/conditional-pipeline |
I'm not sure I'll get it to it this weekend, and I'm in a crunch at work for the next week, but I'll try to take a look next weekend. |
Just FYI, I am no no longer using snazzer, so I won't be actively working towards a patch. |
Fixes #39