arg_parser

package
v0.0.0-...-9f800d1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: ISC Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg interface{}

type ArgParser

type ArgParser struct{}

func New

func New() ArgParser

func (*ArgParser) Parse

func (p *ArgParser) Parse(args []string) ParseContext

type BulkConfig

type BulkConfig struct {
	Size int
}

type Command

type Command string
const (
	Today    Command = "today"
	Projects Command = "projects"
	Sync     Command = "sync"
	List     Command = "list"
	Add      Command = "add"
	Done     Command = "done"
	Edit     Command = "edit"
	Show     Command = "show"
	Start    Command = "start"
	Stop     Command = "stop"
	Get      Command = "get"
	Delete   Command = "delete"
	Help     Command = "help"
	Version  Command = "version"
)

type Config

type Config interface{}

func ConfigFromStr

func ConfigFromStr(str string) (Config, bool)

type ContextConfig

type ContextConfig struct {
	Context string
}

type Filter

type Filter interface{}

type IdFilter

type IdFilter struct {
	Ids []int
}

type Operator

type Operator string
const (
	Include Operator = "Include"
	Exclude Operator = "Exclude"
)

type ParseContext

type ParseContext struct {
	Config  []Config
	Command Command
	Filters []Filter
	Args    []Arg
}

type ParseStage

type ParseStage int
const (
	ConfigStage ParseStage = iota
	FilterStage
	ArgStage
)

type Scope

type Scope string
const (
	ScopePriority Scope = "priority"
)

type ScopedArg

type ScopedArg struct {
	Scope Scope
	Value string
}

type ScopedFilter

type ScopedFilter struct {
	Scope Scope
	Value string
}

type TagArg

type TagArg struct {
	Operator Operator
	Tag      string
}

type TagFilter

type TagFilter struct {
	Operator Operator
	Tag      string
}

type TextArg

type TextArg struct {
	Text string
}

type TextFilter

type TextFilter struct {
	Text string
}

Jump to

Keyboard shortcuts

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