Versions in this module Expand all Collapse all v0 v0.7.0 Mar 19, 2024 v0.6.0 Mar 18, 2024 Changes in this version type Enum + func (e *Enum) MarshalYAML() (interface{}, error) + func (e *Enum) UnmarshalYAML(n *yaml.Node) error v0.5.0 Mar 15, 2024 Changes in this version + type Command struct + Aliases []string + Annotations Annotations + Children []*Command + Handler HandlerFunc + HelpHandler HandlerFunc + Hidden bool + Long string + Middleware MiddlewareFunc + Options OptionSet + Parent *Command + RawArgs bool + Short string + Use string + func (c *Command) AddSubcommands(cmds ...*Command) + func (c *Command) FullName() string + func (c *Command) FullOptions() OptionSet + func (c *Command) FullUsage() string + func (c *Command) Invoke(args ...string) *Invocation + func (c *Command) Name() string + func (c *Command) Walk(fn func(*Command)) v0.4.0 Feb 23, 2024 v0.3.0 Feb 23, 2024 Changes in this version + var DiscardValue discardValue + type Annotations map[string]string + func (a Annotations) Get(key string) (string, bool) + func (a Annotations) IsSet(key string) bool + func (a Annotations) Mark(key string, value string) Annotations + type Bool bool + func BoolOf(b *bool) *Bool + func (*Bool) NoOptDefValue() string + func (Bool) Type() string + func (b *Bool) Set(s string) error + func (b Bool) String() string + func (b Bool) Value() bool + type Cmd struct + Aliases []string + Annotations Annotations + Children []*Cmd + Handler HandlerFunc + HelpHandler HandlerFunc + Hidden bool + Long string + Middleware MiddlewareFunc + Options OptionSet + Parent *Cmd + RawArgs bool + Short string + Use string + func (c *Cmd) AddSubcommands(cmds ...*Cmd) + func (c *Cmd) FullName() string + func (c *Cmd) FullOptions() OptionSet + func (c *Cmd) FullUsage() string + func (c *Cmd) Invoke(args ...string) *Invocation + func (c *Cmd) Name() string + func (c *Cmd) Walk(fn func(*Cmd)) + type Duration time.Duration + func DurationOf(d *time.Duration) *Duration + func (Duration) Type() string + func (d *Duration) MarshalYAML() (interface{}, error) + func (d *Duration) Set(v string) error + func (d *Duration) String() string + func (d *Duration) UnmarshalYAML(n *yaml.Node) error + func (d *Duration) Value() time.Duration + type Enum struct + Choices []string + Value *string + func EnumOf(v *string, choices ...string) *Enum + func (e *Enum) Set(v string) error + func (e *Enum) String() string + func (e *Enum) Type() string + type EnvVar struct + Name string + Value string + type Environ []EnvVar + func ParseEnviron(environ []string, prefix string) Environ + func (e *Environ) Set(name, value string) + func (e Environ) Get(name string) string + func (e Environ) Lookup(name string) (string, bool) + func (e Environ) ToOS() []string + type Group struct + Description string + Name string + Parent *Group + YAML string + func (g *Group) Ancestry() []Group + func (g *Group) FullName() string + type HandlerFunc func(i *Invocation) error + type HostPort struct + Host string + Port string + func (*HostPort) Type() string + func (hp *HostPort) MarshalJSON() ([]byte, error) + func (hp *HostPort) MarshalYAML() (interface{}, error) + func (hp *HostPort) Set(v string) error + func (hp *HostPort) String() string + func (hp *HostPort) UnmarshalJSON(b []byte) error + func (hp *HostPort) UnmarshalYAML(n *yaml.Node) error + type Int64 int64 + func Int64Of(i *int64) *Int64 + func (Int64) Type() string + func (i *Int64) Set(s string) error + func (i Int64) String() string + func (i Int64) Value() int64 + type Invocation struct + Args []string + Command *Cmd + Environ Environ + Logger slog.Logger + Net Net + Stderr io.Writer + Stdin io.Reader + Stdout io.Writer + func (inv *Invocation) Context() context.Context + func (inv *Invocation) ParsedFlags() *pflag.FlagSet + func (inv *Invocation) Run() (err error) + func (inv *Invocation) SignalNotifyContext(parent context.Context, signals ...os.Signal) (ctx context.Context, stop context.CancelFunc) + func (inv *Invocation) WithContext(ctx context.Context) *Invocation + func (inv *Invocation) WithOS() *Invocation + func (inv *Invocation) WithTestParsedFlags(_ testing.TB, parsedFlags *pflag.FlagSet) *Invocation + func (inv *Invocation) WithTestSignalNotifyContext(_ testing.TB, ...) *Invocation + type MiddlewareFunc func(next HandlerFunc) HandlerFunc + func Chain(ms ...MiddlewareFunc) MiddlewareFunc + func RequireNArgs(want int) MiddlewareFunc + func RequireRangeArgs(start, end int) MiddlewareFunc + type Net interface + Listen func(network, address string) (net.Listener, error) + type NoOptDefValuer interface + NoOptDefValue func() string + type Option struct + Annotations Annotations + Default string + Description string + Env string + Flag string + FlagShorthand string + Group *Group + Hidden bool + Name string + Required bool + UseInstead []Option + Value pflag.Value + ValueSource ValueSource + YAML string + func (o *Option) UnmarshalJSON(data []byte) error + func (o Option) YAMLPath() string + type OptionSet []Option + func (optSet *OptionSet) Add(opts ...Option) + func (optSet *OptionSet) ByName(name string) *Option + func (optSet *OptionSet) FlagSet() *pflag.FlagSet + func (optSet *OptionSet) MarshalYAML() (any, error) + func (optSet *OptionSet) ParseEnv(vs []EnvVar) error + func (optSet *OptionSet) SetDefaults() error + func (optSet *OptionSet) UnmarshalJSON(data []byte) error + func (optSet *OptionSet) UnmarshalYAML(rootNode *yaml.Node) error + func (optSet OptionSet) Filter(filter func(opt Option) bool) OptionSet + type Regexp regexp.Regexp + func (Regexp) Type() string + func (r *Regexp) MarshalJSON() ([]byte, error) + func (r *Regexp) MarshalYAML() (interface{}, error) + func (r *Regexp) Set(v string) error + func (r *Regexp) UnmarshalJSON(data []byte) error + func (r *Regexp) UnmarshalYAML(n *yaml.Node) error + func (r *Regexp) Value() *regexp.Regexp + func (r Regexp) String() string + type RunCommandError struct + Cmd *Cmd + Err error + func (e *RunCommandError) Error() string + func (e *RunCommandError) Unwrap() error + type String string + func StringOf(s *string) *String + func (*String) NoOptDefValue() string + func (String) Type() string + func (s *String) Set(v string) error + func (s String) String() string + func (s String) Value() string + type StringArray []string + func StringArrayOf(ss *[]string) *StringArray + func (StringArray) Type() string + func (s *StringArray) Append(v string) error + func (s *StringArray) GetSlice() []string + func (s *StringArray) Replace(vals []string) error + func (s *StringArray) Set(v string) error + func (s StringArray) String() string + func (s StringArray) Value() []string + type Struct struct + Value T + func (s *Struct[T]) MarshalJSON() ([]byte, error) + func (s *Struct[T]) MarshalYAML() (interface{}, error) + func (s *Struct[T]) Set(v string) error + func (s *Struct[T]) String() string + func (s *Struct[T]) Type() string + func (s *Struct[T]) UnmarshalJSON(b []byte) error + func (s *Struct[T]) UnmarshalYAML(n *yaml.Node) error + type URL url.URL + func URLOf(u *url.URL) *URL + func (*URL) Type() string + func (u *URL) MarshalJSON() ([]byte, error) + func (u *URL) MarshalYAML() (interface{}, error) + func (u *URL) Set(v string) error + func (u *URL) String() string + func (u *URL) UnmarshalJSON(b []byte) error + func (u *URL) UnmarshalYAML(n *yaml.Node) error + func (u *URL) Value() *url.URL + type Validator struct + Value T + func Validate[T pflag.Value](opt T, validate func(value T) error) *Validator[T] + func (i *Validator[T]) MarshalJSON() ([]byte, error) + func (i *Validator[T]) MarshalYAML() (interface{}, error) + func (i *Validator[T]) Set(input string) error + func (i *Validator[T]) String() string + func (i *Validator[T]) Type() string + func (i *Validator[T]) Underlying() pflag.Value + func (i *Validator[T]) UnmarshalJSON(b []byte) error + func (i *Validator[T]) UnmarshalYAML(n *yaml.Node) error + type ValueSource string + const ValueSourceDefault + const ValueSourceEnv + const ValueSourceFlag + const ValueSourceNone + const ValueSourceYAML + type YAMLConfigPath string + func (*YAMLConfigPath) Type() string + func (p *YAMLConfigPath) Set(v string) error + func (p *YAMLConfigPath) String() string v0.2.0 Feb 22, 2024 v0.1.0 Feb 21, 2024