1
0
mirror of https://github.com/httpie/cli.git synced 2025-07-15 01:34:27 +02:00

Replaced --ignore-http-status with --check-status.

The default behaviour now is to exit with 0 on HTTP errors
unless --check-status is set.
This commit is contained in:
Jakub Roztocil
2012-07-24 01:09:14 +02:00
parent fba3912f2e
commit 2646ebaaed
5 changed files with 140 additions and 49 deletions

View File

@ -126,17 +126,21 @@ parser.add_argument(
)
parser.add_argument(
'--ignore-http-status', default=False, action='store_true',
'--check-status', default=False, action='store_true',
help=_('''
This flag tells HTTP to ignore the HTTP status code
and exit with 0.
By default, HTTPie exits with 0 when no network or other fatal
errors occur.
This flag instructs HTTPie to also check the HTTP status code and
exit with an error if the status indicates one.
When the server replies with a 4xx (Client Error) or 5xx
(Server Error) status code, HTTPie exits with 4 or 5 respectively.
If the response is a 3xx (Redirect) and --allow-redirects
hasn't been set, then the exit status is 3.
Also an error message is written to stderr if stdout is redirected.
By default, HTTPie exits with 0 only if no errors occur
and the request is successful. When the server
replies with a 4xx (Client Error) or 5xx (Server Error)
status code, HTTPie exits with 4 or 5 respectively.
If the response is 3xx (Redirect) and --allow-redirects
isn't set, then the exit status is 3.
''')
)