From 40882443c24e6e6eddf3c648301f8eb25eb84cb5 Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Sat, 10 Sep 2022 16:39:08 +0800 Subject: [PATCH] feat: add show admin's username --- cmd/{password.go => admin.go} | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename cmd/{password.go => admin.go} (82%) diff --git a/cmd/password.go b/cmd/admin.go similarity index 82% rename from cmd/password.go rename to cmd/admin.go index 42497ccfb02..6f61ccabb8c 100644 --- a/cmd/password.go +++ b/cmd/admin.go @@ -11,15 +11,16 @@ import ( // passwordCmd represents the password command var passwordCmd = &cobra.Command{ - Use: "password", - Short: "Show admin user's password", + Use: "admin", + Aliases: []string{"password"}, + Short: "Show admin user's info", Run: func(cmd *cobra.Command, args []string) { Init() admin, err := db.GetAdmin() if err != nil { utils.Log.Errorf("failed get admin user: %+v", err) } else { - utils.Log.Infof("admin user's password is: %s", admin.Password) + utils.Log.Infof("admin user's info: \nusername: %s\npassword: %s", admin.Username, admin.Password) } }, }