mirror of
https://github.com/micromdm/micromdm/
synced 2026-06-26 00:15:41 +08:00
Moved all the endpoints into the profile package. Defined a Store interface which includes all the used BoltDB methods. Moved the BoltDB implementation into a subpackage.
30 lines
636 B
Go
30 lines
636 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"flag"
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
func (cmd *removeCommand) removeProfiles(args []string) error {
|
|
flagset := flag.NewFlagSet("remove-profiles", flag.ExitOnError)
|
|
var (
|
|
flIdentifier = flagset.String("id", "", "profile Identifier, optionally comma separated")
|
|
)
|
|
flagset.Usage = usageFor(flagset, "mdmctl remove profiles [flags]")
|
|
if err := flagset.Parse(args); err != nil {
|
|
return err
|
|
}
|
|
|
|
ctx := context.Background()
|
|
err := cmd.profilesvc.RemoveProfiles(ctx, strings.Split(*flIdentifier, ","))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fmt.Printf("removed profile(s): %s\n", *flIdentifier)
|
|
|
|
return nil
|
|
}
|