Documentation
¶
Index ¶
- Constants
- Variables
- 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) SetDisableLineNumber()
- func (o *OutputOption) SetEnableColor()
- func (o *OutputOption) SetEnableGroup()
- func (o *OutputOption) SetEnableLineNumber()
- 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 ¶
View Source
var NewLineBytes = []byte{10}
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.
Null bool `short:"0" long:"null" description:"Separate filenames with null (for 'xargs -0') (default: false)"`
Column bool `long:"column" description:"Print column (default: false)"`
LineNumber func() `long:"numbers" description:"Print Line number. (default: true)"`
NoLineNumber func() `short:"N" long:"nonumbers" description:"Omit Line number. (default: false)"`
ForceLineNumber bool // Force line number. Not user option.
EnableLineNumber bool // Enable line number. Not user option.
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) SetDisableLineNumber ¶
func (o *OutputOption) SetDisableLineNumber()
func (*OutputOption) SetEnableColor ¶
func (o *OutputOption) SetEnableColor()
func (*OutputOption) SetEnableGroup ¶
func (o *OutputOption) SetEnableGroup()
func (*OutputOption) SetEnableLineNumber ¶
func (o *OutputOption) SetEnableLineNumber()
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
¶
- buffer_grep.go
- decoder.go
- decorator.go
- encoder.go
- encoding.go
- extended_grep.go
- file_handler.go
- file_info.go
- find.go
- fixed_grep.go
- formatter.go
- grep.go
- ignore.go
- line_grep.go
- match.go
- match_state.go
- option.go
- passthrough_grep.go
- pattern.go
- platinum_searcher.go
- print.go
- readdir_dirent_ino.go
- readdir_unix.go
- search.go
- walk.go
Click to show internal directories.
Click to hide internal directories.