Skip to content

Commit b8fee34

Browse files
committed
Update whitespace option documentation
1 parent 3d3477d commit b8fee34

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Lib/json/tool.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,20 @@ def main():
2626
parser.add_argument('outfile', nargs='?', type=argparse.FileType('w'),
2727
default=sys.stdout,
2828
help='write the output of infile to outfile')
29+
parser.add_argument('--sort-keys', action='store_true',
30+
help='sort the output of dictionaries by key')
2931
group = parser.add_mutually_exclusive_group()
3032
group.add_argument('--indent', default=4, type=int,
31-
help='Indent level (number of spaces) for '
32-
'pretty-printing. Defaults to 4.')
33-
group.add_argument('--no-indent', action='store_const', dest='indent',
34-
const=None, help='Use compact mode.')
33+
help='separate items with newlines and use this number '
34+
'of spaces for indentation')
3535
group.add_argument('--tab', action='store_const', dest='indent',
36-
const='\t', help='Use tabs for indentation.')
36+
const='\t', help='separate items with newlines and use '
37+
'tabs for indentation')
38+
group.add_argument('--no-indent', action='store_const', dest='indent',
39+
const=None,
40+
help='separate items with spaces rather than newlines')
3741
group.add_argument('--compact', action='store_true',
38-
help='Use most compact whitespace format.')
39-
parser.add_argument('--sort-keys', action='store_true',
40-
help='sort the output of dictionaries by key')
42+
help='suppress all whitespace separation (most compact)')
4143
options = parser.parse_args()
4244

4345
with options.infile as infile:

0 commit comments

Comments
 (0)