cli
cli copied to clipboard
Allow disabling progress bar for logging in Download mode
In Download mode
, httpie adds a progress bar which is printed along with the response headers. Both are logged to stderr
preventing the progress bar from being skipped while logging response to a logfile using say output redirection.
I'd suggest either an argument to disable progress bar, --no-progress-bar
or print the progress bar to stdout
so that only stderr
can be logged to files and stdout
can be send to ~~hell~~ /dev/null
For now I forced to do this instead :(
Hi @arjunv, what is your exact use case (the whole command invocation would help)?
while logging response to a logfile using say output redirection
What do you mean by "response" here?
My use case is that it messes up this:
http -d http://example.com | tar xvz -
Because httpie and tar are spouting info to the terminal. I'd like to be able to turn off the progress stuff while in a piped situation.
I've begun work on a terminal flag to disable the download progress bar. Currently, it disables the section that @arjunv commented out in his screenshot. Is there anything else it should disable?
Is there anything else it should disable?
Sorry for the delay, but wouldn't it be better to send the progress bar output to stdout
?
But is stdout
not where the downloaded information is being sent? Mixing the progress bar into that doesn't seem like it would work well, especially not if you're going to be piping that into something else.
Got it.
The confusion was that httpie's download mode works very differently based on with/without pipe and with/without --output
For eg if I wanted to download a file and store the response headers to a separate log file, I'd have logically assumed that the following would work.
http -d https://google.com/favicon.ico -o favicon.ico | tee response.txt
It looks like there is no option to do something like that in httpie currently?
Because when I tried to log stderr
as well, only the progress bar contents are saved and not the response headers.
http -d https://google.com/favicon.ico -o favicon.ico 2>&1 | tee response.txt