aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/shell
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2025-07-02 00:58:51 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2025-07-02 00:58:51 -0400
commit3b3fc9ebfce6e0944b12b929b6abc95251a0e64e (patch)
tree93ceba85721f18cf7f05b51bf389c6dd1d1439f1 /pkg/shell
parentba68130862dc004a7a1b50d99fc70872d39fd065 (diff)
Add WriteTo like methods to Outputter interface
The additional methods `OutputOneTo` and `OutputTo` allow outputting a document or documents directly to a writer.
Diffstat (limited to 'pkg/shell')
-rw-r--r--pkg/shell/interpreter.go4
1 files changed, 2 insertions, 2 deletions
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 {