Skip to content

Commit

Permalink
hachoir-list: print file name only if multiple files are opened
Browse files Browse the repository at this point in the history
Also, add newlines between files.
  • Loading branch information
oliver authored and vstinner committed Jan 7, 2025
1 parent 03241a8 commit 4167dec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion hachoir/listtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,16 @@ def main():
configureHachoir(values)

# Open file and create parser
showing_multiple_files = len(filenames) > 1
i = 0
for filename in filenames:
print(f"File: {filename}")

i += 1
if i > 1:
print()
if showing_multiple_files:
print(f"File: {filename}")

parser, err = openParser(values.parser, filename,
values.offset, values.size)
if err:
Expand Down

0 comments on commit 4167dec

Please sign in to comment.