readline

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 7 Imported by: 45

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg string

func (Arg) IsAdditional

func (a Arg) IsAdditional() bool

func (Arg) IsFlag

func (a Arg) IsFlag() bool

func (Arg) IsPass

func (a Arg) IsPass() bool

func (Arg) IsPipe

func (a Arg) IsPipe() bool

func (Arg) IsRedirect

func (a Arg) IsRedirect() bool

func (Arg) String

func (a Arg) String() string

type Args

type Args []string

func (Args) At

func (a Args) At(v int) string

func (Args) Empty

func (a Args) Empty() bool

func (Args) Has

func (a Args) Has(v string) bool

func (Args) HasIndex

func (a Args) HasIndex(v int) bool

func (Args) Last

func (a Args) Last() string

func (Args) Len

func (a Args) Len() int

func (Args) LenGt

func (a Args) LenGt(v int) bool

func (Args) LenGte

func (a Args) LenGte(v int) bool

func (Args) LenIs

func (a Args) LenIs(v int) bool

func (Args) LenLt

func (a Args) LenLt(v int) bool

func (Args) LenLte

func (a Args) LenLte(v int) bool

func (Args) Shift added in v0.1.4

func (a Args) Shift() (string, Args)

type FlagSet

type FlagSet struct {
	*pflag.FlagSet
}

func NewFlagSet

func NewFlagSet(handler func(set *FlagSet)) *FlagSet

func (*FlagSet) GetBool

func (a *FlagSet) GetBool(name string) bool

func (*FlagSet) GetFloat64

func (a *FlagSet) GetFloat64(name string) float64

func (*FlagSet) GetInt64

func (a *FlagSet) GetInt64(name string) int64

func (*FlagSet) GetString

func (a *FlagSet) GetString(name string) string

type Mode

type Mode string
const (
	ModeArgs             Mode = ""
	ModeFlags            Mode = "flags"
	ModePassThroughArgs  Mode = "passThrough"
	ModePassThroughFlags Mode = "passThroughFlags"
	ModeAdditionalArgs   Mode = "additional"
)

type Option

type Option func(*Readline) error

func WithRegex

func WithRegex(v *regexp.Regexp) Option

type Readline

type Readline struct {
	// contains filtered or unexported fields
}

func New

func New(l log.Logger, opts ...Option) (*Readline, error)

func (*Readline) AdditionalArgs

func (a *Readline) AdditionalArgs() Args

func (*Readline) AllFlags

func (a *Readline) AllFlags() []*pflag.Flag

func (*Readline) AllPassThroughFlags

func (a *Readline) AllPassThroughFlags() []*pflag.Flag

func (*Readline) Args

func (a *Readline) Args() Args

func (*Readline) Cmd

func (a *Readline) Cmd() string

func (*Readline) FlagSet

func (a *Readline) FlagSet() *FlagSet

func (*Readline) Flags

func (a *Readline) Flags() Args

func (*Readline) IsModeAdditional

func (a *Readline) IsModeAdditional() bool

func (*Readline) IsModeDefault

func (a *Readline) IsModeDefault() bool

func (*Readline) IsModePassThrough

func (a *Readline) IsModePassThrough() bool

func (*Readline) Mode

func (a *Readline) Mode() Mode

func (*Readline) Parse

func (a *Readline) Parse(input string) error

func (*Readline) ParseFlags

func (a *Readline) ParseFlags() error

func (*Readline) ParsePassThroughFlags

func (a *Readline) ParsePassThroughFlags() error

func (*Readline) PassThroughArgs

func (a *Readline) PassThroughArgs() Args

func (*Readline) PassThroughFlagSet

func (a *Readline) PassThroughFlagSet() *FlagSet

func (*Readline) PassThroughFlags

func (a *Readline) PassThroughFlags() Args

func (*Readline) SetFlags

func (a *Readline) SetFlags(fs *FlagSet)

func (*Readline) SetParsePassThroughFlags

func (a *Readline) SetParsePassThroughFlags(fs *FlagSet)

func (*Readline) String

func (a *Readline) String() string

func (*Readline) VisitedFlags

func (a *Readline) VisitedFlags() []*pflag.Flag

Jump to

Keyboard shortcuts

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