Merge 7bef1693e5
into 74f26d5dfd
This commit is contained in:
commit
d3ed8efa35
1 changed files with 7 additions and 1 deletions
8
rpatool
8
rpatool
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python3
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
|
@ -323,6 +323,7 @@ if __name__ == "__main__":
|
|||
|
||||
parser.add_argument('-l', '--list', action='store_true', help='List files in archive ARCHIVE.')
|
||||
parser.add_argument('-x', '--extract', action='store_true', help='Extract FILEs from ARCHIVE.')
|
||||
parser.add_argument('--only', metavar='EXT', help='Optional: extract only files with this extension (e.g., .png)')
|
||||
parser.add_argument('-c', '--create', action='store_true', help='Creative ARCHIVE from FILEs.')
|
||||
parser.add_argument('-d', '--delete', action='store_true', help='Delete FILEs from ARCHIVE.')
|
||||
parser.add_argument('-a', '--append', action='store_true', help='Append FILEs to ARCHIVE.')
|
||||
|
@ -433,6 +434,11 @@ if __name__ == "__main__":
|
|||
files = arguments.files
|
||||
else:
|
||||
files = archive.list()
|
||||
|
||||
# optional filter --only
|
||||
if arguments.only:
|
||||
files = [f for f in files if f.lower().endswith(arguments.only.lower())]
|
||||
|
||||
|
||||
# Create output directory if not present.
|
||||
if not os.path.exists(output):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue