-
Notifications
You must be signed in to change notification settings - Fork 517
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
Allow storageclass to be specified on mc ls #3915
Allow storageclass to be specified on mc ls #3915
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.
I think instead of providing storage-class we can bring in an option called -a
to list all hidden files like Unix.
In case of object storage this prints storage class as well.
Not a bad idea. I'll add to -a option. @harshavardhana What do you think about it ? |
Yes buts not really useful to filter in this manner since Listing is slow and it may never provide any output if you incorrectly provide the storage-class. This in-turn might be assumed as listing is not working. The best way is print everything -a and use grep instead to filter what you want. There are many ways to do it - trying to see what makes sense for our command line. Note: mc ls is used for filesystem folders and files as well which may provide empty results here with storage-class. I will circle back later on what makes sense let me think about it more. |
Totally true, I agree with that. That exactly what could happen if the storage class provided is invalid or if objects are not of this storage class.
Didn't thought about it...
As implemented in the PR the storage class filter only applies when a storage class is present ( != "" ) |
Why not simply list GLACIER objects in |
We can change the format and print always, and keep filtering for specific storage classes if needed. |
Always show storage class if present.
I applied a small change to have the described behavior. |
Looks great @Willena |
The current version of the ls command omits GLACIER objects.
Sometimes you need to get a list of those files that are located under another storage class.
This commit allows filtering a given storage class and only list this class, or list all objects in all storage classes. The default value is STANDARD.
Usage example:
mc ls -r -sc GLACIER myAlias/
mc ls -r myAlias/
mc ls -r -sc '*' myAlias/
output example: