-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #1590: Enable listing directories #1832
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor questions and a suggestion but LGTM.
@@ -71,7 +71,8 @@ def transform_file_output(result): | |||
more clearly distinguishes between files and directories. """ | |||
new_result = [] | |||
|
|||
for item in result.get('items', [result]): | |||
iterable = result if isinstance(result, list) else result.get('items', result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning value from the custom command could be a list instead of a ListGenerator
. That is case when directories are filtered.
- name: --num-results | ||
type: integer | ||
short-summary: Specifies the maximum number of directories to return. The default value is | ||
5000. The value cannot be less or equal to zero. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is used as the input to the SDK call to get files and directories, then this is not accurate help text because any files (which will be filtered out) would count against the 5000 count quota.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Then this parameter cannot be accurately functional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguably you could simply omit it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you like the idea to hide the option on both az storage file list
and az storage directory list
until we have a good paging story?
@@ -163,6 +173,10 @@ | |||
helps['storage file list'] = """ | |||
type: command | |||
short-summary: List files and directories in the specified share. | |||
parameters: | |||
- name: --files-only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider something like '--omit-directories' or '--suppress-directories'. For '--file-only' I would need to read the help text to know what that means. The alternative are (at least to mean) a little more self-explanatory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
1. Remove two parameters from both file list and directory list to simplify the command. 2. Update help doc.
No description provided.