-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
incus/cluster: Add customizable columns to list #784
Conversation
cmd/incus/cluster.go
Outdated
@@ -19,10 +19,17 @@ import ( | |||
"github.com/lxc/incus/v6/shared/util" | |||
) | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant empty line.
cmd/incus/cluster.go
Outdated
type cmdCluster struct { | ||
global *cmdGlobal | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant empty line.
cmd/incus/cluster.go
Outdated
flagFormat string | ||
flagAllProjects bool | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant empty line.
cmd/incus/cluster.go
Outdated
// Show. | ||
type cmdClusterShow struct { | ||
global *cmdGlobal | ||
cluster *cmdCluster | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant empty line.
cmd/incus/cluster.go
Outdated
return cli.RenderTable(c.flagFormat, header, data, members) | ||
} | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant empty lines.
cmd/incus/cluster.go
Outdated
@@ -292,6 +406,7 @@ func (c *cmdClusterInfo) Run(cmd *cobra.Command, args []string) error { | |||
return err | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant empty line.
cmd/incus/cluster.go
Outdated
|
||
for _, columnRune := range columnEntry { | ||
column, ok := columnsShorthandMap[columnRune] | ||
if ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simplify this if..else
:
if ok {
columns = append(columns, column)
}
return nil, fmt.Errorf(i18n.G("Unknown column shorthand char '%c' in '%s'"), columnRune, columnEntry)
Closes lxc#721 Signed-off-by: Anish Mankal <anish.mankal@gmail.com>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
@Anish-M I've added couple of minor comments. In addition:
Thanks! |
I've done the following:
On top of those small easy fixes, I also noticed that you had put mention of filtering in the description but |
@presztak thanks for the review! I think you caught all the same stuff I did :) |
Add customizable columns to incus cluster list