func (f StringSliceFlag) Register(fs *pflag.FlagSet) {
	if f.Shorthand == "" {
		fs.StringSliceVar(f.Value, f.Name, f.DefaultValue, f.Usage.String())
	} else {
		fs.StringSliceVarP(f.Value, f.Name, f.Shorthand, f.DefaultValue, f.Usage.String())
	}
	registerFlag(fs, f.Meta)
}
Register registers the string slice flag with the provided flag set
package flags
import (
	"fmt"
	"strings"
	"github.com/spf13/pflag"
)
const (
	TypeInt    = "Integer"
	TypeString = "String"
)
type Flag interface {
	Register(fs *pflag.FlagSet)
}
type Meta struct {
	Name      string
	Shorthand string
	Usage     Usage
	Hidden    bool
	Deprecate string
}
type Usage struct {
	Description string
	AllowedFormat string
	DefaultValue string
	AllowedValues []string
	Note string
	DocsLink string
}
func (u Usage) String() string {
	parts := make([]string, 0, 4)
	parts = append(parts, u.Description)
	if u.Note != "" {
		parts = append(parts, fmt.Sprintf("(Note: %s)", u.Note))
	}
	if u.DefaultValue != "" || len(u.AllowedValues) > 0 {
		valueParts := make([]string, 0, 3)
		if u.AllowedFormat != "" {
			valueParts = append(valueParts, fmt.Sprintf("Allowed format: %q", u.AllowedFormat))
		}
		if u.DefaultValue != "" {
			valueParts = append(valueParts, "Default value: "+u.DefaultValue)
		}
		if len(u.AllowedValues) > 0 {
			valueParts = append(valueParts, "Allowed values: "+strings.Join(u.AllowedValues, ", "))
		}
		parts = append(parts, fmt.Sprintf("(%s)", strings.Join(valueParts, "; ")))
	}
	if u.DocsLink != "" {
		parts = append(parts, fmt.Sprintf("[Learn more: %s]", u.DocsLink))
	}
	return strings.Join(parts, " ")
}
type BoolFlag struct {
	Meta
	Value        *bool
	DefaultValue bool
}
func (f BoolFlag) Register(fs *pflag.FlagSet) {
	if f.Shorthand == "" {
		fs.BoolVar(f.Value, f.Name, f.DefaultValue, f.Usage.String())
	} else {
		fs.BoolVarP(f.Value, f.Name, f.Shorthand, f.DefaultValue, f.Usage.String())
	}
	registerFlag(fs, f.Meta)
}
type CustomFlag struct {
	Meta
	Value pflag.Value
}
func (f CustomFlag) Register(fs *pflag.FlagSet) {
	if f.Shorthand == "" {
		fs.Var(f.Value, f.Name, f.Usage.String())
	} else {
		fs.VarP(f.Value, f.Name, f.Shorthand, f.Usage.String())
	}
	registerFlag(fs, f.Meta)
}
type StringSetOptions struct {
	Meta
	ValidValues []string
}
const (
	valueNone = "<none>"
)
func NewStringSetFlag(values *[]string, opts StringSetOptions) CustomFlag {
	var defaultValue string
	if values == nil || len(*values) == 0 {
		defaultValue = valueNone
	} else {
		defaultValues := make([]string, 0, len(*values))
		for _, value := range *values {
			defaultValues = append(defaultValues, fmt.Sprintf("%q", value))
		}
		defaultValue = fmt.Sprintf("[%s]", strings.Join(defaultValues, ","))
	}
	allowedValues := make([]string, 0, len(opts.ValidValues)+1)
	if defaultValue == valueNone {
		allowedValues = append(allowedValues, valueNone)
	}
	for _, validValue := range opts.ValidValues {
		allowedValues = append(allowedValues, fmt.Sprintf("%q", validValue))
	}
	return CustomFlag{
		Value: newStringSet(values, opts.ValidValues),
		Meta: Meta{
			Name:      opts.Name,
			Shorthand: opts.Shorthand,
			Usage: Usage{
				Description:   opts.Usage.Description,
				DefaultValue:  defaultValue,
				AllowedValues: allowedValues,
				Note:          opts.Usage.Note,
				DocsLink:      opts.Usage.DocsLink,
			},
			Hidden: opts.Hidden,
		},
	}
}
type StringFlag struct {
	Meta
	Value        *string
	DefaultValue string
}
func (f StringFlag) Register(fs *pflag.FlagSet) {
	if f.Shorthand == "" {
		fs.StringVar(f.Value, f.Name, f.DefaultValue, f.Usage.String())
	} else {
		fs.StringVarP(f.Value, f.Name, f.Shorthand, f.DefaultValue, f.Usage.String())
	}
	registerFlag(fs, f.Meta)
}
type StringArrayFlag struct {
	Meta
	Value        *[]string
	DefaultValue []string
}
func (f StringArrayFlag) Register(fs *pflag.FlagSet) {
	if f.Shorthand == "" {
		fs.StringArrayVar(f.Value, f.Name, f.DefaultValue, f.Usage.String())
	} else {
		fs.StringArrayVarP(f.Value, f.Name, f.Shorthand, f.DefaultValue, f.Usage.String())
	}
	registerFlag(fs, f.Meta)
}
type StringSliceFlag struct {
	Meta
	Value        *[]string
	DefaultValue []string
}