Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion cmp/report_compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ import (
)

// numContextRecords is the number of surrounding equal records to print.
const numContextRecords = 2
var numContextRecords = 2

func SetNumContextRecords(n int) {
numContextRecords = n
}

func GetNumContextRecords() int {
return numContextRecords
}

type diffMode byte

Expand Down Expand Up @@ -57,15 +65,18 @@ func (opts formatOptions) WithDiffMode(d diffMode) formatOptions {
opts.DiffMode = d
return opts
}

func (opts formatOptions) WithTypeMode(t typeMode) formatOptions {
opts.TypeMode = t
return opts
}

func (opts formatOptions) WithVerbosity(level int) formatOptions {
opts.VerbosityLevel = level
opts.LimitVerbosity = true
return opts
}

func (opts formatOptions) verbosity() uint {
switch {
case opts.VerbosityLevel < 0:
Expand Down