Skip to content
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

cli/container: Pretty-print creation timestamp in list-objects output #2653

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Changelog for NeoFS Node
- Policer's setting to the SN's application configuration (#2600)
- Support of verified domains for the storage nodes (#2280)
- `neofs-lens storage status` CLI command (#2550)
- Human-readable output of objects' creation timestamp to `neofs-cli container list-objects` (#2653)

### Fixed
- `neofs-cli netmap netinfo` documentation (#2555)
Expand Down
10 changes: 9 additions & 1 deletion cmd/neofs-cli/modules/container/list_objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,15 @@ var listContainerObjectsCmd = &cobra.Command{
if err == nil {
attrs := resHead.Header().UserAttributes()
for i := range attrs {
cmd.Printf(" %s: %s\n", attrs[i].Key(), attrs[i].Value())
key := attrs[i].Key()
val := attrs[i].Value()

if key == object.AttributeTimestamp {
cmd.Printf(" %s: %s (%s)\n", key, val, common.PrettyPrintUnixTime(val))
continue
}

cmd.Printf(" %s: %s\n", key, val)
}
} else {
cmd.Printf(" failed to read attributes: %v\n", err)
Expand Down
Loading