Documentation ¶
Index ¶
Constants ¶
View Source
const ( ColorReset = "\x1b[0m\x1b[K" ColorLineNumber = "\x1b[1;33m" /* yellow with black background */ ColorPath = "\x1b[1;32m" /* bold green */ ColorMatch = "\x1b[30;43m" /* black with yellow background */ SeparatorColon = ":" SeparatorHyphen = "-" )
View Source
const ( UNKNOWN = iota ERROR BINARY ASCII UTF8 EUCJP SHIFTJIS )
View Source
const ( ExitCodeOK = iota ExitCodeError )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option struct { Version bool `long:"version" description:"Show version"` OutputOption *OutputOption `group:"Output Options"` SearchOption *SearchOption `group:"Search Options"` }
Top level options
type OutputOption ¶
type OutputOption struct { Color func() `long:"color" description:"Print color codes in results (default: true)"` NoColor func() `long:"nocolor" description:"Don't print color codes in results (default: false)"` EnableColor bool // Enable color. Not user option. Group func() `long:"group" description:"Print file name at header (default: true)"` NoGroup func() `long:"nogroup" description:"Don't print file name at header (default: false)"` EnableGroup bool // Enable group. Not user option. Column bool `long:"column" description:"Print column (default: false)"` After int `short:"A" long:"after" description:"Print lines after match"` Before int `short:"B" long:"before" description:"Print lines before match"` Context int `short:"C" long:"context" description:"Print lines before and after match"` FilesWithMatches bool `short:"l" long:"files-with-matches" description:"Only print filenames that contain matches"` Count bool `short:"c" long:"count" description:"Only print the number of matching lines for each input file."` OutputEncode string `short:"o" long:"output-encode" description:"Specify output encoding (none, jis, sjis, euc)"` }
Output options.
func (*OutputOption) SetDisableColor ¶
func (o *OutputOption) SetDisableColor()
func (*OutputOption) SetDisableGroup ¶
func (o *OutputOption) SetDisableGroup()
func (*OutputOption) SetEnableColor ¶
func (o *OutputOption) SetEnableColor()
func (*OutputOption) SetEnableGroup ¶
func (o *OutputOption) SetEnableGroup()
type PlatinumSearcher ¶
func (PlatinumSearcher) Run ¶
func (p PlatinumSearcher) Run(args []string) int
type SearchOption ¶
type SearchOption struct { Regexp bool `` /* 168-byte string literal not displayed */ IgnoreCase bool `short:"i" long:"ignore-case" description:"Match case insensitively"` SmartCase bool `short:"S" long:"smart-case" description:"Match case insensitively unless PATTERN contains uppercase characters"` WordRegexp bool `short:"w" long:"word-regexp" description:"Only match whole words"` Ignore []string `long:"ignore" description:"Ignore files/directories matching pattern"` VcsIgnore []string `long:"vcs-ignore" description:"VCS ignore files" default:".gitignore"` GlobalGitIgnore bool `long:"global-gitignore" description:"Use git's global gitignore file for ignore patterns"` HomePtIgnore bool `long:"home-ptignore" description:"Use $Home/.ptignore file for ignore patterns"` SkipVcsIgnore bool `short:"U" long:"skip-vcs-ignores" description:"Don't use VCS ignore file for ignore patterns"` FilesWithRegexp func(string) `short:"g" description:"Print filenames matching PATTERN"` EnableFilesWithRegexp bool // Enable files with regexp. Not user option. PatternFilesWithRegexp string // Pattern files with regexp. Not user option. FileSearchRegexp string `short:"G" long:"file-search-regexp" description:"PATTERN Limit search to filenames matching PATTERN"` Depth int `long:"depth" default:"25" description:"Search up to NUM directories deep"` Follow bool `short:"f" long:"follow" description:"Follow symlinks"` Hidden bool `long:"hidden" description:"Search hidden files and directories"` SearchStream bool // Input from pipe. Not user option. }
Search options.
func (*SearchOption) SetFilesWithRegexp ¶
func (o *SearchOption) SetFilesWithRegexp(p string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.