Add a '--top' option to list-files to build a file hierarchy list

parent a774d263
...@@ -244,6 +244,11 @@ def _get_parser(): ...@@ -244,6 +244,11 @@ def _get_parser():
dest="reverse", dest="reverse",
default=False, default=False,
action="store_true") action="store_true")
listfiles.add_argument(
"--top",
help="print only those files required to build 'top'",
dest="top",
default=None)
tree = subparsers.add_parser( tree = subparsers.add_parser(
"tree", "tree",
help="generate a module hierarchy tree") help="generate a module hierarchy tree")
......
...@@ -114,7 +114,7 @@ class ActionCore(Action): ...@@ -114,7 +114,7 @@ class ActionCore(Action):
for mod_aux in unfetched_modules: for mod_aux in unfetched_modules:
logging.warning( logging.warning(
"List incomplete, module %s has not been fetched!", mod_aux) "List incomplete, module %s has not been fetched!", mod_aux)
file_set = self.build_file_set() file_set = self.build_file_set(top_entity=self.env.options.top)
file_list = dep_solver.make_dependency_sorted_list(file_set) file_list = dep_solver.make_dependency_sorted_list(file_set)
files_str = [file_aux.path for file_aux in file_list] files_str = [file_aux.path for file_aux in file_list]
if self.env.options.delimiter is None: if self.env.options.delimiter is None:
......
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