add usage text for dep-profiles (#289)

Closes #288
This commit is contained in:
Victor Vrantchan
2017-10-30 22:38:21 -04:00
committed by GitHub
parent 3f0238719c
commit 777f9af8f0

View File

@@ -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 {