From 574ef5550b3faffdf69ab98440849449d2890ba3 Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Mon, 6 Jun 2022 17:06:45 -0300 Subject: [PATCH] docs: use wish.Println on examples Signed-off-by: Carlos A Becker --- examples/bubbletea/main.go | 2 +- examples/bubbleteaprogram/main.go | 3 +-- examples/simple/main.go | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/bubbletea/main.go b/examples/bubbletea/main.go index 3a54db5..e14b0a0 100644 --- a/examples/bubbletea/main.go +++ b/examples/bubbletea/main.go @@ -62,7 +62,7 @@ func main() { func teaHandler(s ssh.Session) (tea.Model, []tea.ProgramOption) { pty, _, active := s.Pty() if !active { - fmt.Println("no active terminal, skipping") + wish.Fatalln(s, "no active terminal, skipping") return nil, nil } m := model{ diff --git a/examples/bubbleteaprogram/main.go b/examples/bubbleteaprogram/main.go index 4beb282..9fcc372 100644 --- a/examples/bubbleteaprogram/main.go +++ b/examples/bubbleteaprogram/main.go @@ -72,8 +72,7 @@ func myCustomBubbleteaMiddleware() wish.Middleware { teaHandler := func(s ssh.Session) *tea.Program { pty, _, active := s.Pty() if !active { - fmt.Println("no active terminal, skipping") - _ = s.Exit(1) + wish.Fatalln(s, "no active terminal, skipping") return nil } m := model{ diff --git a/examples/simple/main.go b/examples/simple/main.go index fa0032b..2faa474 100644 --- a/examples/simple/main.go +++ b/examples/simple/main.go @@ -26,7 +26,7 @@ func main() { wish.WithMiddleware( func(h ssh.Handler) ssh.Handler { return func(s ssh.Session) { - fmt.Fprintln(s, "Hello, world!") + wish.Println(s, "Hello, world!") h(s) } },