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

Support silencing warnings via double -q flag #179

Open
ducaale opened this issue Oct 13, 2021 · 3 comments
Open

Support silencing warnings via double -q flag #179

ducaale opened this issue Oct 13, 2021 · 3 comments
Labels
good first issue Good for newcomers

Comments

@ducaale
Copy link
Owner

ducaale commented Oct 13, 2021

See httpie/cli#1100 and httpie/cli#1175

@ducaale ducaale added the good first issue Good for newcomers label Oct 13, 2021
@Abdiramen
Copy link

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?

@ducaale
Copy link
Owner Author

ducaale commented Oct 17, 2021

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:

  1. Modifying this line to take args.quite into account.
  2. Checking if we're not outputting into the terminal instead of checking if we have a redirected output.

@farmeroy
Copy link

farmeroy commented Sep 5, 2023

Is this issue still open?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants