Documentation ¶
Index ¶
- Constants
- type Option
- type OutputOption
- func (o *OutputOption) SetColorLineNumber(code string)
- func (o *OutputOption) SetColorMatch(code string)
- func (o *OutputOption) SetColorPath(code string)
- func (o *OutputOption) SetDisableColor()
- func (o *OutputOption) SetDisableGroup()
- func (o *OutputOption) SetEnableColor()
- func (o *OutputOption) SetEnableGroup()
- type PlatinumSearcher
- type SearchOption
Constants ¶
View Source
const ( ColorReset = "\x1b[0m\x1b[K" 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)"` ForceColor bool // Force color. Not user option. EnableColor bool // Enable color. Not user option. ColorLineNumber func(string) `long:"color-line-number" description:"Color codes for line numbers (default: 1;33)"` ColorPath func(string) `long:"color-path" description:"Color codes for path names (default: 1;32)"` ColorMatch func(string) `long:"color-match" description:"Color codes for result matches (default: 30;43)"` ColorCodeLineNumber string // Color line numbers. Not user option. ColorCodePath string // Color path names. Not user option. ColorCodeMatch string // Color result matches. 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)"` ForceGroup bool // Force group. Not user option. 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) SetColorLineNumber ¶
func (o *OutputOption) SetColorLineNumber(code string)
func (*OutputOption) SetColorMatch ¶
func (o *OutputOption) SetColorMatch(code string)
func (*OutputOption) SetColorPath ¶
func (o *OutputOption) SetColorPath(code string)
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.