added command line arguments support

This commit is contained in:
2024-01-28 13:52:45 +01:00
parent 946f4a3b5c
commit 9a032b1ebd
3 changed files with 44 additions and 12 deletions

View File

@@ -13,8 +13,9 @@ class UnsupportedFormatException(Exception):
class InstructionSetSchema:
VALID_EXTENSIONS = ("yaml", "json", "xml")
def __init__(self, path: str, configPath: str = "config.json") -> None:
def __init__(self, path: str, configPath: str = "config.json", display: bool = False) -> None:
self.config = Config(configPath)
self.display = display
self.path = path
self.load()
@@ -43,6 +44,8 @@ class InstructionSetSchema:
self.structures[id_] = Structure.load(id_, data)
def save(self, path: str) -> None:
renderer = Renderer(self.config)
renderer = Renderer(self.config, self.display)
renderer.render(self)
renderer.save(path)
renderer.save(path)
if self.display:
input("Press ENTER to quit")