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

CLI switch to disable download progress output #1928

Open
benaryorg opened this issue Jul 2, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@benaryorg
Copy link
Contributor

commented Jul 2, 2019

Describe the problem you are trying to solve

I want to add a new toolchain in a Docker container and suppress the download progress, since that messes with my terminal rather hard.
This applies to every other non-interactive download.

Describe the solution you'd like

A CLI switch (-s/--silent: curl style, -q/--quiet: wget style) which disables output meant for a terminal.

Notes

It is possible to workaround this by just piping the output anywhere (| cat at the end works fine):

if tty::stdout_isatty() {

That workaround isn't viable if you have e.g. a Dockerfile with execvp()-like statements to avoid running in a shell (for the doom it shall bring upon thee).

@kinnison

This comment has been minimized.

Copy link
Collaborator

commented Jul 2, 2019

This ought to be a reasonable intermediate project for someone to undertake. I am prepared to mentor someone to do the work.

@PicoJr

This comment has been minimized.

Copy link

commented Jul 13, 2019

Here is what I've written so far: https://github.com/PicoJr/rustup.rs/tree/feat-1928

Should I submit a PR?

Note: It's my first time contributing to rustup and I'm a rust beginner.

Help appreciated =)

TODO?

  • write unit test for the --silent option
  • add --quiet alias

Unit Tests

I ran cargo test, some tests failed with message "error: self-update is disabled for this build of rustup".

@kinnison

This comment has been minimized.

Copy link
Collaborator

commented Jul 14, 2019

My preference is for --quiet rather than --silent but it looks like you're on your way to a solution.

The error message you mention suggests that you've managed to end up with the no-self-update feature enabled, or else you've got some unusual environment variables set such as SNAP.

@PicoJr

This comment has been minimized.

Copy link

commented Jul 14, 2019

Ok, I'll rename the option to --quiet.

@PicoJr PicoJr referenced this issue Jul 14, 2019

Open

feat: --quiet option #1945

0 of 2 tasks complete
@PicoJr

This comment has been minimized.

Copy link

commented Jul 14, 2019

I've submitted a PR: #1945

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.