3 # Copyright 2022, Mischa Peters <mischa AT alkira DOT net>, Alkira.
5 # Version 0.1 - 20220617 - initial release
7 # Permission to use, copy, modify, and distribute this software for any
8 # purpose with or without fee is hereby granted, provided that the above
9 # copyright notice and this permission notice appear in all copies.
11 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 parser = argparse.ArgumentParser(description="Validate JSON config")
25 parser.add_argument("-f", "--file", type=str, help="location of the JSON connector file")
26 parser.add_argument("-p", "--pretty", help="make the JSON pretty!", action="store_true")
28 parser.print_help(sys.stderr)
32 args = parser.parse_args()
34 except argparse.ArgumentError as e:
38 with open (json_file, 'r') as f:
41 print(json.dumps(body, indent=4))
43 print(json.dumps(body))