added command line arguments support
This commit is contained in:
@@ -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")
|
||||
Reference in New Issue
Block a user