1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Add --sorted

Also add --no-(sorted|unsorted) to allow the documented resetting to default via --no-<option>.
This commit is contained in:
Jakub Roztocil
2020-06-16 12:54:50 +02:00
parent 23dd80563f
commit 8a106781be
4 changed files with 167 additions and 104 deletions

View File

@@ -91,10 +91,13 @@ DEFAULT_FORMAT_OPTIONS = [
'json.indent:4',
'json.sort_keys:true',
]
UNSORTED_FORMAT_OPTIONS = [
'headers.sort:false',
'json.sort_keys:false',
SORTED_FORMAT_OPTIONS = [
'headers.sort:true',
'json.sort_keys:true',
]
SORTED_FORMAT_OPTIONS_STRING = ','.join(SORTED_FORMAT_OPTIONS)
UNSORTED_FORMAT_OPTIONS_STRING = ','.join(
option.replace('true', 'false') for option in SORTED_FORMAT_OPTIONS)
# Defaults
OUTPUT_OPTIONS_DEFAULT = OUT_RESP_HEAD + OUT_RESP_BODY