Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/azure-cli/azure/cli/command_modules/storage/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,8 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
help='An opaque continuation token. This value can be retrieved from the next_marker field of a '
'previous generator object. If specified, this generator will begin returning results from this '
'point.')
c.argument('show_next_marker', action='store_true', is_preview=True,
help='Show nextMarker in result when specified.')

for item in ['create', 'show', 'delete', 'exists', 'upload', 'append', 'download', 'show', 'metadata update',
'metadata show']:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,20 @@ def get_file_properties(client, timeout=None):
return result


def list_fs_files(client, path=None, recursive=True, num_results=None, timeout=None, exclude_dir=None, marker=None):
def list_fs_files(client, path=None, recursive=True, num_results=None, timeout=None, exclude_dir=None,
marker=None, show_next_marker=None):
generator = client.get_paths(path=path, max_results=num_results, recursive=recursive, timeout=timeout)
pages = generator.by_page(continuation_token=marker)

result = next(pages)
result = list(next(pages))

if pages.continuation_token:
logger.warning('Next Marker:')
logger.warning(pages.continuation_token)
if show_next_marker:
next_marker = {"nextMarker": pages.continuation_token}
result.append(next_marker)
else:
if pages.continuation_token:
logger.warning('Next Marker:')
logger.warning(pages.continuation_token)

if exclude_dir:
return list(f for f in result if not f.is_directory)
Expand Down
Loading