Skip to content

Commit

Permalink
appengine device attributes list: show them in a cleaner way
Browse files Browse the repository at this point in the history
display attributes in a human-friendly representation instead
of defaulting to Go's internal one.
Keep consistency with aliases display (see previous commit).

Signed-off-by: Arnaldo Cesco <arnaldo.cesco@gmail.com>
  • Loading branch information
Annopaolo committed Nov 12, 2024
1 parent 69e4ec4 commit 786dff5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [24.5.3] - Unreleased
### Changed
- `appengine device attributes list`: display attributes in a human-friendly
representation instead Go's internal one. Keep consistency with aliases.

### Fixed
- `appengine device alias list`: show aliases as a map instead of a list.
Fix [#275](https://github.com/astarte-platform/astartectl/issues/275).
Expand Down
6 changes: 5 additions & 1 deletion cmd/appengine/device_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ func attributesListF(command *cobra.Command, args []string) error {
os.Exit(1)
}
attributes, _ := attributesRes.Parse()
attributesMap, _ := attributes.(map[string]string)

for k, v := range attributesMap {
fmt.Printf("%v: %v\n", k,v)
}

fmt.Printf("%v\n", attributes)
return nil
}

Expand Down

0 comments on commit 786dff5

Please sign in to comment.