Skip to content

Commit

Permalink
pyGHDL/cli/DOM: support passing target files as CLI arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor authored and tgingold committed Jun 18, 2021
1 parent 36e3466 commit 7d5c6c4
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions pyGHDL/cli/DOM.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/env python3

from sys import argv

from pathlib import Path

from pydecor import export
Expand Down Expand Up @@ -35,13 +39,21 @@ def prettyPrint(self):


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__":
Expand Down

0 comments on commit 7d5c6c4

Please sign in to comment.