Merge "Output json without trailing whitespaces but with trailing newlines." am: 65b5b59664
Change-Id: I4640dc70d62c51caa96c4e563866f35d125a7683
This commit is contained in:
@@ -112,9 +112,10 @@ def main():
|
|||||||
|
|
||||||
if args.out:
|
if args.out:
|
||||||
with open(args.out, "w") as f:
|
with open(args.out, "w") as f:
|
||||||
json.dump(obj, f, indent=2)
|
json.dump(obj, f, indent=2, separators=(',', ': '))
|
||||||
|
f.write('\n')
|
||||||
else:
|
else:
|
||||||
print(json.dumps(obj, indent=2))
|
print(json.dumps(obj, indent=2, separators=(',', ': ')))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Reference in New Issue
Block a user