mirror of
https://github.com/beshu-tech/deltaglider.git
synced 2026-03-28 20:01:51 +01:00
fix: Show only filename in ls output, not full path
Match AWS S3 CLI behavior where ls shows filenames relative to the current prefix, not the full S3 path. Before: 2024-05-18 20:11:52 73299362 s3://bucket/build/1.57.3/file.zip After: 2024-05-18 20:11:52 73299362 file.zip This matches aws s3 ls behavior exactly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -306,7 +306,13 @@ def ls(
|
||||
else:
|
||||
date_str = obj.last_modified.strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
click.echo(f"{date_str} {size_str:>10} s3://{bucket_name}/{obj.key}")
|
||||
# Show only the filename relative to current prefix (like AWS CLI)
|
||||
if prefix_str:
|
||||
display_key = obj.key[len(prefix_str):]
|
||||
else:
|
||||
display_key = obj.key
|
||||
|
||||
click.echo(f"{date_str} {size_str:>10} {display_key}")
|
||||
|
||||
# Show summary if requested
|
||||
if summarize:
|
||||
|
||||
Reference in New Issue
Block a user