MCPcopy Index your code
hub / github.com/devopsctl/gitlabctl / validateFlagStringValue

Function validateFlagStringValue

cmd/flags_definers.go:448–459  ·  view source on GitHub ↗
(stringSlice []string,
	cmd *cobra.Command, fName string)

Source from the content-addressed store, hash-verified

446}
447
448func validateFlagStringValue(stringSlice []string,
449 cmd *cobra.Command, fName string) error {
450 fValue := getFlagString(cmd, fName)
451 for _, v := range stringSlice {
452 if fValue == v {
453 return nil
454 }
455 }
456 return fmt.Errorf("'%s' is not a recognized value of '%s' flag. "+
457 "Please choose from: [%s]\n",
458 fValue, fName, strings.Join(stringSlice, ", "))
459}
460
461func validateFlagIntValue(intSlice []int,
462 cmd *cobra.Command, fName string) error {

Callers 7

validateMergeMethodValueFunction · 0.85
validateSortFlagValueFunction · 0.85
validateOutFlagValueFunction · 0.85

Calls 1

getFlagStringFunction · 0.85

Tested by

no test coverage detected