MCPcopy Create free account
hub / github.com/bufbuild/buf / validateCreateFlags

Function validateCreateFlags

cmd/buf/internal/command/push/push.go:352–374  ·  view source on GitHub ↗
(flags *flags)

Source from the content-addressed store, hash-verified

350}
351
352func validateCreateFlags(flags *flags) error {
353 if flags.Create {
354 if flags.CreateVisibility == "" {
355 return appcmd.NewInvalidArgumentErrorf(
356 "--%s is required if --%s is set",
357 createVisibilityFlagName,
358 createFlagName,
359 )
360 }
361 if _, err := bufmodule.ParseModuleVisibility(flags.CreateVisibility); err != nil {
362 return appcmd.WrapInvalidArgumentError(err)
363 }
364 } else {
365 if flags.CreateDefaultLabel != "" {
366 return appcmd.NewInvalidArgumentErrorf(
367 "Cannot set --%s without --%s",
368 createDefaultLabelFlagName,
369 createFlagName,
370 )
371 }
372 }
373 return nil
374}
375
376func validateLabelFlags(flags *flags) error {
377 if err := validateLabelFlagCombinations(flags); err != nil {

Callers 1

validateFlagsFunction · 0.70

Calls 1

ParseModuleVisibilityFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…