You've already forked httpie-cli
mirror of
https://github.com/httpie/cli.git
synced 2025-08-10 22:42:05 +02:00
Changed default --print to "b" if stdout piped.
If the output is piped to another program or redirected to a file, the new default behaviour is to only print the response body. (It can still be overriden via the ``--print`` flag.)
This commit is contained in:
@@ -117,11 +117,14 @@ def main(args=None,
|
||||
stdin=sys.stdin, stdin_isatty=sys.stdin.isatty(),
|
||||
stdout=sys.stdout, stdout_isatty=sys.stdout.isatty()):
|
||||
parser = cli.parser
|
||||
|
||||
args = parser.parse_args(
|
||||
args=args if args is not None else sys.argv[1:],
|
||||
stdin=stdin,
|
||||
stdin_isatty=stdin_isatty
|
||||
stdin_isatty=stdin_isatty,
|
||||
stdout_isatty=stdout_isatty,
|
||||
)
|
||||
|
||||
response = _get_response(args)
|
||||
output = _get_output(args, stdout_isatty, response)
|
||||
output_bytes = output.encode('utf8')
|
||||
|
Reference in New Issue
Block a user