aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pyGHDL/cli/DOM.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/pyGHDL/cli/DOM.py b/pyGHDL/cli/DOM.py
index b8e6a134e..abf1f0af8 100644
--- a/pyGHDL/cli/DOM.py
+++ b/pyGHDL/cli/DOM.py
@@ -1,3 +1,7 @@
+#!/usr/bin/env python3
+
+from sys import argv
+
from pathlib import Path
from pydecor import export
@@ -35,13 +39,21 @@ class Application:
def main():
- try:
- app = Application()
- app.addFile(Path("testsuite/pyunit/SimpleEntity.vhdl"), "default_lib")
- except GHDLBaseException as ex:
- print(ex)
-
- app.prettyPrint()
+ items = argv[1:]
+ if len(items) < 1:
+ print("Please, provide the files to be analyzed as CLI arguments.")
+ print("Using <testsuite/pyunit/SimpleEntity.vhdl> for demo purposes.\n")
+ items = ["testsuite/pyunit/SimpleEntity.vhdl"]
+
+ for item in items:
+ print("ยท", item)
+ try:
+ app = Application()
+ app.addFile(Path(item), "default_lib")
+ except GHDLBaseException as ex:
+ print(ex)
+
+ app.prettyPrint()
if __name__ == "__main__":