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 (#1)
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 "ERROR "du s3://bucket": no object found" part. They both exits with 0 without any change.
- Loading branch information