fix(cli): rename user project command
This commit is contained in:
parent
cade124799
commit
7d9e8bd150
@ -73,7 +73,7 @@ func init() {
|
|||||||
// User deletion flags
|
// User deletion flags
|
||||||
userDeleteCmd.Flags().BoolVarP(&userFlagDeleteNow, "now", "n", false, "If provided, deletes the user immediately instead of sending them an email first.")
|
userDeleteCmd.Flags().BoolVarP(&userFlagDeleteNow, "now", "n", false, "If provided, deletes the user immediately instead of sending them an email first.")
|
||||||
|
|
||||||
userCmd.AddCommand(userProjectCmd, userCreateCmd, userUpdateCmd, userResetPasswordCmd, userChangeEnabledCmd, userDeleteCmd)
|
userCmd.AddCommand(userListCmd, userCreateCmd, userUpdateCmd, userResetPasswordCmd, userChangeEnabledCmd, userDeleteCmd)
|
||||||
rootCmd.AddCommand(userCmd)
|
rootCmd.AddCommand(userCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,9 +117,9 @@ var userCmd = &cobra.Command{
|
|||||||
Short: "Manage users locally through the cli.",
|
Short: "Manage users locally through the cli.",
|
||||||
}
|
}
|
||||||
|
|
||||||
var userProjectCmd = &cobra.Command{
|
var userListCmd = &cobra.Command{
|
||||||
Use: "project",
|
Use: "list",
|
||||||
Short: "Shows a project of all users.",
|
Short: "Shows a list of all users.",
|
||||||
PreRun: func(cmd *cobra.Command, args []string) {
|
PreRun: func(cmd *cobra.Command, args []string) {
|
||||||
initialize.FullInit()
|
initialize.FullInit()
|
||||||
},
|
},
|
||||||
@ -127,7 +127,7 @@ var userProjectCmd = &cobra.Command{
|
|||||||
s := db.NewSession()
|
s := db.NewSession()
|
||||||
defer s.Close()
|
defer s.Close()
|
||||||
|
|
||||||
users, err := user.ProjectAllUsers(s)
|
users, err := user.ListAllUsers(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = s.Rollback()
|
_ = s.Rollback()
|
||||||
log.Fatalf("Error getting users: %s", err)
|
log.Fatalf("Error getting users: %s", err)
|
||||||
|
@ -397,7 +397,7 @@ func TestProjectUsers(t *testing.T) {
|
|||||||
s := db.NewSession()
|
s := db.NewSession()
|
||||||
defer s.Close()
|
defer s.Close()
|
||||||
|
|
||||||
all, err := ProjectAllUsers(s)
|
all, err := ListAllUsers(s)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Len(t, all, 15)
|
assert.Len(t, all, 15)
|
||||||
})
|
})
|
||||||
|
@ -106,8 +106,8 @@ outer:
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProjectAllUsers returns all users
|
// ListAllUsers returns all users
|
||||||
func ProjectAllUsers(s *xorm.Session) (users []*User, err error) {
|
func ListAllUsers(s *xorm.Session) (users []*User, err error) {
|
||||||
err = s.Find(&users)
|
err = s.Find(&users)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user