From 3b3fc9ebfce6e0944b12b929b6abc95251a0e64e Mon Sep 17 00:00:00 2001 From: JP Appel Date: Wed, 2 Jul 2025 00:58:51 -0400 Subject: Add WriteTo like methods to Outputter interface The additional methods `OutputOneTo` and `OutputTo` allow outputting a document or documents directly to a writer. --- pkg/shell/interpreter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/shell') diff --git a/pkg/shell/interpreter.go b/pkg/shell/interpreter.go index a73fc93..6c1a89a 100644 --- a/pkg/shell/interpreter.go +++ b/pkg/shell/interpreter.go @@ -512,11 +512,11 @@ out: return false, fmt.Errorf("Error occured while excuting query: %s", err) } - s, err := query.DefaultOutput{}.Output(slices.Collect(maps.Values(results))) + _, err = query.DefaultOutput{}.OutputTo(w, slices.Collect(maps.Values(results))) if err != nil { return false, fmt.Errorf("Can't output results: %s", err) } - fmt.Fprintln(w, s) + fmt.Fprintln(w) case ITOK_VAR_NAME: val, ok := inter.State[t.Text] if !ok { -- cgit v1.2.3