From a06cc2939c82cca58362a554b9c0615885f2d016 Mon Sep 17 00:00:00 2001 From: Simone Scarduzio Date: Wed, 8 Oct 2025 13:06:15 +0200 Subject: [PATCH] fix: Show only filename in ls output, not full path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/deltaglider/app/cli/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/deltaglider/app/cli/main.py b/src/deltaglider/app/cli/main.py index 54f5456..5ccc809 100644 --- a/src/deltaglider/app/cli/main.py +++ b/src/deltaglider/app/cli/main.py @@ -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: