mirror of
https://github.com/hengyoush/kyanos.git
synced 2025-12-20 01:03:46 +08:00
* feat: Add json-output params to watch command * docs: modify some field explain * docs: modify column name
30 lines
571 B
Go
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
|
|
}
|
|
}
|