@@ -1258,15 +1258,19 @@ def main():
12581258 parser .add_argument ('-m' , '--mode' , default = 'exec' ,
12591259 choices = ('exec' , 'single' , 'eval' , 'func_type' ),
12601260 help = 'specify what kind of code must be parsed' )
1261+ parser .add_argument ('--no-type-comments' , default = True , action = 'store_false' ,
1262+ help = "don't add information about type comments" )
12611263 parser .add_argument ('-a' , '--include-attributes' , action = 'store_true' ,
12621264 help = 'include attributes such as line numbers and '
12631265 'column offsets' )
1266+ parser .add_argument ('-i' , '--indent' , type = int , default = 3 ,
1267+ help = 'indentation of nodes (number of spaces)' )
12641268 args = parser .parse_args ()
12651269
12661270 with args .infile as infile :
12671271 source = infile .read ()
1268- tree = parse (source , args .infile .name , args .mode , type_comments = True )
1269- print (dump (tree , include_attributes = args .include_attributes , indent = 3 ))
1272+ tree = parse (source , args .infile .name , args .mode , type_comments = args . no_type_comments )
1273+ print (dump (tree , include_attributes = args .include_attributes , indent = args . indent ))
12701274
12711275if __name__ == '__main__' :
12721276 main ()
0 commit comments