// Validate command line arguments.
181530
func checkMakeBucketSyntax(ctx *cli.Context) {
	if !ctx.Args().Present() {
		cli.ShowCommandHelpAndExit(ctx, "mb", 1) // last argument is exit code
	}
}
1054761
func (c *CmdClause) Validate(validator CmdClauseValidator) *CmdClause {
	c.validator = validator
	return c
}
672817
func (c *RemindersAddCall) ValidateArgs() error {
	if len(c.text) <= 0 {
		return errors.New(`required field text not initialized`)
	}
	if c.time == 0 {
		return errors.New(`required field time not initialized`)
	}
	return nil
}
1238767
func (p *IntParam) Args() []string {
	return []string{fmt.Sprintf("--%v", p.CLIName()), p.String()}
}
1260267
func (m *Pow) Validate(n *expr.FuncNode) (expr.EvaluatorFunc, error) {
	if len(n.Args) != 2 {
		return nil, fmt.Errorf("Expected 2 args for Pow(numer, power) but got %s", n)
	}
	return powerEval, nil
}
512728
func Validate(vs ...Validator) cli.BeforeFunc {
	return func(context *cli.Context) error {
		remaining := context.Args()
		for _, v := range vs {
			consumed := v(remaining)
			if consumed < 0 {
				return ErrInvalidUsage
			}
			remaining = remaining[consumed:]
		}

		if len(remaining) > 0 {
			return ErrInvalidUsage
		}

		return nil
	}
}
40839
func (c *UsersSetPresenceCall) ValidateArgs() error {
	if len(c.presence) <= 0 {
		return errors.New(`required field presence not initialized`)
	}
	return nil
}
304226
func (c *errorCommand) validate() (string, error) {

	if c.curlen > 256+6 {
		return "", fmt.Errorf("invalid ERROR length %d", c.curlen)
	}
	if c.curlen < 7 {
		return "", fmt.Errorf("invalid ERROR length %d", c.curlen)
	}

	srcHeader := c.buf[:6]
	srcReasonSize := c.buf[6:7]
	srcReason := c.buf[7:c.curlen]

	/* Validate the header. */
	if bytes.Compare(srcHeader, []byte{5, 'E', 'R', 'R', 'O', 'R'}) != 0 {
		return "", fmt.Errorf("malformed ERROR header")
	}

	reasonSize := uint8(srcReasonSize[0])
	if int(reasonSize) != len(srcReason) {
		return "", fmt.Errorf("unexpected length for the reason: %d != %d", reasonSize, len(srcReason))
	}

	reason := string(srcReason)

	return reason, nil
}
1191889
func (o *LogsOptions) Validate(args []string) error {
	if err := o.KubeLogOptions.Validate(); err != nil {
		return err
	}
	if o.Options == nil {
		return nil
	}
	switch t := o.Options.(type) {
	case *buildv1.BuildLogOptions:
		if t.Previous && t.Version != nil {
			return errors.New("cannot use both --previous and --version")
		}
	case *appsv1.DeploymentLogOptions:
		if t.Previous && t.Version != nil {
			return errors.New("cannot use both --previous and --version")
		}
	default:
		return errors.New("invalid log options object provided")
	}
	return nil
}
59056
func (p *PathParam) Args() []string {
	return []string{fmt.Sprintf("--%v", p.CLIName()), p.String()}
}
491480
func Validate(genericArgs *args.GeneratorArgs) error {
	if len(genericArgs.OutputFileBaseName) == 0 {
		return fmt.Errorf("output file base name cannot be empty")
	}

	return nil
}
274143
func (a *AMQPArgs) Validate() error {
	if !a.Enable {
		return nil
	}
	if _, err := amqp.ParseURI(a.URL.String()); err != nil {
		return err
	}
	return nil
}
1373022
func (c *GroupsRenameCall) ValidateArgs() error {
	if len(c.channel) <= 0 {
		return errors.New(`required field channel not initialized`)
	}
	if len(c.name) <= 0 {
		return errors.New(`required field name not initialized`)
	}
	return nil
}
387308
func (m ModelArgs) Validate() error {
	if m.Type == modelTypeNone {
		return errors.NotValidf("empty Type")
	}
	if m.Config == nil {
		return errors.NotValidf("nil Config")
	}
	if !names.IsValidCloud(m.CloudName) {
		return errors.NotValidf("Cloud Name %q", m.CloudName)
	}
	if m.Owner == (names.UserTag{}) {
		return errors.NotValidf("empty Owner")
	}
	if m.StorageProviderRegistry == nil {
		return errors.NotValidf("nil StorageProviderRegistry")
	}
	switch m.MigrationMode {
	case MigrationModeNone, MigrationModeImporting:
	default:
		return errors.NotValidf("initial migration mode %q", m.MigrationMode)
	}
	return nil
}
18808
func (o *APIResourceOptions) Validate() error {
	supportedOutputTypes := sets.NewString("", "wide", "name")
	if !supportedOutputTypes.Has(o.Output) {
		return fmt.Errorf("--output %v is not available", o.Output)
	}
	return nil
}
1178482
func OnlyValidArgs(cmd *Command, args []string) error {
	if len(cmd.ValidArgs) > 0 {
		for _, v := range args {
			if !stringInSlice(v, cmd.ValidArgs) {
				return fmt.Errorf("invalid argument %q for %q%s", v, cmd.CommandPath(), cmd.findSuggestions(args[0]))
			}
		}
	}
	return nil
}
226691
func (p *BoolParam) Args() []string {
	return []string{fmt.Sprintf("--%v", p.CLIName()), p.String()}
}