code: func (s *Action) generatePassword(ctx context.Context, c *cli.Context, length string) (string, error) {
  	if c.Bool("xkcd") || c.IsSet("xkcdsep") {
  		return s.generatePasswordXKCD(ctx, c, length)
  	}
  
  	symbols := ctxutil.IsUseSymbols(ctx)
  	if c.IsSet("symbols") {
  		symbols = c.Bool("symbols")
  	}
  
  	var pwlen int
  	if length == "" {
  		candidateLength := defaultLength
  		question := "How long should the password be?"
  		iv, err := termio.AskForInt(ctx, question, candidateLength)
  		if err != nil {
  			return "", ExitError(ctx, ExitUsage, err, "password length must be a number")
  		}
  		pwlen = iv
  	} else {
  		iv, err := strconv.Atoi(length)
  		if err != nil {
  			return "", ExitError(ctx, ExitUsage, err, "password length must be a number")
  		}
  		pwlen = iv
  	}
  
  	if pwlen < 1 {
  		return "", ExitError(ctx, ExitUsage, nil, "password length must not be zero")
  	}
  
  	corp, err := termio.AskForBool(ctx, "Do you have strict rules to include different character classes?", false)
  	if err != nil {
  		return "", err
  	}
  	if corp {
  		return pwgen.GeneratePasswordWithAllClasses(pwlen)
  	}
  
  	return pwgen.GeneratePassword(pwlen, symbols), nil
  }
docs: // generatePassword will run through the password generation steps