//NewDeleteGroupCommand creates a new group
NewDeleteGroupCommand creates a new group
// NewDeleteGroupCommand creates a new group
func NewDeleteGroupCommand() *cobra.Command {
	var name string
	cmd := &cobra.Command{
		Use:              "delete",
		Short:            "Delete a group",
		Example:          "groups delete --name MyGroup",
		TraverseChildren: true,
		SilenceErrors:    true,
		RunE: func(cmd *cobra.Command, args []string) error {
			if err := bite.CheckRequiredFlags(cmd, bite.FlagPair{"name": name}); err != nil {
				return err
			}
			if err := config.Client.DeleteGroup(name); err != nil {
				return fmt.Errorf("Failed to delete group [%s]. [%s]", name, err.Error())
			}
			return bite.PrintInfo(cmd, "Group [%s] deleted.", name)
		},
	}
	cmd.Flags().StringVar(&name, "name", "", "Group name")
	bite.CanPrintJSON(cmd)
	bite.CanBeSilent(cmd)
	return cmd
}
func NewDeleteGroupCommand ( ) * cobra . Command { var name string cmd := & cobra . Command { Use : " " , Short : " " , Example : " " , TraverseChildren : true , SilenceErrors : true , RunE : func ( cmd * cobra . Command , args [ ] string ) error { if err := bite . CheckRequiredFlags ( cmd , bite . FlagPair { " " : name } ) ; err != nil { return err } if err := config . Client . DeleteGroup ( name ) ; err != nil { return fmt . Errorf ( " " , name , err . Error ( ) ) } return bite . PrintInfo ( cmd , " " , name ) } , } cmd . Flags ( ) . StringVar ( & name , " " , " " , " " ) bite . CanPrintJSON ( cmd ) bite . CanBeSilent ( cmd ) return cmd }
NewDeleteGroupCommand creates a new group
NewDeleteGroupCommand creates a new group