Skip to content

Show tags in list commands #57

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

Merged
merged 7 commits into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Improvements from review
  • Loading branch information
polldo committed Nov 15, 2021
commit 0727673d2134afadead83ab1e30b3acabc159e8e
2 changes: 1 addition & 1 deletion command/device/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func List(params *ListParams) ([]DeviceInfo, error) {
for _, foundDev := range foundDevices {
dev, err := getDeviceInfo(&foundDev)
if err != nil {
return nil, fmt.Errorf("getting device %s from cloud: %w", foundDev.Id, err)
return nil, fmt.Errorf("parsing device %s from cloud: %w", foundDev.Id, err)
}
devices = append(devices, *dev)
}
Expand Down
17 changes: 17 additions & 0 deletions command/tag/tag.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// This file is part of arduino-cloud-cli.
//
// Copyright (C) 2021 ARDUINO SA (http://www.arduino.cc/)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

package tag

import "fmt"
Expand Down
2 changes: 1 addition & 1 deletion command/thing/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func Create(params *CreateParams) (*ThingInfo, error) {

t, err := getThingInfo(newThing)
if err != nil {
return nil, fmt.Errorf("getting the new thing %s from cloud: %w", newThing.Id, err)
return nil, fmt.Errorf("parsing the new thing %s from cloud: %w", newThing.Id, err)
}
return t, nil
}
2 changes: 1 addition & 1 deletion command/thing/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func List(params *ListParams) ([]ThingInfo, error) {
for _, foundThing := range foundThings {
info, err := getThingInfo(&foundThing)
if err != nil {
return nil, fmt.Errorf("getting thing %s from cloud: %w", foundThing.Id, err)
return nil, fmt.Errorf("parsing thing %s from cloud: %w", foundThing.Id, err)
}
things = append(things, *info)
}
Expand Down
4 changes: 2 additions & 2 deletions command/thing/thing.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ type ThingInfo struct {
}

func getThingInfo(thing *iotclient.ArduinoThing) (*ThingInfo, error) {
// Retrieve thing variables
// Process thing variables
var vars []string
for _, p := range thing.Properties {
vars = append(vars, p.Name)
}
// Retrieve thing tags
// Process thing tags
tags, err := tag.TagsInfo(thing.Tags)
if err != nil {
return nil, err
Expand Down