diff options
Diffstat (limited to 'src/core.go')
-rw-r--r-- | src/core.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core.go b/src/core.go index e707ad5f..f7dae1a3 100644 --- a/src/core.go +++ b/src/core.go @@ -151,7 +151,7 @@ func Run(opts *Options) { // Filtering mode if opts.Filter != nil { if opts.PrintQuery { - fmt.Println(*opts.Filter) + opts.Printer(*opts.Filter) } pattern := patternBuilder([]rune(*opts.Filter)) @@ -164,7 +164,7 @@ func Run(opts *Options) { item := chunkList.trans(runes, 0) if item != nil { if result, _, _ := pattern.MatchItem(item, false, slab); result != nil { - fmt.Println(item.text.ToString()) + opts.Printer(item.text.ToString()) found = true } } @@ -180,7 +180,7 @@ func Run(opts *Options) { chunks: snapshot, pattern: pattern}) for i := 0; i < merger.Length(); i++ { - fmt.Println(merger.Get(i).item.AsString(opts.Ansi)) + opts.Printer(merger.Get(i).item.AsString(opts.Ansi)) found = true } } @@ -254,13 +254,13 @@ func Run(opts *Options) { } else if val.final { if opts.Exit0 && count == 0 || opts.Select1 && count == 1 { if opts.PrintQuery { - fmt.Println(opts.Query) + opts.Printer(opts.Query) } if len(opts.Expect) > 0 { - fmt.Println() + opts.Printer("") } for i := 0; i < count; i++ { - fmt.Println(val.Get(i).item.AsString(opts.Ansi)) + opts.Printer(val.Get(i).item.AsString(opts.Ansi)) } if count > 0 { os.Exit(exitOk) |