Andrew Geissler | 1753951 | 2019-06-24 15:52:30 -0500 | [diff] [blame] | 1 | #!/usr/bin/python3 |
| 2 | |
| 3 | # Copyright 2019 IBM Corp. |
| 4 | |
| 5 | import yaml |
| 6 | from argparse import ArgumentParser |
| 7 | |
| 8 | if __name__ == '__main__': |
| 9 | # A simple program to ensure proper indents of input yaml file |
| 10 | parser = ArgumentParser(description="YAML formatter") |
| 11 | parser.add_argument('-f', '--file', dest='file_yaml', |
| 12 | help='yaml file to format') |
| 13 | args = parser.parse_args() |
| 14 | |
| 15 | print(yaml.dump(yaml.load(open(args.file_yaml), |
| 16 | Loader=yaml.FullLoader), indent=4)) |