Documentation
¶
Index ¶
- Variables
- func Split(s string) ([]string, error)
- type DefaultState
- func (s *DefaultState) Advance() bool
- func (s *DefaultState) ArgAt(pos int) (string, error)
- func (s *DefaultState) Args() []string
- func (s *DefaultState) CurrentArg() string
- func (s *DefaultState) CurrentPos() int
- func (s *DefaultState) InsertArgsAt(pos int, newArgs ...string)
- func (s *DefaultState) Len() int
- func (s *DefaultState) Peek() string
- func (s *DefaultState) ReplaceArgs(newArgs ...string)
- func (s *DefaultState) SetPos(pos int)
- func (s *DefaultState) SkipCurrent()
- type State
Constants ¶
This section is empty.
Variables ¶
View Source
var InvalidPositionError = errors.New("invalid position")
Functions ¶
Types ¶
type DefaultState ¶ added in v1.6.0
type DefaultState struct {
// contains filtered or unexported fields
}
func NewState ¶ added in v1.6.0
func NewState(args []string) *DefaultState
func (*DefaultState) Advance ¶ added in v1.6.0
func (s *DefaultState) Advance() bool
func (*DefaultState) Args ¶ added in v1.6.0
func (s *DefaultState) Args() []string
func (*DefaultState) CurrentArg ¶ added in v1.6.0
func (s *DefaultState) CurrentArg() string
func (*DefaultState) CurrentPos ¶ added in v1.6.0
func (s *DefaultState) CurrentPos() int
func (*DefaultState) InsertArgsAt ¶ added in v1.6.0
func (s *DefaultState) InsertArgsAt(pos int, newArgs ...string)
func (*DefaultState) Len ¶ added in v1.6.0
func (s *DefaultState) Len() int
func (*DefaultState) Peek ¶ added in v1.6.0
func (s *DefaultState) Peek() string
func (*DefaultState) ReplaceArgs ¶ added in v1.6.0
func (s *DefaultState) ReplaceArgs(newArgs ...string)
func (*DefaultState) SetPos ¶ added in v1.6.0
func (s *DefaultState) SetPos(pos int)
func (*DefaultState) SkipCurrent ¶ added in v1.6.0
func (s *DefaultState) SkipCurrent()
type State ¶ added in v1.6.0
type State interface { CurrentPos() int SetPos(pos int) SkipCurrent() Args() []string InsertArgsAt(pos int, newArgs ...string) ReplaceArgs(newArgs ...string) CurrentArg() string Peek() string Advance() bool // New method for advancing to the next argument Len() int // Gets the length of the argument list }
Click to show internal directories.
Click to hide internal directories.