Skip to content

Commit b0a115c

Browse files
googlyrahmansushantkhanna
authored andcommitted
add translation for -r, -R in gsutil mv command
1 parent fed1458 commit b0a115c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

gslib/commands/mv.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@
9393
""")
9494

9595

96+
MV_SHIM_FLAG_MAP = {**CP_AND_MV_SHIM_FLAG_MAP, '-r': None, '-R': None}
97+
98+
9699
class MvCommand(Command):
97100
"""Implementation of gsutil mv command.
98101
@@ -132,7 +135,7 @@ def get_gcloud_storage_args(self):
132135
ShimTranslatePredefinedAclSubOptForCopy(self.sub_opts)
133136
gcloud_storage_map = GcloudStorageMap(
134137
gcloud_command=['storage', 'mv'],
135-
flag_map=CP_AND_MV_SHIM_FLAG_MAP,
138+
flag_map=MV_SHIM_FLAG_MAP,
136139
)
137140
return super().get_gcloud_storage_args(gcloud_storage_map)
138141

gslib/tests/test_mv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def test_shim_translates_flags(self):
121121
'CLOUDSDK_ROOT_DIR': 'fake_dir',
122122
}):
123123
mock_log_handler = self.RunCommand(
124-
'mv', ['-a', 'public-read', '-U', fpath,
124+
'mv', ['-a', 'public-read', '-U', '-r', '-R', fpath,
125125
suri(bucket_uri)],
126126
return_log_handler=True)
127127
info_lines = '\n'.join(mock_log_handler.messages['info'])

0 commit comments

Comments
 (0)