Output valid JSON with the --json option

Don't just print the data object, `json.dump` it
This commit is contained in:
Jay Caines-Gooby 2022-03-09 17:59:46 +00:00 committed by GitHub
parent 27d1053a27
commit 62deb71a8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -428,7 +428,7 @@ if __name__ == "__main__":
def save(data, filename):
if a.o is None:
print(data)
json.dump(data, sys.stdout, indent=4)
else:
out_dir_parent = os.path.abspath(
os.path.expanduser(os.path.expandvars(a.o))