Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Pattern string `flag:"" desc:"Search pattern (regex or literal)"`
Recursive bool `flag:"" desc:"Search recursively in directories"`
LineNumbers bool `flag:"" desc:"Show line numbers"`
FilesWithMatches bool `flag:"" desc:"Show only file names with matches"`
CaseInsensitive bool `flag:"" desc:"Case insensitive search"`
WordMatch bool `flag:"" desc:"Match whole words only"`
AfterContext int `flag:"" desc:"Number of context lines after match"`
BeforeContext int `flag:"" desc:"Number of context lines before match"`
ContextLines int `flag:"" desc:"Number of context lines around match"`
CountOnly bool `flag:"" desc:"Count matches only, don't show content"`
InvertMatch bool `flag:"" desc:"Invert match - show non-matching lines"`
ExtendedRegex bool `flag:"" desc:"Use extended regular expressions"`
FixedStrings bool `flag:"" desc:"Treat pattern as literal string"`
Include string `flag:"" desc:"Include files matching pattern (e.g., *.go)"`
ExcludeDir string `flag:"" desc:"Exclude directories matching pattern"`
MaxCount int `flag:"" desc:"Stop after N matches"`
XML bool
JSON bool
Plain bool
Pretty bool
}
type GrepFileMatch ¶
type GrepResult ¶
type GrepResult struct {
XMLName xml.Name `xml:"grep"`
Pattern string `xml:"pattern,attr"`
Flags string `xml:"flags,attr"`
Recursive string `xml:"recursive,attr"`
CaseSensitive string `xml:"case_sensitive,attr"`
MatchType string `xml:"match_type,attr"`
SearchedFiles int `xml:"searched_files,attr"`
MatchedFiles int `xml:"matched_files,attr"`
TotalMatches int `xml:"total_matches,attr"`
SearchRoot string `xml:"search_root,attr"`
Timestamp int64 `xml:"timestamp,attr"`
Matches []GrepFileMatch `xml:"match"`
Errors []GrepError `xml:"error,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.