Skip to content

Commit

Permalink
cli: add '--copy-permissions' option to the 'unpack' command.
Browse files Browse the repository at this point in the history
  • Loading branch information
pjbriggs committed Feb 7, 2025
1 parent b601ab7 commit f1f2201
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ngsarchiver/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ def main(argv=None):
action='store',dest='out_dir',
help="unpack archive under OUT_DIR "
"(default: current directory)")
parser_unpack.add_argument('--copy-permissions',
action='store_true', dest='copy_permissions',
help="copy the permissions stored in the "
"archive to the extracted files (default: "
"set permissions to read-write)")

# 'search' command
parser_search = s.add_parser('search',
Expand Down Expand Up @@ -558,7 +563,8 @@ def main(argv=None):
"names but destination cannot handle "
"names which only differ by case")
return CLIStatus.ERROR
d = a.unpack(extract_dir=dest_dir)
d = a.unpack(extract_dir=dest_dir,
set_permissions=args.copy_permissions)
print("Unpacked directory: %s" % d)
return CLIStatus.OK

Expand Down

0 comments on commit f1f2201

Please sign in to comment.