From 777f9af8f05d9e64fcff3ede2182eab880901343 Mon Sep 17 00:00:00 2001 From: Victor Vrantchan Date: Mon, 30 Oct 2017 22:38:21 -0400 Subject: [PATCH] add usage text for dep-profiles (#289) Closes #288 --- cmd/mdmctl/get_dep_profiles.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/cmd/mdmctl/get_dep_profiles.go b/cmd/mdmctl/get_dep_profiles.go index 12573c48..17078703 100644 --- a/cmd/mdmctl/get_dep_profiles.go +++ b/cmd/mdmctl/get_dep_profiles.go @@ -20,15 +20,29 @@ func (out *depProfilesTableOutput) BasicFooter() { out.w.Flush() } +const noUUIDText = `The DEP API does not support listing profiles. +A UUID flag must be specified. To get currently assigned profile UUIDs run + mdmctl get dep-devices -serials=serial1,serial2,serial3 +The output of the dep-devices response will contain the profile UUIDs. +` + func (cmd *getCommand) getDEPProfiles(args []string) error { flagset := flag.NewFlagSet("dep-profiles", flag.ExitOnError) - flProfilePath := flagset.String("f", "", "filename of DEP profile to apply") - flUUID := flagset.String("uuid", "", "DEP Profile UUID") + var ( + flProfilePath = flagset.String("f", "", "filename of DEP profile to apply") + flUUID = flagset.String("uuid", "", "DEP Profile UUID(required)") + ) flagset.Usage = usageFor(flagset, "mdmctl get dep-profiles [flags]") if err := flagset.Parse(args); err != nil { return err } + if *flUUID == "" { + fmt.Println(noUUIDText) + flagset.Usage() + os.Exit(1) + } + ctx := context.Background() resp, err := cmd.list.GetDEPProfile(ctx, *flUUID) if err != nil {