/
delete.go
47 lines (42 loc) · 1.53 KB
/
delete.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package cmd
import (
"github.com/spf13/cobra"
)
var deleteCmd = &cobra.Command{
Use: "delete",
Aliases: []string{"del"},
Short: "Delete a project, or delete notifications and variables from projects or environments",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
validateToken(lagoonCLIConfig.Current) // get a new token if the current one is invalid
},
}
var deleteNotificationCmd = &cobra.Command{
Use: "notification",
Aliases: []string{"n"},
Short: "Delete notifications or delete notifications from projects",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
validateToken(lagoonCLIConfig.Current) // get a new token if the current one is invalid
},
}
var deleteOrganizationCmd = &cobra.Command{
Use: "organization",
Aliases: []string{"o"},
Short: "Add an organization, or add a group/project to an organization",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
validateToken(lagoonCLIConfig.Current) // get a new token if the current one is invalid
},
}
func init() {
deleteCmd.AddCommand(deleteEnvCmd)
deleteCmd.AddCommand(deleteGroupCmd)
deleteCmd.AddCommand(deleteDeployTargetCmd)
deleteCmd.AddCommand(deleteProjectCmd)
deleteCmd.AddCommand(deleteProjectFromGroupCmd)
deleteCmd.AddCommand(deleteNotificationCmd)
deleteCmd.AddCommand(deleteUserCmd)
deleteCmd.AddCommand(deleteSSHKeyCmd)
deleteCmd.AddCommand(deleteUserFromGroupCmd)
deleteCmd.AddCommand(deleteVariableCmd)
deleteCmd.AddCommand(deleteDeployTargetConfigCmd)
deleteCmd.AddCommand(deleteOrganizationCmd)
}