Add the --reverse option to the list-files command

parent b724508c
......@@ -259,6 +259,7 @@ def _get_parser():
listmod.add_argument("--terse", help="do not print comments", default=False, action="store_true", dest="terse")
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=' ')
listfiles.add_argument("--reverse", help="reverse the order for the list of files", dest="reverse", default=False, action="store_true")
merge_cores = subparsers.add_parser("merge-cores", help="Merges entire synthesizable content of an project into a pair of VHDL/Verilog files")
merge_cores.add_argument("--dest", help="name for output merged file", dest="dest", default=None)
synthesis_proj = subparsers.add_parser("project", help="create/update a project for the appropriated tool")
......
......@@ -123,7 +123,10 @@ def make_dependency_sorted_list(fileset, purge_unused=True):
non_dependable = [f for f in fileset if not isinstance(f, DepFile)]
dependable.sort(key=lambda f: f.file_path.lower()) # Not necessary, but will tend to group files more nicely in the output.
dependable.sort(key=DepFile.get_dep_level)
return non_dependable + dependable
sorted_list = non_dependable + dependable
if global_mod.options.reverse == True:
sorted_list = list(reversed(sorted_list))
return sorted_list
def make_dependency_set(fileset, top_level_entity):
"""Create a set of all files required to build the named top_level_entity."""
......
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