Skip to content

Commit 230615a

Browse files
authored
fix: improved init command excluded unnecessary flags (#365)
# Description Excluded unnecessary flags in "metal init"
2 parents 5746b18 + dd93c3a commit 230615a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/init/init.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ func (c *Client) NewCommand() *cobra.Command {
9191
c.UserService = *metalGoClient.UsersApi
9292
c.ProjectService = *metalGoClient.ProjectsApi
9393

94-
user, _, err := c.UserService.FindCurrentUser(context.Background()).Execute()
94+
include := []string{} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional)
95+
exclude := []string{"devices", "members", "memberships", "invitations", "ssh_keys", "volumes", "backend_transfer_enabled", "updated_at", "customdata", "event_alert_configuration",
96+
"timezone", "features", "avatar_url", "avatar_thumb_url", "two_factor_auth", "mailing_address", "max_projects", "verification_stage", "emails", "phone_number", "restricted",
97+
"full_name", "email", "social_accounts", "opt_in_updated_at", "opt_in", "first_name", "last_name", "last_login_at"}
98+
user, _, err := c.UserService.FindCurrentUser(context.Background()).Include(include).Exclude(exclude).Execute()
9599
if err != nil {
96100
return err
97101
}

0 commit comments

Comments
 (0)