xh
xh copied to clipboard
Support silencing warnings via double `-q` flag
See https://github.com/httpie/httpie/issues/1100 and https://github.com/httpie/httpie/pull/1175
I'm considering implementing this feature but it seems that xh already silences warnings.
~ ─────────────────────────────────────────────────────────────────────────────── 19:22:57
❯ http --check-status --quiet pie.dev/status/500
http: warning: HTTP 500 Internal Server Error
~ ─────────────────────────────────────────────────────────────────────────────── 19:23:09
❯ xh --check-status --quiet pie.dev/status/500
~ ─────────────────────────────────────────────────────────────────────────────── 19:23:18
❯
Should this be changed along with the addition of -qq?
Should this be changed along with the addition of -qq?
Yes, please. Unlike HTTPie, we aren't currently outputting HTTP warnings if the --quite or --output flag is being used.
xh
$ xh --check-status --quiet pie.dev/status/500
$ xh --check-status --output /dev/null pie.dev/status/500
$ xh --check-status pie.dev/status/500 > /dev/null
xh: warning: HTTP 500 Internal Server Error
HTTPie
$ http --check-status --quiet pie.dev/status/500
http: warning: HTTP 500 Internal Server Error
$ http --check-status --output /dev/null pie.dev/status/500
http: warning: HTTP 500 Internal Server Error
$ http --check-status pie.dev/status/500 > /dev/null
http: warning: HTTP 500 Internal Server Error
This can be fixed by:
- Modifying this line to take
args.quiteinto account. - Checking if we're not outputting into the terminal instead of checking if we have a redirected output.
Is this issue still open?