cmd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagDistance          = "distance"
	FlagDistanceShorthand = "d"
)
View Source
const (
	FlagApply          = "apply"
	FlagApplyShorthand = "a"
)
View Source
const (
	ErrAPI = common.Error("api error")
)
View Source
const (
	ErrPatchNotFound = common.Error("path not found")
)

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func NewCacheCmd

func NewCacheCmd() *cobra.Command

func NewCacheUpdateCmd

func NewCacheUpdateCmd() *cobra.Command

func NewMXattrCmd

func NewMXattrCmd() *cobra.Command

func NewMatchCmd

func NewMatchCmd() *cobra.Command

func NewRootCmd

func NewRootCmd() *cobra.Command

func NewSearchCmd

func NewSearchCmd() *cobra.Command

func NewTagCmd

func NewTagCmd() *cobra.Command

Types

type MatchResult

type MatchResult struct {
	MatchTerm  string
	SearchTerm string // normalized search term
	FoundTitle string
	FoundID    int
	Distance   float64
}

func (*MatchResult) Episode

func (m *MatchResult) Episode() string

func (*MatchResult) IsMatch

func (m *MatchResult) IsMatch(lowerBoundary float64) bool

func (*MatchResult) String

func (m *MatchResult) String() string

func (*MatchResult) Tag

func (m *MatchResult) Tag() string

func (*MatchResult) TaggedPath

func (m *MatchResult) TaggedPath() string

type MatchResults

type MatchResults []MatchResult

func Match

func Match(cmd *cobra.Command, paths []string) (MatchResults, error)

func (MatchResults) LongestMatchTerm

func (m MatchResults) LongestMatchTerm() int

func (MatchResults) LongestTaggedPath

func (m MatchResults) LongestTaggedPath() int

func (MatchResults) Sort

func (m MatchResults) Sort()

Jump to

Keyboard shortcuts

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