opt

package
v0.0.0-...-88ab25c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sort

func Sort(flags []Option)

Types

type BoolOption

type BoolOption struct {
	DefaultValue bool
	// contains filtered or unexported fields
}

func NewOptionalBoolOption

func NewOptionalBoolOption(name Name, desc Desc, defaultValue bool) BoolOption

func NewRequiredBoolOption

func NewRequiredBoolOption(name Name, desc Desc) BoolOption

func (BoolOption) DefaultValueText

func (b BoolOption) DefaultValueText() string

func (BoolOption) Desc

func (b BoolOption) Desc() Desc

func (BoolOption) Name

func (b BoolOption) Name() Name

func (BoolOption) Required

func (b BoolOption) Required() bool

func (BoolOption) Type

func (b BoolOption) Type() Type

type Desc

type Desc string

type Name

type Name string

type Option

type Option interface {
	Required() bool
	Name() Name
	Desc() Desc
	Type() Type
	DefaultValueText() string
}

type StringOption

type StringOption struct {
	DefaultValue string
	// contains filtered or unexported fields
}

func NewOptionalStringOption

func NewOptionalStringOption(name Name, desc Desc, defaultValue string) StringOption

func NewRequiredStringOption

func NewRequiredStringOption(name Name, desc Desc) StringOption

func (StringOption) DefaultValueText

func (s StringOption) DefaultValueText() string

func (StringOption) Desc

func (s StringOption) Desc() Desc

func (StringOption) Name

func (s StringOption) Name() Name

func (StringOption) Required

func (s StringOption) Required() bool

func (StringOption) Type

func (s StringOption) Type() Type

type Type

type Type string
const (
	TypeString Type = "string"
	TypeBool   Type = "bool"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL