Commit aa1f1e49 authored by Paweł Szostek's avatar Paweł Szostek

list-modules: add option to list with files

parent 7f5d51ed
......@@ -36,6 +36,7 @@ def main():
fetch = subparsers.add_parser("fetch", help="fetch and/or update remote modules listed in Manifest")
clean = subparsers.add_parser("clean", help="remove all modules fetched for this one")
listmod = subparsers.add_parser("list-mods", help="List all modules together with their files")
listmod.add_argument("--with-files", help="list modules together with their files", default=False, action="store_true", dest="withfiles")
listfiles = subparsers.add_parser("list-files", help="List all files in a form of a space-separated string")
listfiles.add_argument("--delimiter", help="set delimitier for the list of files", dest="delimiter", default=' ')
merge_cores = subparsers.add_parser("merge-cores", help="Merges entire synthesizable content of an project into a pair of VHDL/Verilog files")
......
......@@ -4,21 +4,26 @@ from util import path
class ListModules(Action):
def run(self):
for m in self.modules_pool:
if not m.isfetched:
print("#!UNFETCHED")
print(m.url+'\n')
else:
print(path.relpath(m.path))
if m.source in ["svn", "git"]:
print("# "+m.url)
if m.parent:
print("# defined in %s" % m.parent.url)
if self.options.withfiles:
for m in self.modules_pool:
if not m.isfetched:
print("#!UNFETCHED")
print(m.url+'\n')
else:
print("# root module")
if not len(m.files):
print(" # no files")
else:
for f in m.files:
print(" " + path.relpath(f.path, m.path))
print("")
print(path.relpath(m.path))
if m.source in ["svn", "git"]:
print("# "+m.url)
if m.parent:
print("# defined in %s" % m.parent.url)
else:
print("# root module")
if not len(m.files):
print(" # no files")
else:
for f in m.files:
print(" " + path.relpath(f.path, m.path))
print("")
else:
print("#path\tsource")
for m in self.modules_pool:
print("%s\t%s" % (path.relpath(m.path), m.source))
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