Documentation
¶
Index ¶
Constants ¶
View Source
const ( DEFAULT_HINT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz" FILE_EXTENSION = `\.(?:[a-zA-Z0-9]{2,7}|[ahcmo])(?:\b|[^.])` )
Variables ¶
View Source
var PostProcessorMap = sync.OnceValue(func() map[string]PostProcessorFunc { return map[string]PostProcessorFunc{ "url": func(text string, s, e int) (int, int) { if s > 4 && text[s-5:s] == "link:" { url := text[s:e] idx := strings.LastIndex(url, "[") if idx > -1 { e -= len(url) - idx } } for e > 1 && is_punctuation(char_at(text, e)) { e-- } if s > 0 && e <= len(text) && closing_bracket_for(char_at(text, s-1)) != "" { q := closing_bracket_for(char_at(text, s-1)) idx := strings.Index(text[s:], q) if idx > 0 { e = s + idx } } if e > 3 && text[e-2:e] == "`_" { e -= 2 } return s, e }, "brackets": matching_remover("(", "{", "[", "<"), "quotes": matching_remover("'", `"`, "“", "‘"), "ip": func(text string, s, e int) (int, int) { addr := ipaddr.NewHostName(text[s:e]) if !addr.IsAddress() { return -1, -1 } return s, e }, } })
Functions ¶
func EntryPoint ¶
Types ¶
type Capture ¶
type ErrNoMatches ¶
type ErrNoMatches struct{ Type, Pattern string }
func (*ErrNoMatches) Error ¶
func (self *ErrNoMatches) Error() string
type Group ¶
func (Group) LastCapture ¶
type GroupProcessorFunc ¶
type Result ¶
type Result struct { Match []string `json:"match"` Programs []string `json:"programs"` Multiple_joiner string `json:"multiple_joiner"` Customize_processing string `json:"customize_processing"` Type string `json:"type"` Groupdicts []map[string]any `json:"groupdicts"` Extra_cli_args []string `json:"extra_cli_args"` Linenum_action string `json:"linenum_action"` Cwd string `json:"cwd"` }
Click to show internal directories.
Click to hide internal directories.