diff --git a/cmd/panelcli/cli.go b/cmd/panelcli/cli.go index df8fd10..0bd52f2 100644 --- a/cmd/panelcli/cli.go +++ b/cmd/panelcli/cli.go @@ -101,17 +101,17 @@ func composeListUserOutput(user paneldb.User, usernameFlag, emailFlag, dateCreat var row string if usernameFlag { row += user.UserName - if emailFlag || !dateCreatedFlag { + if emailFlag || dateCreatedFlag { row += "\t" } } if emailFlag { row += user.Email - if !dateCreatedFlag { + if dateCreatedFlag { row += "\t" } } - if !dateCreatedFlag { + if dateCreatedFlag { row += user.DateCreated } fmt.Fprintln(os.Stdout, row) @@ -131,7 +131,7 @@ func cmdListUsers(args []string) error { os.Exit(1) } // Printing the header - if *headerFlag { + if !*headerFlag { header := paneldb.User{ UserName: "username", Email: "email", diff --git a/db/db.go b/db/db.go index 851a248..efd7b7c 100644 --- a/db/db.go +++ b/db/db.go @@ -9,11 +9,11 @@ import ( ) type User struct { - Id string - UserName string - Email string - DateCreated string - PasswordHash string + ID string `sql:"uid"` + UserName string `sql:"username"` + Email string `sql:"email"` + DateCreated string `sql:"date_created"` + PasswordHash string `sql:"password"` } type DB struct {