diff --git a/cmd/panelcli/cli.go b/cmd/panelcli/cli.go index 3b965ff..b73cddd 100644 --- a/cmd/panelcli/cli.go +++ b/cmd/panelcli/cli.go @@ -181,7 +181,7 @@ func cmdShowUser(args []string) error { if err != nil { return err } - fmt.Println(user) + fmt.Println(user.Details()) return nil } diff --git a/db/db.go b/db/db.go index ea3e42d..a953ecf 100644 --- a/db/db.go +++ b/db/db.go @@ -21,6 +21,11 @@ func (u User) String() string { return fmt.Sprintf("{User: %s <%s>}", u.Name, u.Email) } +func (u User) Details() string { + return fmt.Sprintf("UID:\t%s\nName:\t%s\nEmail:\t%s\nCreated:\t%s", + u.ID, u.Name, u.Email, u.DateCreated) +} + // DB represents the application database. It provides high-level methods to get and manipulate objects. type DB struct { PgDB *pg.DB