blob: c9438c01f218b1cc147eb8bdd79a19475f5b2f85 [file] [log] [blame]
Andrew Geissler17539512019-06-24 15:52:30 -05001#!/usr/bin/python3
2
3# Copyright 2019 IBM Corp.
4
Andrew Geissler17539512019-06-24 15:52:30 -05005from argparse import ArgumentParser
6
Patrick Williamse310dd92022-12-07 06:55:38 -06007import yaml
8
9if __name__ == "__main__":
Andrew Geissler17539512019-06-24 15:52:30 -050010 # A simple program to ensure proper indents of input yaml file
11 parser = ArgumentParser(description="YAML formatter")
Patrick Williamse310dd92022-12-07 06:55:38 -060012 parser.add_argument(
13 "-f", "--file", dest="file_yaml", help="yaml file to format"
14 )
Andrew Geissler17539512019-06-24 15:52:30 -050015 args = parser.parse_args()
16
Patrick Williamse310dd92022-12-07 06:55:38 -060017 print(
18 yaml.dump(
19 yaml.load(open(args.file_yaml), Loader=yaml.FullLoader), indent=4
20 )
21 )