package delete import ( "fmt" "edge-infra.dev/pkg/edge/api/graph/model" "edge-infra.dev/pkg/edge/edgeadmin/commands/operatorintervention/format" "edge-infra.dev/pkg/edge/edgecli" "edge-infra.dev/pkg/lib/cli/command" ) func NewCmd(cfg *edgecli.Config) *command.Command { return &command.Command{ ShortUsage: "edgeadmin operatorintervention delete", ShortHelp: "Commands to delete operator intervention configuration", Commands: []*command.Command{ NewDeleteCommand(cfg), NewDeletePrivilege(cfg), NewDeleteRoleMapping(cfg), NewDeleteRule(cfg), }, } } // handleResponseFormatting is a helper for pretty printing the output from the // mutation. Can be used for each mutation type with a different commandType func handleResponseFormatting(mutationType string, errors []*model.OperatorInterventionErrorResponse) error { fmt.Println(format.GenerateDeleteOutput(mutationType, errors)) if len(errors) != 0 { // Return empty error to guarantee binary non-zero exit code. // Error details have already been printed, so return an empty // error. This does unfortunately print an extra blank line on // the output return fmt.Errorf("") } return nil }