-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ls differentiate exit codes for empty and non-existent buckets (#…
…732) Previously, s5cmd ls returned an exit code of 1 for both empty buckets and non-existent buckets, making it difficult to differentiate between the two cases. This change updates the behavior to: - Return exit code 0 for empty buckets, similar to the behavior of s3cmd. - Return exit code 1 for non-existent buckets, providing a clear distinction. Example behavior after the change: `s5cmd ls s3://empty-bucket` returns exit code 0. It does not print anything. `s5cmd ls s3://non-existent-bucket` returns exit code 1 with an appropriate error message. Also, select command with `--all-versions true` flag no longer prints `ERROR "s3://bucket/": no object found` message for empty buckets. Similarly, du command used to print ``` ERROR "du s3://empty-bucket": no object found 0 bytes in 0 objects: s3://empty-bucket ``` Now it will omit the part with error, it will yield: ``` 0 bytes in 0 objects: s3://empty-bucket ``` They both exit with 0 without any change. Resolves #722 --------- Co-authored-by: Tarık Buğra Özyurt <[email protected]> Co-authored-by: Deniz Surmeli <[email protected]> Co-authored-by: İbrahim Güngör <[email protected]>
- Loading branch information
1 parent
0adfb9b
commit 21fa2da
Showing
5 changed files
with
151 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters