Files
micromdm/cmd/mdmctl/remove_profiles.go
Nate Felton 77d46f93d7 Fixes serial[s] flag to match other commands (#621)
Fixes serial[s] flag to match other commands

Fixes #618
2019-10-30 09:47:01 -04:00

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
}