-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path__main__.py
30 lines (24 loc) · 949 Bytes
/
__main__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import argparse
from compiletojsonschema.compiletojsonschema import CompileToJsonSchema
def main():
parser = argparse.ArgumentParser(description="Compile To JSON Schema CLI")
parser.add_argument("input_file")
parser.add_argument(
"-s",
"--set-additional-properties-false-everywhere",
action="store_true",
help="Set Additional Properties False everywhere? This generates strict schemas that can be used for testing.",
)
parser.add_argument(
"-c",
"--codelist-base-directory",
action="append",
help="Which directory we should look in for codelists",
)
args = parser.parse_args()
ctjs = CompileToJsonSchema(
input_filename=args.input_file,
set_additional_properties_false_everywhere=args.set_additional_properties_false_everywhere,
codelist_base_directories=args.codelist_base_directory,
)
print(ctjs.get_as_string())