Commit 10eed1d9 authored by Tristan Gingold's avatar Tristan Gingold

commands.py: add ghdl options to list-json output

parent 5976eff2
...@@ -156,7 +156,15 @@ class Commands(Action): ...@@ -156,7 +156,15 @@ class Commands(Action):
self.parseable_fileset) self.parseable_fileset)
cwd = os.getcwd() cwd = os.getcwd()
first=True first=True
print ('{') print('{')
opts = self.top_manifest.manifest_dict.get('ghdl_opt', None)
if opts:
print(' "options": {')
print(' "ghdl_analysis": [', end='')
opts = ('"{}"'.format(o) for o in opts.split(' '))
print(', '.join(opts), end='')
print(']')
print(' },')
print (' "files": [') print (' "files": [')
for f in file_list: for f in file_list:
if not first: if not first:
...@@ -171,9 +179,10 @@ class Commands(Action): ...@@ -171,9 +179,10 @@ class Commands(Action):
lang='verilog' lang='verilog'
else: else:
lang='unknown' lang='unknown'
print (' {{ "file": "{file}", "language": "{lang}"}}'.format( print (' {{ "file": "{file}", "language": "{lang}"}}'.format(
file=f.rel_path(cwd), lang=lang), end='') file=f.rel_path(cwd), lang=lang), end='')
print(' ]') print()
print(' ]')
print('}') print('}')
def list_files(self): def list_files(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment