Turn --verify=False/True to --verify=no/yes

One way to address #559 -- https://github.com/jkbrzt/httpie/issues/559
-- instead of warning or throwing an error, just accept "True" and "False"
as synonyms of yes/no

(Updated to reflect feedback given at https://github.com/jkbrzt/httpie/pull/560 )
This commit is contained in:
Michael Floering 2017-02-09 18:51:23 -06:00
parent de38f86730
commit 64af72eb88

View File

@ -159,8 +159,10 @@ def get_requests_kwargs(args, base_headers=None):
'data': data, 'data': data,
'verify': { 'verify': {
'yes': True, 'yes': True,
'no': False 'true': True,
}.get(args.verify, args.verify), 'no': False,
'false': False,
}.get(args.verify.lower(), args.verify),
'cert': cert, 'cert': cert,
'timeout': args.timeout, 'timeout': args.timeout,
'auth': args.auth, 'auth': args.auth,