diff --git a/src/ifcpatch/__init__.py b/src/ifcpatch/__init__.py index a3a74249aa..0632f90775 100644 --- a/src/ifcpatch/__init__.py +++ b/src/ifcpatch/__init__.py @@ -30,7 +30,7 @@ def execute(args, is_library=None): ifc_file.write(args["output"]) -if __name__ == "__main__": +def main(): parser = argparse.ArgumentParser(description="Patches IFC files to fix badly formatted data") parser.add_argument("-i", "--input", type=str, required=True, help="The IFC file to patch") parser.add_argument("-o", "--output", type=str, help="The output file to save the patched IFC") @@ -42,3 +42,7 @@ if __name__ == "__main__": execute(args) print("# All tasks are complete :-)") + + +if __name__ == "__main__": + main() diff --git a/src/ifcpatch/__main__.py b/src/ifcpatch/__main__.py new file mode 100644 index 0000000000..3b48deed79 --- /dev/null +++ b/src/ifcpatch/__main__.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python3 +import ifcpatch + +ifcpatch.main()