2019-08-04 04:35:44 +00:00
|
|
|
// Code generated by fg; DO NOT EDIT.
|
|
|
|
|
|
|
|
package {{ .PackageName }}
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
2019-08-04 14:53:32 +00:00
|
|
|
"github.com/urfave/cli"
|
2019-08-04 04:35:44 +00:00
|
|
|
)
|
|
|
|
{{ range $i, $flag := .Flags }}
|
|
|
|
// {{ $flag.Name }}Flag is the flag type that wraps cli.{{ $flag.Name }}Flag to allow
|
|
|
|
// for other values to be specified
|
|
|
|
type {{ $flag.Name }}Flag struct {
|
2019-08-04 14:53:32 +00:00
|
|
|
cli.{{ $flag.Name }}Flag
|
|
|
|
set *flag.FlagSet
|
2019-08-04 04:35:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// New{{ $flag.Name }}Flag creates a new {{ $flag.Name }}Flag
|
|
|
|
func New{{ $flag.Name }}Flag(fl cli.{{ $flag.Name }}Flag) *{{ $flag.Name }}Flag {
|
2019-08-04 14:53:32 +00:00
|
|
|
return &{{ $flag.Name }}Flag{ {{ $flag.Name }}Flag: fl, set: nil }
|
2019-08-04 04:35:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Apply saves the flagSet for later usage calls, then calls
|
|
|
|
// the wrapped {{ $flag.Name }}Flag.Apply
|
|
|
|
func (f *{{ $flag.Name }}Flag) Apply(set *flag.FlagSet) {
|
|
|
|
f.set = set
|
|
|
|
f.{{ $flag.Name }}Flag.Apply(set)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ApplyWithError saves the flagSet for later usage calls, then calls
|
|
|
|
// the wrapped {{ $flag.Name }}Flag.ApplyWithError
|
|
|
|
func (f *{{ $flag.Name }}Flag) ApplyWithError(set *flag.FlagSet) error {
|
2019-08-04 14:53:32 +00:00
|
|
|
f.set = set
|
|
|
|
return f.{{ $flag.Name }}Flag.ApplyWithError(set)
|
2019-08-04 04:35:44 +00:00
|
|
|
}
|
2019-08-04 05:34:23 +00:00
|
|
|
{{ end }}
|