Skip to content

Commit 747f1ae

Browse files
committed
Display text how to exit --follow mode (for 5 seconds)
1 parent a376789 commit 747f1ae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/app/cli/cmd_now.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,15 @@ func withRepeat(ctx app.Context, fn func() error) error {
113113
ctx.Print("\033[2J") // Initial screen clearing
114114
ticker := gotime.NewTicker(1 * gotime.Second)
115115
defer ticker.Stop()
116+
i := 5 // seconds to display help text (how to exit)
116117
for ; true; <-ticker.C {
117118
ctx.Print(fmt.Sprintf("\033[H\033[J")) // Cursor reset
118119
err := fn()
119120
ctx.Print("\n")
121+
if i > 0 {
122+
ctx.Print("Press ^C to exit")
123+
i--
124+
}
120125
if err != nil {
121126
return err
122127
}

0 commit comments

Comments
 (0)