Files
kyanos/agent/render/watch/option.go
AS! 1c0dd7288a feat: Add json-output params to watch command (#235)
* feat: Add json-output params to watch command

* docs: modify some field explain

* docs: modify column name
2025-01-02 18:46:46 +08:00

30 lines
571 B
Go

package watch
import (
"strings"
)
type WatchOptions struct {
WideOutput bool
StaticRecord bool
Opts string
DebugOutput bool
JsonOutput string
MaxRecordContentDisplayBytes int
MaxRecords int
}
func (w *WatchOptions) Init() {
if w.Opts != "" {
if strings.Contains(w.Opts, "wide") {
w.WideOutput = true
}
}
if w.MaxRecordContentDisplayBytes <= 0 {
w.MaxRecordContentDisplayBytes = 1024
}
if w.MaxRecords <= 0 {
w.MaxRecords = 100
}
}