code: func (c *cipdSubcommand) checkArgs(args []string, minPosCount, maxPosCount int) bool {
  	// Check number of expected positional arguments.
  	if maxPosCount == 0 && len(args) != 0 {
  		c.printError(makeCLIError("unexpected arguments %v", args))
  		return false
  	}
  	if len(args) < minPosCount || (maxPosCount >= 0 && len(args) > maxPosCount) {
  		var err error
  		if minPosCount == maxPosCount {
  			err = makeCLIError("expecting %d positional argument, got %d instead", minPosCount, len(args))
  		} else {
  			if maxPosCount >= 0 {
  				err = makeCLIError(
  					"expecting from %d to %d positional arguments, got %d instead",
  					minPosCount, maxPosCount, len(args))
  			} else {
  				err = makeCLIError(
  					"expecting at least %d positional arguments, got %d instead",
  					minPosCount, len(args))
  			}
  		}
  		c.printError(err)
  		return false
  	}
  
  	// Check required unset flags.
  	unset := []*flag.Flag{}
  	c.Flags.VisitAll(func(f *flag.Flag) {
  		if strings.HasPrefix(f.DefValue, "<") && f.Value.String() == f.DefValue {
  			unset = append(unset, f)
  		}
  	})
  	if len(unset) != 0 {
  		missing := make([]string, len(unset))
  		for i, f := range unset {
  			missing[i] = f.Name
  		}
  		c.printError(makeCLIError("missing required flags: %v", missing))
  		return false
  	}
  
  	return true
  }
docs: // checkArgs checks command line args.
  //
  // It ensures all required positional and flag-like parameters are set.
  // Returns true if they are, or false (and prints to stderr) if not.