Move printedFull closer to its use, document
This commit is contained in:
parent
67f81d2728
commit
5694cc5194
2 changed files with 9 additions and 1 deletions
9
file.go
9
file.go
|
|
@ -68,6 +68,15 @@ func (nptf *notPlainTextFlag) Type() string {
|
||||||
return "short|full|skip" // ???
|
return "short|full|skip" // ???
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// printedFull is set by file() if it prints a full file's matches
|
||||||
|
// (i.e. a header line, then the match lines). It is cleared if we
|
||||||
|
// just printed a "Binary file <foo> matches" line. It lets us have a
|
||||||
|
// nice one-line separator between full files, but show the binary
|
||||||
|
// matches compactly.
|
||||||
|
printedFull bool
|
||||||
|
)
|
||||||
|
|
||||||
func file(path string, data []byte) {
|
func file(path string, data []byte) {
|
||||||
var short string
|
var short string
|
||||||
isBinary, isMinified := notPlainText(data)
|
isBinary, isMinified := notPlainText(data)
|
||||||
|
|
|
||||||
1
main.go
1
main.go
|
|
@ -63,7 +63,6 @@ var (
|
||||||
ignoreCase bool
|
ignoreCase bool
|
||||||
noColour bool
|
noColour bool
|
||||||
display *Display
|
display *Display
|
||||||
printedFull bool
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue