@@ -26,18 +26,20 @@ def main():
26
26
parser .add_argument ('outfile' , nargs = '?' , type = argparse .FileType ('w' ),
27
27
default = sys .stdout ,
28
28
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' )
29
31
group = parser .add_mutually_exclusive_group ()
30
32
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' )
35
35
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' )
37
41
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)' )
41
43
options = parser .parse_args ()
42
44
43
45
with options .infile as infile :
0 commit comments