mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-07 01:55:48 +08:00
30 lines
658 B
Go
30 lines
658 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"flag"
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
func (cmd *removeCommand) removeBlueprints(args []string) error {
|
|
flagset := flag.NewFlagSet("remove-blueprints", flag.ExitOnError)
|
|
var (
|
|
flBlueprintName = flagset.String("name", "", "name of blueprint, optionally comma-separated")
|
|
)
|
|
flagset.Usage = usageFor(flagset, "mdmctl remove blueprints [flags]")
|
|
if err := flagset.Parse(args); err != nil {
|
|
return err
|
|
}
|
|
|
|
ctx := context.Background()
|
|
err := cmd.blueprintsvc.RemoveBlueprints(ctx, strings.Split(*flBlueprintName, ","))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fmt.Printf("removed blueprint(s): %s\n", *flBlueprintName)
|
|
|
|
return nil
|
|
}
|