30 lines
754 B
Go Template
30 lines
754 B
Go Template
// WARNING: this file is generated. DO NOT EDIT
|
|
|
|
package {{.PackageName}}
|
|
|
|
{{range .SortedFlagTypes}}
|
|
// {{.TypeName}} is the flag type that wraps cli.{{.TypeName}} to allow
|
|
// for other values to be specified
|
|
type {{.TypeName}} struct {
|
|
*cli.{{.TypeName}}
|
|
set *flag.FlagSet
|
|
}
|
|
|
|
// New{{.TypeName}} creates a new {{.TypeName}}
|
|
func New{{.TypeName}}(fl *cli.{{.TypeName}}) *{{.TypeName}} {
|
|
return &{{.TypeName}}{{"{"}}{{.TypeName}}: fl, set: nil}
|
|
}
|
|
|
|
// Apply saves the flagSet for later usage calls, then calls
|
|
// the wrapped {{.TypeName}}.Apply
|
|
func (f *{{.TypeName}}) Apply(set *flag.FlagSet) error {
|
|
f.set = set
|
|
return f.{{.TypeName}}.Apply(set)
|
|
}
|
|
{{end}}{{/* /range .SortedFlagTypes */}}
|
|
|
|
// vim{{/* 👻 */}}:ro
|
|
{{/*
|
|
vim:filetype=gotexttmpl
|
|
*/}}
|