Skip to content

Commit

Permalink
cli/container: Pretty-print creation timestamp in list-objects outp…
Browse files Browse the repository at this point in the history
…ut (#2653)
  • Loading branch information
roman-khimov authored Nov 22, 2023
2 parents 60e564f + 7053d05 commit 42cf34f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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

0 comments on commit 42cf34f

Please sign in to comment.