Skip to content

Commit b733978

Browse files
committed
[API] Assume no mount point being specified with --no-mount
1 parent fe8dbdf commit b733978

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

ratarmount/actions.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,10 @@ def process_parsed_arguments(args) -> int:
178178
# This is a hack but because we have two positional arguments (and want that reflected in the auto-generated help),
179179
# all positional arguments, including the mountpath will be parsed into args.mount_source and we have to
180180
# manually separate them depending on the type.
181-
lastArgument = args.mount_source[-1]
182-
if '://' not in lastArgument and (os.path.isdir(lastArgument) or not os.path.exists(lastArgument)):
183-
args.mount_point = args.mount_source.pop()
181+
if args.mount:
182+
lastArgument = args.mount_source[-1]
183+
if '://' not in lastArgument and (os.path.isdir(lastArgument) or not os.path.exists(lastArgument)):
184+
args.mount_point = args.mount_source.pop()
184185
if not args.mount_source and not args.write_overlay and not args.control_interface:
185186
raise argparse.ArgumentTypeError("You must specify at least one path to a valid archive or folder!")
186187

0 commit comments

Comments
 (0)